LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   exim4 sends with smtp.gmail.com (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/exim4-sends-with-smtp-gmail-com-583775/)

otoomet 09-10-2007 11:22 PM

exim4 sends with smtp.gmail.com
 
I was struggling for a while trying to send my mails using smtp.gmail.com. I have a few debian boxes where the mail agent is exim4. It turned out to be quite simple:

run 'dpkg-reconfigure exim4-config'
  1. dpkg-reconfigure exim4-config
  2. select the computer type 'sending with smarthost'
  3. select the smarthost to be 'smtp.gmail.com::587'
  4. Select the other options in a meaningful way
  5. Now edit the file /etc/exim4/passwd.client and add the lines:
    Code:

    smtp.gmail.com:yourName:yourPassword
    gmail-smtp.l.google.com:yourName:yourPassword
    gmail-smtp-msa.l.google.com:yourName:yourPassword

    You do not have to specify '@gmail.com' part for the name. Do not leave spaces around the name and password.
  6. edit the file /etc/exim4/email-addresses (debian etch) or /etc/email-addresse (debian lenny) and add the line:
    Code:

    yourUserNameAtThisComputer: your@email.address
    This writes a meaningful sender address instead of user@localhost.
  7. /etc/init.d/exim4 restart
The relevent SMTP server name may change. Send a test letter and consult /var/log/exim4/mainlog

That's it! Enjoy!

Note: the mails will be sent with your gmail address as sender. However, reply-to address is what you write to the file email-addresses.


All times are GMT -5. The time now is 06:22 AM.