4

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?

  • Actually a very good idea, having enormous problems here with CMS sites. I am modding up your post. – Rui F Ribeiro Nov 19 '15 at 17:51
2

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

1

In Postfix documents.
Extract from "Restricting what users can send mail to off-site destinations":

How can I configure Postfix in a way that some users can send mail to the internet and other users not. The users with no access should receive a generic bounce message. Please don't discuss whether such access restrictions are necessary, it was not my decision.

/etc/postfix/main.cf:
    smtpd_recipient_restrictions =
        ...
        check_sender_access hash:/etc/postfix/restricted_senders
        ...other stuff...

    smtpd_restriction_classes = local_only
    local_only = 
        check_recipient_access hash:/etc/postfix/local_domains, reject

/etc/postfix/restricted_senders:     <-----<<<
    foo@domain      local_only
    bar@domain      local_only

/etc/postfix/local_domains:
    this.domain     OK      matches this.domain and subdomains
    that.domain     OK      matches that.domain and subdomains
  • I looked at this, but I don't want the sender to have a bounce message or any indication that their mail is being treated differently. I don't think this meets my needs or answers the question. – John Sanders Nov 19 '15 at 19:46
  • @JohnSanders Perhaps you should mention that restrictions in your question. Note that you should tell the users that their mails have been not sent, what if someone think he has sent a very important email that postfix silently denied? You would be personally responsible of the consequences. – Emmanuel Nov 20 '15 at 10:19

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.