Add option to enable subject line logging
linucksrox opened this issue · 3 comments
I just wanted to add an option to enable logging the subject line to help with debugging. I will be following up with a PR.
My idea was to add an ENV variable called LOG_SUBJECT that you set to "yes" to enable subject line logging.
Hi @linucksrox, could you give a more specific example ? I have not used this postfix feature in the past so I do not know how it works.
@juanluisbaptiste Sure, it simply adds additional logging to the maillog which includes the subject line of messages. See here: https://www.nixuser.com/how-to-add-header-subject-in-postfix/
Specifically, the additional output looks like this in the log:
Nov 23 14:23:57 smtp postfix/cleanup[174]: D113A4827AF: warning: header Subject: gitlab.example.com sign-in from new location from unknown[10.0.0.2]; from=<gitlab@gitlab.example.com> to=<ericdalyblog@dalydays.com> proto=ESMTP helo=<smtp.dalydays.com>
This allows me to scan the logs by subject in addition to To and From.
PR #69 merged, closing this.