Configure exim4 to send emails via smtp.gmail.com








  1. Install exim4:
    sudo apt-get install exim4-daemon-light openssl
    
  2. Configure exim4:
    sudo dpkg-reconfigure exim4-config
    
    • General type of mail configuration: Mail sent by smarthost; no local mail
    • IP address or host name of the outgoing smarthost: smtp.gmail.com:587
  3. Edit /etc/exim4/passwd.client file, add a line contains the gmail user name and password in the following format:
    smtp.gmail.com:username@gmail.com:password
    
  4. Generate exim4 certificate:
    sudo /usr/share/doc/exim4-base/examples/exim-gencert
    
  5. echo "MAIN_TLS_ENABLE = 1" >> /etc/exim4/exim4.conf.localmacros
    
  6. Reload exim4:
    /etc/init.d/exim4 reload
    



Note:

  • The commands above tested on Ubuntu Linux 11.10
  • To send a test email from command line:
    echo "this is a test mail." | mail -s "test" youremail@yourdomain.org
    
  • if mail is not installed, try
    sudo apt-get install mailutils
    

see also







No comments:

Post a Comment