Hi,

> >> Example:
> > >>
> > >> /etc/postfix/main.cf:
> > >>     smtpd_milters = inet:127.0.0.1:9999
> > >>
> > >> /etc/mail/milter-regex.conf:
> > >>     reject
> > >>     header /From/ /^user@baddom\.tld$/i and envrcpt /@example\.com$/i
> > >
> > It looks like this is the place to start?
> > https://github.com/milter-regex/milter-regex/tree/main


Just for completeness, I needed this to make it work. Notice the reject
message and <> to match the header.

reject "bad email"
header /From/ /^<u...@baddom.tld>$ and envrcpt /@example.com>$/i

syslog: mail-lf1-f42.google.com [209.85.167.42]: cb_envfrom('<
j...@example.com>')
syslog: mail-lf1-f42.google.com [209.85.167.42]: macro {mail_addr} =
u...@baddom.tld
syslog: mail-lf1-f42.google.com [209.85.167.42]: cb_header('Received-SPF',
'Pass (mailfrom) identity=mailfrom; client-ip=209.85.167.42; helo=
mail-lf1-f42.google.com; envelope-from=u...@baddom.tld; receiver=baddom.tld
')
syslog: mail-lf1-f42.google.com [209.85.167.42]: cb_header('From', 'Alex
<u...@baddom.tld>')
syslog: mail-lf1-f42.google.com [209.85.167.42]: REJECT: bad address, HELO:
mail-lf1-f42.google.com, FROM: <u...@baddom.tld>, RCPT: <j...@example.com>,
From: Alex <u...@baddom.tld>, To: , Subject:

alex
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to