How to hold mail for only certain users with postfix

emailpostfix

I would like to hold all outgoing email for certain users (all users except a few) for a set period of time, or until I approve (even if that means changing a config and restarting the service). Users should have no indication their mail was not delivered.

All the guides I am seeing show how to do this for outgoing domains, and I have found nothing for users.

Is what I want to do possible, and if so, how would I accomplish it?

Best Answer

You can use the action HOLD returned by access control.

For example:

/etc/postfix/main.cf:
smtpd_recipient_restrictions =
    check_sender_access hash:/etc/postfix/sender_access

/etc/postfix/sender_access:
sender1@mydomain.com     HOLD
sender2@mydomain.com     HOLD

Then you can manage the release of the hold using the postsuper command.

See the following for additional details:

http://www.postfix.org/access.5.html Pay close attention to description of HOLD action.

http://www.postfix.org/postsuper.1.html

Related Question