MTA: Exim

Table of Contents

Installation     Edited: 2017-04-27 08:52:21
Configuration     Edited: 2017-04-27 09:05:33
SSL configuration     Edited: 2017-04-27 09:06:52
Enable Exim filters
SMTP authentication with Dovecot     Edited: 2017-04-27 09:10:13
SMTP authentication with Cyrus SASL
Smarthost relay
Spam check using SpamAssassin     Edited: 2017-04-27 09:25:12

Installation

by ross at 08:52:21 on April 27, 2017
  • Hostname is set to internal interface name: coffin.lan
  • Will be serving mail for @example.com
  • MX record for example.com is set to mx.example.com which is one of the names of external interface
  • Mail should be delivered to mailboxes in Maildir format

Install

# cd /usr/ports/mail/exim
# make config
Enable CONTENT_SCAN option
# make install clean
# rehash

Configure

Edit /etc/mailer.conf:

sendmail        /usr/local/sbin/exim
send-mail       /usr/local/sbin/exim
mailq           /usr/local/sbin/exim -bp
newaliases      /usr/local/sbin/exim -bi
hoststat        /usr/local/sbin/exim
purgestat       /usr/local/sbin/exim

First stop sendmail:

# service sendmail stop

Add to /etc/rc.conf:

# Disable Sendmail
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

# Enable Exim
exim_enable="YES"

Disable Sendmail-specific periodic jobs, add to /etc/periodic.conf:

daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"                                      
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"

Start exim:

# service exim start

Setup log rotation (/etc/newsyslog.conf):

/var/log/exim/mainlog   mailnull:mail   640  7     *    @T00  N
/var/log/exim/rejectlog mailnull:mail   640  7     *    @T00  N
/var/log/exim/paniclog  mailnull:mail   640  7     *    @T00  N

Restart newsyslog:

# service newsyslog restart

By default exim will refuse to run as user root. This means that root's mail will not be delivered. To avoid this setup an alias for root (/etc/mail/aliases) and run newaliases:

root: me@my.domain

 

Comments
FreeBSD 10.2 # pkg install exim
Message from exim-4.86_1:
. . .
*) Set the 'sendmail_enable' rc.conf(5) variable to 'NONE'.
-- willy11
Friday, February 5, 2016, 16:30:27
Look at /etc/rc.d/sendmail - these are equal values
-- ross
Sunday, February 7, 2016, 4:51:41
# service exim start
Exim does nor exist in /etc/rc.d
-- enkhtuvshind
Thursday, November 24, 2016, 6:22:48