msmtp is a very simple and easy to use smtp client.
msmtp is in the Template:Codeline repository.
# pacman -S msmtp
# A first gmail address account gmail host smtp.gmail.com port 587 protocol smtp auth on from firstname.lastname@example.org user email@example.com password mypassword tls on tls_starttls on tls_trust_file /usr/share/ca-certificates/mozilla/Thawte_Premium_Server_CA.crt # A second gmail address account gmail2 : gmail from firstname.lastname@example.org user email@example.com password mypassword2 # A freemail service account freemail host smtp.freemail.example from firstname.lastname@example.org auth on user joe.smith password secret # A provider's service account provider host smtp.provider.example # Set a default account account default : gmail
Note: it looks like Google's in the process of becoming it's own certificate authority. For some users, they seem to have switched to a "Google Certificate Authority" certificate, which is rooted in Equifax. As such, the certificate line may have to be,
Note: if you are completely deseperate, but are 100% sure you are communicating with the right server, you can always disable the certification check :
The config file needs to be read/write only to the user:
$ chmod 600 ~/.msmtprc
If you don't like to write your password into the file you may omit the "password" parameter entirely. In that case msmtp asks you for your password when sending mail. However this only works if you're using msmtp from an interactive shell like bash. If you're using mutt this (sadly) doesn't work.
Issues with TLS
If you see the following message :
msmtp: TLS certificate verification failed: the certificate hasn't got a known issuer
it probably means your tls_trust_file is not right.
Just follow the fine manual. It explains you how to find out the server certificate issuer of a given smtp server. Then you can explore the Template:Filename directory to find out if by any chance, the certificate you need is there. If not, you will have to get the certificate on your own.
Using msmtp offline
Although msmtp is great, it requires that you be online to use it. This isn't ideal for people on laptops with intermittent connections to the Internet or dialup users. Several scripts have been written to remedy this fact, collectively called msmtpqueue.
The scripts can be downloaded from SourceForge, the most recent of which is msmtpqueue-0.5.tar.gz.
Once the scripts have been downloaded extract them using:
$ tar xvzf msmtpqueue-0.5.tar.gz
After that, copy the scripts to a convenient location on your computer (Template:Filename is a good choice):
$ cp msmtpqueue-0.5/*.sh /usr/local/bin/
Finally, change your MUA to use msmtp-enqueue.sh instead of msmtp when sending e-mail. Queued messages will be stored in Template:Filename.
When you want to send any mail that you've created and queued up run:
Adding Template:Filename to your PATH can save you some keystrokes if you're doing it manually. The README file that comes with the scripts has some handy information, reading it is recommended.