May 24, 2018

Add the email subject to your Postfix logs

(Last Updated On: 16th September 2016)

To record the email subject in the Postfix logs, simply add the following line to your Postfix header checks file:

/^subject:/ INFO

With this done, restart the Postfix service.  On Centos that is with the following command:

service postfix restart

That’s it!

Or is it?  If you haven’t enabled header checks yet you need to do so in your mani.cf file under the postfix configuration directory (usually /etc/postfix).  To do it, add this line to the bottom of that file:

header_checks = regexp:/etc/postfix/Header_checks

Now you can create that file (/etc/postfix/Header_checks) and add the line in for recording the subject.

When you are done, restart the postfix service.

Previous «
Next »

Simon is a sysadmin for Local Government in North Yorkshire with a real passion for security and coding.

1 Comment

  1. Pingback: BASH :: A quick script to help you search Postfix logs – Synack

Leave a Reply

Subscribe to SYNACK via Email

%d bloggers like this: