I have a Postfix box setup that receives a copy of all emails sent and received on our domain. A postfix filter is setup which then passes all the emails to a script and stores the email in a database.

How should I setup Postfix so that no outbound messages are sent? There are some rare cases where a bounce back get generated from the Postfix box confusing the users even though their message was actually delivered.

Ideally it would be nice to have all outbound emails generated on the Postfix box sent to one specific email address.

  • It sounds like your issue is actually with Postfix generating bounces when it's behaving correctly, and my take is that you should fix this issue rather than obscuring it behind some other mailer policy. – jgoldschrafe Oct 24 '11 at 18:57
  • @jgoldschrafe: that is correct. I would rather know about the issue myself though instead of the users. Ideally having all the messages sent to an email address I could monitor would be good. I think I can accomplish that with transport maps. – mrbnetworks Oct 24 '11 at 19:04

This is just an example and should guide you in the right direction. I haven't actually tried it before posting.

In master.cf comment out the line containing bounce in the first column. Then create new lines with something like

bounce   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/local/bin/deliver -f ${sender} -d ${recipient}

This will pipe all bounced mails to the script /var/local/bin/deliver with some parameters. The script is executed as user "vmail" and group "vmail" (change accordingly). This script then needs to dump stdin to a (random) file and location. Probably you can use already existent scripts like procmail.

It will not disallow outgoing mails but "catch" the bounces you are after.

| improve this answer | |

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.