ssmtp and gmail or google apps

Unix systems often needs a local mailer, but configuring and maintaining a mailer on each system is a timeloss.
You might have a gmail or google apps account. If it’s the case, you can easily configure a mailer on your systems which uses your gmail or google apps. To do so, I’ve used ssmtp and put this in /etc/ssmtp/ssmtp.conf:

root=postmaster
mailhub=smtp.gmail.com:587
AuthUser=your-mail@yourdomain.com
AuthPass=aStr4angeP45s
UseSTARTTLS=YES
hostname=the-hostname

That’s it, simple, effective, working …
To improve the things, maybe, we can use an IP address of the smtp server, so that if our DNS server doesn’t work, we still have mail on the system, but this has a drawback, if the server for which you gave an ip address changes or temporarly doesn’t work, you don’t have mail anymore.
ssmtp doesn’t seem to be able to have several mailhubs !

Advertisements

4 Comments »

  1. This worked for my Ubuntu setup on Slicehost. If you need help, respond to this thread, and I will be notified of follow-up comments.

  2. berto said

    hi, I was trying to get this to work with my Fedora setup on Slicehost, but it didn’t work. I have 3 sites set up with virtual hosts (apache2). I edited my php.ini file and changed the appropriate line to this: sendmail_path = /usr/sbin/ssmtp -t

    I would like people to be able to email to any address and php would just use ssmtp to send it out. I use a regular gmail account in the ssmtp config. It just doesn’t work.

  3. […] https://smaftoul.wordpress.com/2008/10/22/ssmtp-and-gmail-or-google-apps/ […]

RSS feed for comments on this post · TrackBack URI

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: