Author Topic: Enable logging of Emailís Subject Line in Postfix Maillog  (Read 2262 times)

0 Members and 1 Guest are viewing this topic.

Offline
**
Enable logging of Emailís Subject Line in Postfix Maillog
« on: August 26, 2019, 09:58:15 AM »
By default Postfix MTA only capture ĎFromí and ĎToí details in the log file (/var/log/maillog). There are some scenarios where we want that emailís subject should be capture in the maillog. This will very useful for email administrators when performing troubleshooting of problems related with email. There are simple steps to enable logging of the email subject in postfix maillog.

We are assuming that postfix is already up and running and will make below changes.
Step:1 Edit Ď/etc/postfix/main.cfí file & uncomment below line:
#header_checks = regexp:/etc/postfix/header_checks

Step:2 Append the below line in Ď/etc/postfix/header_checksí [at the bottom]
/^Subject:/     WARN

Step:3 Run postmap to apply the new configuration in /etc/postfix/header_checks
[root@server1 ~]# postmap /etc/postfix/header_checks

Step:4 Restart or Reload the postfix server
[root@server1 ~]# systemctl restart postfix
[root@server1 ~]# postfix reload

Details Guide :
https://www.awsmonster.com/2019/08/how-to-enable-logging-of-emails-subject.html