123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119typepolicy=None|Quarantine|Rejecttypemode=Relaxed|Stricttypeinterval=inttypepercent=inttypekeyword=stringtypeuri=Uri.t*int64optionletpp_policyppf=function|None->Fmt.stringppf"none"|Quarantine->Fmt.stringppf"quarantine"|Reject->Fmt.stringppf"reject"letpolicy_of_string=function|"quarantine"->Quarantine|"reject"->Reject|"none"->None|str->Fmt.failwith"Invalid policy: %S"strletpp_modeppf=function|Relaxed->Fmt.stringppf"relaxed"|Strict->Fmt.stringppf"strict"letmode_of_string=function|"r"->Relaxed|"s"->Strict|str->Fmt.failwith"Invalid mode: %S"strletpp_interval=Fmt.intletpp_percent=Fmt.intletpp_keyword=Fmt.stringletpp_urippf(uri,(weight:int64option))=matchweightwith|None->Fmt.pfppf"%s"(Uri.to_stringuri)|Someweight->Fmt.pfppf"%s!%Ld"(Uri.to_stringuri)weighttype'atag={name:string;pp:'aFmt.t}moduleInfo=structtype'at='atag={name:string;pp:'aFmt.t}endincludeHmap.Make(Info)moduleK=structletp:stringkey=Key.create{name="Requested Mail Receiver policy";pp=Fmt.string}letsp:stringkey=Key.create{name="Requested Mail Receiver policy for sub-domains";pp=Fmt.string}letadkim:modekey=Key.create{name="DKIM Identifier alignment";pp=pp_mode}letaspf:modekey=Key.create{name="SPF Identifier alignment";pp=pp_mode}letfo:[`_0|`_1|`D|`S]key=letppppf=function|`_0->Fmt.stringppf"0"|`_1->Fmt.stringppf"1"|`D->Fmt.stringppf"d"|`S->Fmt.stringppf"s"inKey.create{name="Failure reporting";pp}letrf:(string*stringlist)key=letppppf(x,r)=Fmt.(Dump.liststring)ppf(x::r)inKey.create{name="Format to be used for message-specific failure reports";pp}letpct:percentkey=Key.create{name="Percentage";pp=Fmt.int}letri:intervalkey=Key.create{name="Interval requested between aggregate reports";pp=Fmt.int}letrua:urilistkey=Key.create{name="Addresses to which aggregate feedback is to be sent";pp=Fmt.(Dump.listpp_uri)}letruf:urilistkey=Key.create{name="Addresses to which message-specific failure information is be \
reported";pp=Fmt.(Dump.listpp_uri)}endletfailure_reporting_of_string=function|"0"->`_0|"1"->`_1|"d"->`D|"s"->`S|str->Fmt.failwith"Invalid failure reporting: %S"strletvalues_to_maplst=letfacc=function|`Pv->addK.pvacc|`SPv->addK.spvacc|`RUAvs->addK.ruavsacc|`RUFvs->addK.rufvsacc|`ADKIMv->addK.adkim(mode_of_stringv)acc|`ASPFv->addK.aspf(mode_of_stringv)acc|`RIv->addK.rivacc|`FOv->addK.fo(failure_reporting_of_stringv)acc|`RF(x::r)->addK.rf(x,r)acc|`RF[]->acc|`PCTv->addK.pctvacc|`V_->accinList.fold_leftfemptylst