Jump to content

Zimbra Enabling Subject Line In logs

From TetraWiki


Adding Subject Information on the log

If we want to see subject information in zimbra.logs then we can follow below steps:

Logged in with zimbra user:

[root@mail ~]# su - zimbra

Run below commands to check current staus you will get below output:

[zimbra@mail ~]$ zmlocalconfig | grep header_checks
 postfix_header_checks = pcre:${zimbra_home}/conf/postfix_header_checks

[zimbra@mail ~]$ postconf | grep header_checks
header_checks = 
lmtp_header_checks = 
lmtp_mime_header_checks = 
lmtp_nested_header_checks = 
mime_header_checks = $header_checks
nested_header_checks = $header_checks
smtp_header_checks = 
smtp_mime_header_checks = 
smtp_nested_header_checks = 

Now create a file:

[zimbra@mail ~]$ vim /opt/zimbra/conf/custom_header_checks

Add below line in this file:

/^subject:/ WARN
Note: We can add our own header_checks in this file.

Then run below commands:

[zimbra@mail ~]$ zmlocalconfig -e postfix_header_checks="pcre:/opt/zimbra/conf/postfix_header_checks, pcre:/opt/zimbra/conf/custom_header_checks"
[zimbra@mail ~]$ zmmtactl restart
Rewriting configuration files...done.
Stopping zmmtaconfig...done.
Starting zmmtaconfig...done.
postfix/postfix-script: refreshing the Postfix mail system
Stopping saslauthd...done.
Starting saslauthd...done.

Now run again below commands to check configuration:

[zimbra@mail ~]$ zmlocalconfig | grep postfix_header_checks
postfix_header_checks = pcre:/opt/zimbra/conf/postfix_header_checks, pcre:/opt/zimbra/conf/custom_header_checks
[zimbra@mail ~]$ postconf | grep header_checks
header_checks = pcre:/opt/zimbra/conf/postfix_header_checks, pcre:/opt/zimbra/conf/custom_header_checks
lmtp_header_checks = 
lmtp_mime_header_checks = 
lmtp_nested_header_checks = 
mime_header_checks = $header_checks
nested_header_checks = $header_checks
smtp_header_checks = 
smtp_mime_header_checks = 
smtp_nested_header_checks = 

Run below command and restart the mta service:

[zimbra@mail ~]$ zmprov mcf zimbraMtaBlockedExtensionWarnRecipient FALSE
[zimbra@mail ~]$ zmmtactl restart
Rewriting configuration files...done.
Stopping zmmtaconfig...done.
Starting zmmtaconfig...done.
postfix/postfix-script: refreshing the Postfix mail system
Stopping saslauthd...done.
Starting saslauthd...done.

Ref_Link : [1]