Terry Carmen wrote:
Hi,

How can I set a rule to put manually on HOLD all email sent to
temporarydeaddomain.com ? I understand that postfix will automatically
sent the emails in the deferred and deal with them from time to time but
as I know that the domain is dead for a while, I'd like to move them
directly on hold and resubmit them in the maildrop when I know that the
domain will work again ...

Thanks for your help.

Stéphane


This should work:

In main.cf:
header_checks = regexp:/etc/postfix/header_checks


In /etc/postfix/header_checks:
/^To:....@temporarydeaddomain.com/ HOLD


Terry

No, that will miss mail with the domain in CC:, or a BCC: mail where the recipient isn't in the headers.

A little better would be to use a check_recipient_access map
example.com  HOLD

But that has the problem that HOLD affects all recipients of a message. A message that happens to have recipients in some other domain would get put on hold too. Depending on your mail mix you might be able to live with this.

If the outage is expected to be less than your max queue lifetime, just "do nothing" and let postfix defer them, or if you want you can add a transport_maps entry pointing to the retry: transport.
# transport
example.com  retry:down for maintenance


The "real" solution is somewhat more complicated. Set up a separate postfix instance with a very long maximal_queue_lifetime, and use transport_maps to send all their mail there.

  -- Noel Jones

Reply via email to