There are some users asking about the email whether their email has been sent or not. For tracking email, i am usually using zmmsgtrace command that has been provided by Zimbra for tracking purpose. The command zmmsgtrace has been given enough information for tracking, but some users wanna more specific such as subject or attachment who has been sent.
For adding subject and attachment information on the log, i am adding header check for every email sending/receive. The following is what i do at my Zimbra 8.5/8.6
# Create file custom_header_check as user Zimbra
su - zimbra vi /opt/zimbra/conf/custom_header_checks
Fill with the following line :
/^Subject:/ WARN /^subject:/ WARN /filename=\"?(.*)\"?$/ WARN
# Modify zimbraMtaHeaderChecks for include custom_header_checks
zmprov ms `zmhostname` zimbraMtaHeaderChecks "pcre:/opt/zimbra/conf/postfix_header_checks, pcre:/opt/zimbra/conf/custom_header_checks" zmprov mcf zimbraMtaBlockedExtensionWarnRecipient FALSE
# Reload Postfix Zimbra
postfix reload
The following is example subject and attachment information in the log Zimbra.
Jan 9 15:16:36 mail postfix/cleanup[12069]: 5664C63400E: warning: header Subject: Attachment Training from mail.example.com[10.10.10.2]; from=<ahmad@example.com> to=<example@gmail.com> proto=ESMTP helo=<mail.example.com>: Subject : Jan 9 15:16:36 mail postfix/cleanup[12069]: 5664C63400E: warning: header Content-Disposition: attachment; filename="Training Mikrotik.pdf" from mail.example.com[10.10.10.2]; from=<ahmad@example.com> to=<example@gmail.com> proto=ESMTP helo=<mail.example.com>: Document Attachment
Good luck and hopefully useful 😀
Source :
http://www.postfix.org/header_checks.5.html
http://forums.zextras.com/zimbra-howto/850-zimbra-log-subject-line.html
Hi,
Thanks for sharing it ! It is definitely a great article !
Hi Fabio,
Thanks for visit 😀
Hi,
I have insert “pcre:/opt/zimbra/conf/custom_header_checks” in line header_checks(main.cf). But it not save when “postfix reload”.
zimbra 8.6.
Hi PSI,
You should insert with command zmprov as mention in this guidance. If you insert manually to main.cf, the configuration will loss
This is great feature. But how can I exclude some IPs from this subject-checking?
Hi Alexander,
i don’t know to do that. Sorry
according to your config I got subject log but not getting attachment log.
Release 8.5.0_GA_3042.RHEL7_64_20140828204420
Hi Monjur Alam,
You should see on the log like below for attachment content
Hello Iman,
I followed the mentioned configuration but I didn’t get any log with subject and attachment in Zimbra 8.7.7.
Can you please help me out in this situation?
Hi. It’s not working for 8.8.15. Is there anything that needs to be done differently?
TIA
Hello,
I use ZCS 8.8.15 too and it works. Please paste the result from the following command as Zimbra user