Installing Mail Transfer Agent – Exim4

Download it by following command:

apt-get install exim4  exim4-config

After it, run the following command:

dpkg-reconfigure exim4-config

You will see the ‘Package Configuration’ interface. Here, select the options as mentioned in the following:

  • Choose -> mail sent by smarthost; received via SMTP or fetchmail
  • Type System Mail Name: e.g.
  • Type IP Adresses to listen on for incoming SMTP connections:
  • Leave Other destinations for which mail is accepted blank
  • Leave Machines to relay mail for: blank
  • Type Machine handling outgoing mail for this host (smarthost):
  • Choose NO, (don’t hide local mail name in outgoing mail).
  • Chose NO, (don’t keep number of DNS-queries minimal (Dial-on-Demand)).
  • Choose mbox
  • Choose NO, (split configuration into small files).
  • Mail for postmaster. Leaving blank will not cause any problems though it is not recommended

Open the file /etc/exim4/exim4.conf.template

Find the line .ifdef DCconfig_smarthost DCconfig_satellite and add the following in that section

       driver = manualroute
       domains = ! +local_domains
       transport = gmail_smtp
       route_list = *

If you have any other smarthost defined with “domains = ! +local_domains” remove that smarthost.

Find begin authenticators. In that section add the following

       driver = plaintext
       public_name = LOGIN
       client_send = : : YourGmailPassword

Make sure you have no other authenticators with the same public_name (LOGIN). Comment out the whole section in the bottom starting with:

driver = plaintext
public_name = LOGIN

Find the comment transport/30_exim4-config_remote_smtp_smarthost. In that section add

       driver = smtp
       port = 587
       hosts_require_auth = $host_address
       hosts_require_tls = $host_address

Run command:


Restart exim:

/etc/init.d/exim4 restart

Now,to test it follow the instructions:



Give a subject and press enter.

Type something and press enter.

Type a single . (dot) and press enter.

Press enter for a blank CC:

That’s it. 🙂


One thought on “Installing Mail Transfer Agent – Exim4

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s