I recently set up Mutt with several non-Gmail accounts. When my non-Gmail SMTP server became a shade unreliable, I decided to use my Gmail SMTP server instead. (That's right, my Gmail server with non-Gmail email addresses.) Thus began several hours worth of forum-combing, Google-combing, documentation-combing, code-combing, and solution-by-trial-and-error. After much toil, I emerged triumphant, and I thought I'd use my newfound knowledge to spare similar hapless souls.
Gmail miscellany
- Read Gmail's POP3 instructions for "other" mail clients.
- Gmail's default behavior is to overwrite any unrecognized header information with its own. So if you're composing an email as <thetove@jabberwocky.com> in Mutt/Thunderbird/what-have-you and you send it via your <slithy.tove@gmail.com> account, it will arrive as an email from <slithy.tove@gmail.com>, with the <thetove@jabberwocky.com> nowhere in sight. Hardly ideal. You need to add "Custom From Addresses" in your Gmail account settings to preserve header info from non-Gmail addresses. Go to the "Accounts" section of "Settings." Add every account with which you plan to use the Gmail SMTP server, and don't forget to specify the reply-to.
Here's the part that sent me spinning across the internet. Gmail and sSMTP don't play nice without a little coaxing, and clear documentation is sparse.
- Basic configuration documention/information is located in the default /etc/ssmtp/ssmtp.conf, so read it. Really. This is just a tip, not a HowTo. Jeez. Also read the contents of /usr/share/doc/ssmtp*/.
- sSMTP needs port 587. It won't work (or rather, it doesn't for me) with 465, even if Google says it should. Hence:
Code: Select all
mailhub=smtp.gmail.com:587 - It's just STARTTLS. Not STARTTLS and SSL, nor STARTTLS and TLS. Just STARTTLS:
Code: Select all
UseSTARTTLS=YES - Login info can be put on the command line; I prefer to stuff it in here:Authentication method (AuthMethod) defaults to LOGIN, which is what we want.
Code: Select all
AuthUser=slithy.tove@gmail.com AuthPass=twasbrillig - sSMTP needs to be told to pay attention to header info, too:
Code: Select all
FromLineOverride=YES
That's it, you're golden. Happy...uh, non-Gmail Gmailing.
If this tip has been useful to you, let me know, yo. If it's completely unintelligible and worthless, let me know that too. I haven't written documentation in a long time, and I may well be out of practice.





