In sendmail, I can have a catchall address and reject email going to certain addresses in my aliases or virtusertable files:

adm@example.com                        error:5.1.1:550 User unknown
apache@example.com                     michael
root@example.com                       michael
daemon@example.com                     error:5.1.1:550 User unknown
dbus@example.com                       error:5.1.1:550 User unknown
ftp@example.com                        error:5.1.1:550 User unknown
@example.com                           catchall

But the above doesn't work in the postfix maps - it tries to deliver to the error: address.

What's the right way to accomplish this in postfix?

link|improve this question

68% accept rate
feedback

1 Answer

up vote 2 down vote accepted

This can be accomplished using the check_recipient_access directive (main.cf).

Add a file that lists the email addresses (followed by reject) and point the above directive to that file.

e.g. check_recipient_access hash:/etc/postfix/deny

/etc/postfix/deny:

denied_user@domain.tld reject

Remember to reload your configuration files - and perhaps restart postfix.

For more information, see: http://www.postfix.org/RESTRICTION_CLASS_README.html and http://www.postfix.org/access.5.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.