msmtp − An SMTP plugin for MUAs |
msmtp is a an SMTP "plugin" for Mutt and probably other MUAs (mail user agents). It forwards mails to an SMTP server (for example at a free mail provider) which does the delivery. To use this program, create a configuration file with your mail account(s) and tell your MUA to call msmtp instead of /usr/sbin/sendmail. |
msmtp [OPTIONS] [--] rcpt1 [[rcpt2] ...] There must be at least one recipient mail address on the command line. |
Note that long options are only available on systems that support them. |
-v, --version |
Print version information and exit. The version information includes a note whether OpenSSL or GnuTLS is used, and whether GSASL or the built-in code is used for authentication. |
-h, --help |
Print help and exit. |
-f, --file=conffile |
Use the given file instead of $HOME/.msmtprc as configuration file. |
-a, --account=account_name |
Use the given account instead of the account named "default". |
-- |
This marks the end of options. All following arguments will be treated as recipient addresses, even if they start with a ’-’. |
The configuration file ($HOME/.msmtprc by default) is a
simple text file. Commands are: |
account <name> |
Start a new account definition with the given name. The first account definition in the file does not need to start with this command; it will be named "default" if it does not. |
host <smtpserver> |
The SMTP server to send the mail to. This host is supposed to send the mail to the recipients. The argument may be a host name, an IPv4 address in dot notation, or an IPv6 address in colon notation. Every account definition must contain this command. |
port <portnumber> |
The port that the SMTP server listens on. The default is 25 and should always work. |
from <envelope_from> |
Your mail address that the SMTP server knows of (the envelope-from address). Every account definition must contain this command. |
auth [<method>] |
This command enables SMTP authentication. You do not need
to specify a method, msmtp can choose one for you (see
below). |
user <login> |
Set your user name for SMTP authentication. |
password <secret> |
Set your password for SMTP authentication. |
tls |
This command enables TLS/SSL encrypted connections to the
SMTP server. Mail delivery will fail if the SMTP server does
not support this feature. |
tls_trust_file <filename> |
This command activates strict server certificate
verification. |
tls_key_file <file> |
This command (together with the tls_cert_file
command) enables msmtp to send a client certificate to the
SMTP server if requested. |
tls_cert_file <file> |
This command (together with the tls_key_file
command) enables msmtp to send a client certificate to the
SMTP server if requested. |
nostarttls |
This command tells msmtp to assume that the remote SMTP
server operates exclusively under TLS/SSL and the STARTTLS
command is not needed (for example a stunnel wrapped version
of regular unencrypted SMTP server). |
keep-bcc |
This command tells msmtp to keep the Bcc header in the mail. The default is to remove the Bcc before sending the mail to the SMTP server. Use this command only if you know exactly what you are doing. |
# Some examples. # Use the mail transport agent running on your
computer. # Use an external SMTP server # Use an external SMTP server with authentication. # Use an external SMTP server with authentication and # Use an external SMTP server with authentication # Use an external SMTP server with insecure # Use an external SMTP server. |
If you want to use msmtp with Mutt, create a
configuration file for msmtp and add the following line to
your Mutt configuration file: You might want to add Note that msmtp does not understand sendmail options, so some Mutt configuration options will not work. For example, avoid "set envelope_from" (which adds the -f option to msmtp’s commandline). The envelope from address is set in your msmtp configuration file anyway. If you have multiple mail accounts in your msmtp configuration file (called "default", "work", "extra" for example), you can easily switch between them in Mutt: Add the following lines to your Mutt configuration
file: |
msmtp is not intended to replace /usr/sbin/sendmail. It does not understand sendmail options and can’t do local deliveries. |
msmtp was written by Martin Lambers <marlam@users.sourceforge.net> The base64enc(), base64dec(), and cram_md5() functions used by the built-in authentication code were adapted from GNU Anubis, Copyright (C) 2001, 2002 The Anubis Team. |