2

I have a postfix MX server setup with virtual users in sql tables. One of the old users I had is getting a large amount of spam, and the catchall address is getting it all. Is there a way to prevent all mail to a specific recipient to be blocked and not delivered to the catch all?

Thanks, Nat

Nat45928
  • 121
  • 2
  • 4
  • 13

1 Answers1

3

If you have a table called /etc/postfix/sender_access that looks like

annoying_person@irritating.domain.com  REJECT

and this in your main.cf:

smtpd_recipient_restrictions =
  ...
  check_recipient_access hash:/etc/postfix/sender_access
  ...

then the SMTP daemon will refuse the message with

554 5.7.1 <annoying_person@irritating.domain.com>: Sender address rejected: Access denied
Flup
  • 7,978
  • 2
  • 32
  • 43
  • im trying to block mail TO an email not who mail is FROM – Nat45928 Mar 21 '13 at 17:20
  • 1
    got it, it was what you said but instead of "check_sender_access" it needs to be "check_recipient_access" – Nat45928 Mar 21 '13 at 18:06
  • 1
    D'oh, yes of course, sorry about that, I cut and pasted from my own config without passing it through my brain. Glad you got it sorted anyway. – Flup Mar 22 '13 at 08:17