Fighting spam is always a tough job. Why not log some specific headers to maillog to make sysadmin’s job easier.
On sendmail servers it would be nice to see Subject line appearing in maillog. To get hold of the domain / user sending out emails with some specific subject line. By default you won’t see it happening. Here is how you can do it:
In /etc/mail folder open sendmail.mc in your favorite editor and add the following lines at the bottom (just to ensure that you can differentiate them easily)
R$*< Give a TAB HERE >$: $(log Subject: $1 $) $1
Ensure that you remove < Give a TAB HERE > from the last line and press TAB key before saving the file.
Once this is done, generate sendmail.cf as follows:
m4 sendmail.mc > sendmail.cf
Restart sendmail and that’s it. You will now be able to see Subject line appearing in /var/log/maillog