How to add header subject in postfix
If you want to add subject in the postfix log files, add the following in main.cf file at the bottom.
header_checks = regexp:/etc/postfix/header_checks
smtp_header_checks = regexp:/etc/postfix/header_checks
And add the lines below in /etc/postfix/header_checks files, create the file if it’s not already there.
Now restart postfix server using command:
service postfix restart
Now the subject and the php script / file that is sending emails will be logged to maillog.
You can also add to: and from: the same way.
Add the following to the
This is very useful to find the php scripts that are used to send emails from your server or in time of spamming, to find the culprit.