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. |
-v, --version |
Print version and exit. |
-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. Empty lines and lines whose first non-blank character is ’#’ are ignored. All other lines must contain a command word and may contain an argument word (dependent on the command) divided by at least one blank character. All other blanks are ignored, so neither commands nor arguments may contain blanks. See below for examples. 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). Available methods are: plain (the AUTH PLAIN
method), login (the AUTH LOGIN method), and
cram_md5 (the AUTH CRAM-MD5 method). |
user <login> |
Set your user name for SMTP authentication. |
password <secret> |
Set your password for SMTP authentication. |
tls [<method>] |
This command enables TLS/SSL encrypted connections to the
SMTP server. Mail delivery will fail if the SMTP server does
not support this feature. |
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). This command is only useful in conjunction with the tls command. |
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. |
# 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 TLS
encryption. # Use an external SMTP server with insecure
authentication. # 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 were adapted from GNU Anubis, Copyright (C) 2001, 2002 The Anubis Team. |