msmtp - light SMTP client with support for server profiles

msmtp is an SMTP client that can be used to send mails from Mutt and probably other MUAs (mail user agents). It forwards mails to an SMTP server (for example at a free mail provider), which takes care of the final delivery. Using profiles, it can be easily configured to use different SMTP servers with different configurations, which makes it ideal for mobile clients.

config example

setting file is located in ~/.msmtprc to send email via gmail account:

# Set default values for all following accounts.
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt

account gmail
from <user>
auth on
user <user>
passwordeval gpg --no-tty -q -d ~/.msmtp-gmail.gpg

# Set a default account
account default : gmail

then create a GPG encrypted password file, by command:

gpg --encrypt -o .msmtp-gmail.gpg -r <user> -

gpg-agent will be prompted out to ask for GPG passphrase when sending email.