Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In postfix, I'd like a way to deal with e-mail accounts that are no longer active by having postfix send the standard "Recipient address rejected" type message, but still forwarding the e-mail to another user. Thus, if someone sends an e-mail to, it will bounce the message back to the sender for future reference, but the mail will still get forwarded to to deal with. .vacation and / or .forward files let me down because they will either reply or forward, but not both. Any tips?

share|improve this question

You are violating RFC 5321. Don't to that! Rejecting mails is definitively okay in this case. Go for that.

share|improve this answer

Try MSH Traffic Policy it's a milter for Postfix and Sendmail which will help you with your problematic scenario.

And it can do a lot more...

share|improve this answer
But you shouldn't. Violating the RFCs is not a good idea. – mailq Nov 23 '12 at 17:43

Rather than issuing a bounce and forwarding, you should issue an auto-reply and forward.

As observed in the answer by @mailq , what you're proposing violates an RFC, so you shouldn't do it, and probably won't find find many options for doing so. Instead, redirect it, and handle the auto-reply however you prefer (from the new address or the old one).

share|improve this answer

After looking at header_checks(5) and pcre_checks(5), I would experiment with putting something like this in the header_checks file:

if /^To: employee.who.quit*/
REJECT "This individual no longer works at"

Now, the man paged I linked to says I can't use REJECT in header_check, but I haven't had a chance to look into why that might be true, and it may not be. (I can think of arguments both ways.) If REJECT doesn't work, I'd next experiment with FILTER to send the email to an MDA that would handle the reply to the sender.

Alternately, I might also look at .forward sending to an automated mail handler that does its own redirects and replies to sender.

share|improve this answer
Rejected mails can't be forwarded. Forwarded mails can't be rejected. So both provided solutions don't work. – mailq Nov 23 '12 at 17:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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