Dr. Gianluigi Zane Zanettini asked:
I’m trying to prevent my CentOS 6.5 server from sending out emails to a certain list of recipients. (
firstname.lastname@example.org and so on).
I’ve configured postfix like this:
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_access
email@example.com REJECT firstname.lastname@example.org REJECT
DB is built via:
postfix is reloaded
service postfix reload
sendmail_path = /usr/sbin/sendmail -t -i
Unfortunately this doesn’t seems to work. If i use PHP mail() to send a mail to
email@example.com, it is delivered as always.
What am I missing?
You may be able to abuse
smtp_generic_maps to divert this mail. Unlike the other directives you mentioned, this one operates on outgoing mail.
While it’s not capable of dropping it, it can send it to a different mailbox, where you can then take appropriate action on it (such as suspending the customer who sent the mail).
main.cf you would have:
smtp_generic_maps = hash:/etc/postfix/generic
firstname.lastname@example.org email@example.com firstname.lastname@example.org email@example.com
This should send all such mail to your abuse mailbox for you to act on.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.