Debianhelp.co.uk


Exim or Exim4 Mail Server Configuration

By Default Debian Sarge will install the exim4 MTA in your debian machine.

In order to use exim4 or exim as your MTA, configure the following:

    /etc/exim/exim.conf      "eximconfig" to create and edit (exim)
    /etc/exim4/*               "dpkg-reconfigure exim4" to create and edit (exim4)
    /etc/inetd.conf            comment out smtp to run exim as daemon
    /etc/email-addresses    Add spoofed source address lists

check filters using exim4 or exim with -brw, -bf, -bF, -bV, ... etc.

Setting up a catchall for nonexistent email addresses under Exim

In /etc/exim/exim.conf (Woody or later), in the DIRECTORS part, at the end (after the localuser: director) add a catch-all director that matches all addresses that the previous directors couldn't resolve (per Miquel van Smoorenburg):

    catchall:
      driver = smartuser
        new_address = webmaster@mydomain.com

If one wants to have more a detailed recipe for each virtual domain, etc., add the following at the end of /etc/exim/exim.conf (per me, not well tested):

    *@yourdomain.com ${lookup{$1}lsearch*{/etc/email-addresses} \
            {$value}fail} T

Then have an "*" entry in /etc/email-addresses.

Configuring selective address rewriting for outgoing mail under Exim

Selective address rewrite for outgoing mail to produce proper "From:" headers can be done using exim by configuring near the end of /etc/exim/exim.conf:

    *@host1.something.dyndns.org \
      "${if eq {${lookup{$1}lsearch{/etc/passwd}{1}{0}}} {1}  \
       {$0}{$1@somethig.dyndns.org}}"  frFs

This rewrites all addresses matching *@host1.something.dyndns.org.

It searches through /etc/password to see if the local part ($1) is a local user or not.
If it is a local user, it rewrites the address to the same thing it was in the first place ($0).
If it is not a local user, it rewrites the domain part.

Configuring SMTP authentication under Exim

Some SMTP services such as yahoo.com require SMTP auth. Configure /etc/exim/exim.conf as follows:

    remote_smtp:
      driver = smtp
      authenticate_hosts = smtp.mail.yahoo.com
    ...

    smarthost:
      driver = domainlist
      transport = remote_smtp
      route_list = "* smtp.mail.yahoo.com bydns_a"
    ...

    plain:
      driver = plaintext
      public_name = PLAIN
      client_send = "^cmatheson3^this_is_my_password"

Do not forget double quotes in the last line.