How to route the mail through GMail SMTP servers in Ubuntu or Debian?

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,828
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 7, 2011

How to route the mail through GMail SMTP servers?

With the help of exim (the default MTA in debain/ubuntu), it is possible to route all mail through GMail SMTP servers. It can also be implemented in your localhost server which you use for developing or learning process.I tested it in Debian Lenny and Ubuntu 10.10 which worked without any problems . Follow the steps below to route the mail.

Step 1 : Install Exim4

sudo apt-get install exim4

Step 2 : Configure Exim

sudo dpkg-reconfigure exim4-config

Press Ok


Note: GMail allows only 100 smtp connections per day.
Step 1

Run dpkg-reconfigure exim4-config * Choose mail sent by smarthost; received via SMTP or fetchmail * Type System Mail Name: e.g. ubuntu.com / i kept debian in debian and ubuntu in ubuntu * Type IP Adresses to listen on for incoming SMTP connections: 127.0.0.1 * 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): smtp.gmail.com::587 * 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

Step 2 * Open the file /etc/exim4/exim4.conf.template * Find the line .ifdef DCconfig_smarthost DCconfig_satellite and add the following in that section send_via_gmail: driver = manualroute domains = ! +local_domains transport = gmail_smtp route_list = * smtp.gmail.com If you have any other smarthost defined with "domains = ! +local_domains" remove that smarthost. * Find the "begin authenticators". In that section add the following gmail_login: driver = plaintext public_name = LOGIN client_send = : yourname@gmail.com : YourGmailPassword Make sure you have no other authenticators with the same public_name (LOGIN). Comment them out if needed * Find the comment "transport/30_exim4-config_remote_smtp_smarthost". In that section add gmail_smtp: driver = smtp port = 587 hosts_require_auth = $host_address hosts_require_tls = $host_address

Step 3 * Run update-exim4.conf * Do /etc/init.d/exim4 restart


You will get the following error message :
ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken

Remove the file using Rm command

rm /var/log/exim4/paniclog


This was on an Ubuntu server as well as Debian. I tested in both the environment and it worked perfectly.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (1)

Sign In or Sign Up now to post a comment!
  • Could use some commentary or annotations but other than that I'm glad someone has published this as I need something like this myself.  I have no idea how to host an smtp server myself otherwise I would.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more