Configure sendmail to start logging Subject in maillog
Hi Friends,
In this article we will learn how to configure sendmail so that you can log "Subject" in /var/log/maillog as by default sendmail does not log Subject to maillog file.
This is really interesting. Business people many times are interested in getting mail log files analyzed. To analyse mail logs they need various field to appera in mail logs. e.g. "From", "To", "Subject" etc from the sent email. By default sendmail logs From and To fields but it does not log Subject field. In this article you will learn how to enable sendmail to log "Subject".
-
LOCAL_CONFIG
Klog syslog
HSubject: $>+CheckSubject
LOCAL_RULESETS
SCheckSubject
R$* Press TAB Key $: $(log Subject: $1 $) $1
This last line is very crusial. after R$* press tab key as suggested. Then after $: press space key.
After log there is a space key, after Subject: there is a space key after $1 there is a space key. After closing bracket there is a space key before $1.
- Now you need to regenerate sendmail.cf file. use m4> macro to do so.
#m4 sendmail.mc > sendmail.cf