A check_expn rule I wrote a while ago. This also works for use as a check_vrfy rule. It could probably use a little clean up or canonicalizing into Sendmail Standard Form.
Basic logic:EXPN:webmaster@foo.domain.com OK EXPN:postmaster OK EXPN:root@bar.domain.com DENY
EXPN:127.0.0.1 OK # allow localhost to expn EXPN:128.32.0.0 OK # allow UCB-ETHER to expn sendmail.mc: ... LOCAL_RULESETS Scheck_expn R$* $: $>F <$1> <?> <! Expn> <$1> R<?> <$*> $: <$&{client_addr}> <$1> R<$*> <$*> $: $>A <$1> <?> <! Expn> <$2> R<OK> <$*> $@ $1 R$* $#error $@ 5.7.0 $: "502 sorry, we do not allow this operation."
Notes: This rule, as written, has the behaviour of denying EXPN on 'verboten' email addresses even if the query comes from an allowed IP range. Changing this is left as an excercise to the reader. Essentially:
Feedback, questions, comments? Email me