On 22 November 2017 at 12:52, @lbutlr <krem...@kreme.com> wrote: > Is it possible to reject a mail from a specific domain to a specific user? > > Obviously, there are other ways to deal with this, but I have a case where > I’d prefer to reject the mail before it is received but I do not want to > block the domain for other users.
Untested concept only, so corrections/improvement are welcome. Use a restriction list that is not used otherwise (here: smtpd_client_restrictions): /etc/postfix/main.cf: <snip> # using smtpd_client_restrictions you must have # smtpd_delay_reject = yes (the default) so it is evaluated # at the time of the RCPT TO command, otherwise # check_sender_access and check_recipient_access won't work smtpd_delay_reject = yes smtpd_client_restrictions = check_sender_access pcre:/etc/postfix/sender_access.pcre check_recipient_access hash:/etc/postfix/recipient_access permit <snip> /etc/postfix/sender_access.pcre: /^permit...@sender.tld$/ DUNNO /.*/ OK /etc/postfix/recipient_access: permit...@recipient.tld REJECT