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 email@example.com, it will bounce the message back to the sender for future reference, but the mail will still get forwarded to firstname.lastname@example.org to deal with. .vacation and / or .forward files let me down because they will either reply or forward, but not both. Any tips?
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).
if /^To: employee.who.quit*/ REDIRECT email@example.com REJECT "This individual no longer works at example.com." endif
Now, the man paged I linked to says I can't use
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.