Table of Contents
Was this article helpful?

0  out of  1 found this helpful

Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $600 by adding new articles.

Setup Exim to Send Email Using Gmail in Debian

Last Updated: Wed, Sep 24, 2014
Debian Linux Guides
Archived content

This article is outdated and may not work correctly for current operating systems or software.

Follow this tutorial to setup your Exim to send email via Gmail SMTP server.

Install Exim4

apt-get install exim4


Run following command to configure Exim4.

dpkg-reconfigure exim4-config

Choose this option when asked: "mail sent by smarthost; no local mail".

Fill in the rest of the fields:

System mail name: YOUR_HOSTNAME

IP-addresses to listen on for incoming SMTP connections: ; ::1

Other destinations for which mail is accepted: <BLANK>

Visible domain name for local users: <BLANK>

IP address or host name of the outgoing smarthost:

Keep number of DNS-queries minimal (Dial-on-Demand)? No

Split configuration into small files? No

Root and postmaster mail recipient: <BLANK>

Open and edit /etc/exim4/exim4.conf.template.

Search for:

.ifdef DCconfig_smarthost DCconfig_satellite

Then add these lines after it:


    driver = manualroute

    domains = ! +local_domains

    transport = gmail_smtp

    route_list = *

Remove other smarthost blocks that contains domains = ! +local_domains.

Search for:

begin authenticators

And add these lines after it:


    driver = plaintext

    public_name = LOGIN

    client_send = : : YOUR_GMAIL_PASSWORD

Remove other authenticator blocks that contains public_name = LOGIN.

Search for:


And add these lines after it:


    driver = smtp

    port = 587

    hosts_require_auth = $host_address

    hosts_require_tls = $host_address

Save and close /etc/exim4/exim4.conf.template.

Apply the new configuration:


Restart Exim4 service:

/etc/init.d/exim4 restart


Now send a test email using following command:

echo 'Test Message from VULTR.' | mail -s 'Test Message' YOUR_EMAIL_ADDRESS

Check /var/log/exim4/mainlog if any errors occurred. You can now send emails from your VULTR VPS.

Want to contribute?

You could earn up to $600 by adding new articles.