I have a Postfix 2.10.1 running on CentOS 7. This service will deliver email notifications that are sent to the postfix via SMTP.

Now, some users should not get those notifications. Since the sending application is unable to supress notifications for some email addresses/users, I want postfix to accept those emails and NOT deliver them. (The address is in the To header as well as the RCPT TO envelope attribute)

Is there a way so I can tell postfix to silently drop any mail for one or more email addresses?

The related question How to discard mails sent from a specific local user to external addresses? asks for a filter based on the sender. I want to filter based on recipient.

  • Why not add them to the transport table using the DISCARD service - ie add a line like "user@domain.name. discard:" to the transports file and rebuild the transports.db using postmap. (I'm not near a PC at the moment,so can't offer step-by-step but that's the general idea.) – davidgo Nov 28 '18 at 18:51

To discard email for a user or domain, add an appropriate line to the "transport" table - typically by adding a line like below to /etc/postfix/transport

user@domain.name   discard:
domain.name        discard:

It should already exist, but ensure there is a transport_maps parameter in your postfix main.cf file, something like

transport_maps = hash:/etc/postfix/transport

Typically you will need to run postmap transport to convert this file into a ".db" file and do a postfix reload.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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