Thanks everyone for the great ideas. I'll try the 'envfrom' tomorrow.

Wietse Venema <wie...@porcupine.org> ezt írta (időpont: 2022. máj.
23., H, 15:46):
>
> juan smitt:
> > Hi,
> >
> >
> > We got a request to match the envelope sender with a certain mail
> > header (i.e. X-Something) on our relay servers for every outbound
> > mails and reject the email if the sender and the value of this header
> > don't match.
> >
> > It's also possible for a sender to have more than one valid X-Something 
> > value.
> >
> > Something like this:
> > * senderdomain1.example is only valid with 'v1', 'v66', 'v99'
> > X-Something header values
> > * senderdomain2.example is only valid with 'v5'
> > * senderdomain3.example is only valid with 'v11' and 'v546'
> >
> > etc, etc
> >
> > Is this possible with postfix?
>
> It's not built-in, but should be possible with smtpd_milters. For
> example, milter-regex allows you to define rules like:
>
> reject "X-Something header is not valid for senderdomain1.example"
> envfrom /@senderdomain1\.example$/ and not (header /^X-Something/ /^v1$/ or 
> header /^X-Something/ /^v66$/ or header /^X-Something/ /^v99$/)
>
> This is not something that should be maintained by hand. Instead,
> write a script that generates such rules from an easier to maintain
> table.
>
>         Wietse

Reply via email to