February 26, 2020

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 a global financial organisation and specialises in Windows, security and automation.

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: