evan_tech

Previous Entry Share Next Entry
06:32 pm, 12 Feb 06

using ssmtp with gmail

I typically don't configure a mail setup on my workstations, but some programs, like darcs, like to be able to send email. Here's how to offload mail sending to gmail with ssmtp, which is a tiny mail MTA.
  1. apt-get install ssmtp
  2. In /etc/ssmtp/ssmtp.conf:
    mailhub=smtp.gmail.com:587
    UseTLS=Yes
    UseSTARTTLS=Yes
    AuthUser=gmail login
    AuthPass=gmail password
    hostname=your hostname
    FromLineOverride=YES
  3. In /etc/ssmtp/revaliases:
    localusername:realemailaddress:smtp.gmail.com:587

Test with "echo hello | mail my@email.address".

(The gotcha is apparently the port number: some sources give a different port and that just makes ssmtp block(?).)