divert(-1) LOCAL_CONFIG Kstorage macro # call ruleset CheckMessageId with the value of the message-id header HMessage-Id: $>CheckMessageId LOCAL_RULESETS SCheckMessageId R$* $: $(storage {MessageIdCheck} $@ OK $) $1 R< $+ @ $+ > $@ OK R$* $#error $@ quarantine $: "553 Invalid Message-Id Header Error" Scheck_eoh # Check the macro R$* $: < $&{MessageIdCheck} > # Clear the macro for the next message R$* $: $(storage {MessageIdCheck} $) $1 # Has a Message-Id: header R< $+ > $@ OK # Allow missing Message-Id: from local mail R$* $: < $&{client_name} > R< > $@ OK R< $=w > $@ OK # Allow missing Message-Id: from access list # MsgId:remote.domain.name OK R$* $: $>D <$&{client_name}> <> R<$={Accept}> <$*> $@ $1 return value of lookup # Otherwise, reject the mail R$* $#error $@ quarantine $: "553 Invalid Message-Id Header Error"