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):

      driver = smartuser
        new_address =

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):

    * ${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:

    * \
      "${if eq {${lookup{$1}lsearch{/etc/passwd}{1}{0}}} {1}  \
       {$0}{$}}"  frFs

This rewrites all addresses matching *

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 require SMTP auth. Configure /etc/exim/exim.conf as follows:

      driver = smtp
      authenticate_hosts =

      driver = domainlist
      transport = remote_smtp
      route_list = "* bydns_a"

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

Do not forget double quotes in the last line.