6.3. Milter Configuration

When actions are not made on emails, it’s probably because milter is not correctly configured. It could happen due to installation fail or changed configuration in mail server.

6.3.1. Zimbra

Note

All commands run as zimbra user.

List all installed milters (` it is a back tick, can be located next to 1 key):

zmprov gs `hostname` zimbraMtaSmtpdMilters

If milter is correctly installed you should have result like this:

zimbraMtaSmtpdMilters:  inet:localhost:7074

If you don’t have inet:localhost:7074 entry it means that milter is not configured.

To add milter to mail server configuration invoke:

zmprov ms `hostname` zimbraMtaSmtpdMilters inet:localhost:7074

Now check if internal Postfix configuration is also set up correctly:

postconf | grep smtpd_milters

When everything is fine you should have:

non_smtpd_milters =
smtpd_milters = inet:localhost:7074

If not, you can correct it with:

postconf -e "smtpd_milters=inet:localhost:7074"

Warning

Zimbra 8.6 and later have a bug which overwrite Postfix smtpd_milters parameter with empty value and milter will not work. See below description how to workaround it and Bug 97706 can be found on official Bugzilla.

6.3.1.1. Workaround for Bug 97706

smtpd_milters parameter is overwritten each time when Zimbra MTA is be restarted. You could use one of the workaround.

  1. (Recommended!) Set zimbraMtaServerEnabled to TRUE, this will enable built-in milter (read more in official documentation about it) but will preserve custom milters entries:

    zmprov ms `hostname` zimbraMilterServerEnabled TRUE
    
  2. Remove below lines from /opt/zimbra/conf/zmconfigd.cf configuration file. After this smtpd_milters will not be overwritten:

    POSTCONF smtpd_milters
    if VAR zimbraMtaSmtpdMilters
            POSTCONF smtpd_milters VAR zimbraMtaSmtpdMilters
    fi
    

6.3.2. Postfix

Check if milter is configured using command:

postconf | grep smtpd_milters

When everything is fine, then you should get result like this:

non_smtpd_milters =
smtpd_milters = inet:localhost:7074

If you don’t have inet:localhost:7074 entry, add it using:

postconf -e smtpd_milters=inet:localhost:7074

6.3.3. Sendmail

To check if milter is configured, you should have these two lines:

INPUT_MAIL_FILTER(`MSH-Traffic-Policy', `S=inet:7074@localhost, F=R')dnl
define(`confINPUT_MAIL_FILTERS', `MSH-Traffic-Policy')dnl

in /etc/mail/sendmail.mc file. If they are not present, add them and update Sendmail configuration file and then restart it:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
/etc/init.d/sendmail restart