Home // Postfix Guides // Master.cf

Master.cf

SYSTEM CONFIGURATION (master.cf)
The master.cf file will contain a listing of the processes that will be running for Postfix. In addition to the standard postfix processes, you may want to have the following types of additional entries:

RE-INJECTION LISTENER
Once you’ve passed a message from your primary instance of Postfix to a filter or scanner, and need to get it back into the mail queue, you won’t need to run all of the restrictions and checks that you did the first time that the message was received. You can thus create an instance of Postfix that will listen ONLY on the localhost address, and will not run any of the checks that were run before.

127.0.0.1:10025 inet n – y – 100 smtpd

-o content_filter=
-o smtpd_proxy_filter=
-o myhostname=injector.domain.extention
-o mynetworks=127.0.0.0/8
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o header_checks=
-o body_checks=
-o receive_override_options=no
-o smtpd_authorized_xforward_hosts=127.0.0.0/8

SHELL SCRIPT FILTER
If you want to pass all messages to a shell script, you will want to set your content_filter=shellfilter, and then add the following to master.cf (all on one line):

shellfilter unix – n n – – pipe user=filter argv=/usr/local/bin/filter.sh ${sender} ${recipient}

Note: It will be up to the shell script to re-inject the message into a Postfix queue. You will probably want to use a re-injection listener like the one described above.

Leave a Reply

Your email address will not be published. Required fields are marked *