CentOS 8.x postfix log email Subject in maillog

From Notes_Wiki
Revision as of 05:43, 20 March 2020 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb self="log email Subject in maillog">CentOS 8.x postfix|postfix</yambe:breadcrumb> =CentOS 8.x postfix log email Subject in maillog= To log email subjects in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb self="log email Subject in maillog">CentOS 8.x postfix|postfix</yambe:breadcrumb>

CentOS 8.x postfix log email Subject in maillog

To log email subjects in maillog (Very useful during troubleshooting) use:

  1. Edit /etc/postfix/main.cf and uncomment below line:
    header_checks = regexp:/etc/postfix/header_checks
  2. Edit /etc/postfix/header_checks and append
    /^Subject:/ WARN
  3. Run postmap and restart postfix
    postmap /etc/postfix/header_checks
    systemctl restart postfix
  4. Look at /var/log/maillog for subject in the logs

Refer: