vendredi 7 octobre 2016

Home network SMTP MUA setup

MUA - mail user agent - setup for home

As an alternative to my (non-working) attempts from 2008, I now use an MTA setup and talk directly to the SMTP server outside my home network in order to send emails.  This includes posting to Flickr, using their email upload facility.  Here's the setup about SMTP only, the Flickr stuff would be for a followup article.  This setup is based on mutt formatting the outgoing emails then talking to msmtp in order to actually send them.

Mail User Agent

Don't sweat it.  Install mutt.  It's perfect for scripting, attaching files, specifying addresses and so on.

sudo apt update
sudo apt upgrade
sudo apt install mutt

Configure mutt to use msmtp

Edit ~/.muttrc:
set sendmail="/usr/bin/msmtp"
set from=your@email.com
set realname = "Luc Moreau"
set use_from = "yes"
set envelope_from = "yes"

SMTP Gateway

Install msmtp

sudo apt install msmtp

Configure msmtp

Edit ~/.msmtprc, for example sending to gmail:
 # Google account
account    gmail
host    smtp.gmail.com
port    587
from    someaddress@gmail.com
user    someuser
password somepassword
The address above should be an email address.  The user/password are whatever google requires to login to that account interactively.  "someuser" might be the same as "someaddress".