| 1 |
# Example for a user configuration file ~/.msmtprc |
| 2 |
|
| 3 |
# With modern mail services that publish autoconfiguration information, |
| 4 |
# you can simply run 'msmtp --configure [email protected]' to get |
| 5 |
# a basic working configuration. |
| 6 |
|
| 7 |
# This example focusses on TLS and authentication. Features not used here |
| 8 |
# include logging, timeouts, SOCKS proxies, TLS parameters, Delivery Status |
| 9 |
# Notification (DSN) settings, and more. |
| 10 |
|
| 11 |
# Set default values: use the mail submission port 587, and always use TLS. |
| 12 |
# On this port, TLS is activated via STARTTLS. |
| 13 |
defaults |
| 14 |
port 587 |
| 15 |
tls on |
| 16 |
tls_starttls on |
| 17 |
|
| 18 |
# Define a mail account at a freemail service |
| 19 |
account freemail |
| 20 |
# Host name of the SMTP server |
| 21 |
host smtp.freemail.example |
| 22 |
# Envelope-from address |
| 23 |
from [email protected] |
| 24 |
# Authentication |
| 25 |
auth on |
| 26 |
user joe.smith |
| 27 |
# Password method 1: Add the password to the system keyring, and let msmtp get |
| 28 |
# it automatically. To set the keyring password using libsecret: |
| 29 |
# $ secret-tool store --label=msmtp \ |
| 30 |
# host smtp.freemail.example \ |
| 31 |
# service smtp \ |
| 32 |
# user joe.smith |
| 33 |
# Password method 2: Store the password in an encrypted file, and tell msmtp |
| 34 |
# which command to use to decrypt it. This is usually used with GnuPG, as in |
| 35 |
# this example. Usually gpg-agent will ask once for the decryption password. |
| 36 |
passwordeval gpg2 --no-tty -q -d ~/.msmtp-password.gpg |
| 37 |
# You can also store the password directly in this file or have msmtp ask you |
| 38 |
# for it each time you send a mail, but one of the above methods is preferred. |
| 39 |
|
| 40 |
# A second mail address at the same freemail service: it uses the same settings |
| 41 |
# and just changes the envelope from address |
| 42 |
account freemail2 : freemail |
| 43 |
from [email protected] |
| 44 |
|
| 45 |
# Some other mail service |
| 46 |
account company |
| 47 |
host mail.company.example |
| 48 |
from [email protected] |
| 49 |
auth on |
| 50 |
user company12345 |
| 51 |
# this assumes the password is stored in the keyring |
| 52 |
|
| 53 |
# Set a default account |
| 54 |
account default : freemail |