On Tue, 21 Jan 2020 at 12:54, rdquiterio <rafael.quite...@gmail.com> wrote:
> Hi; > > I made a filter to let postfix relay messages from specific senders. I > tested the filter via telnet (mail from: rcpt to: data …) on the postfix > server and it was doing ok. > > But, after deployment, the filter is failing and I suppose that it may be > due to the Return-Path field on the "real" message. > > Any clue? Thank you. > > This is on my main.cf: > > smtpd_relay_restrictions = > reject_unauth_pipelining, > reject_non_fqdn_recipient, > reject_invalid_hostname, > reject_non_fqdn_hostname, > reject_non_fqdn_sender, > reject_unknown_sender_domain, > reject_unknown_recipient_domain, > check_sender_access hash:/etc/postfix/senders, > check_recipient_access hash:/etc/postfix/users_internet_mail, > reject > > > And this is on the "real" message: > > . > . > . > > From: <no-reply@some.domain> > To: <my.user@my.domain> > . > . > . > > Return-Path: > > f9895e47.ANEAAF6zi2UAAAAAAAAAAKnhCGkAASpLLm4AAAAAAA0fMwBeHFnT@another.domain > check_sender_access checks against the envelope sender (i.e. the return-path), not the 'From:' header. If you want to check the 'From:' header, use header_checks.