This m anual was last updated March 10, 2008 for version 1.4.14 of msmtp.
Copyright (C) 2005, 2006, 2007, 2008 Martin Lambers
Permission is granted to copy, distribute and/or modify this document under the
terms of the GNU Free Documentation License, Version 1.2 or any later version
published by the Free Software Foundation; with no Invariant Sections, no
Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included
in the section entitled “GNU Free Documentation License”.
i
Table of Contents
1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Configuration files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1 General com mands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Authentication commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 TLS com mands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Commands specific to sendmail mode. . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1 Synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.1 General options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.2 Changing the mode of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.3 Configuration options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.4 Options specific to sendmail mode . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Choosing an account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 Exit code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.6 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Transport Layer Security . . . . . . . . . . . . . . . . . . . . . 11
5 Authenticatio n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1 Using the Mac OS X Keychain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6 Delivery Status Notificati ons . . . . . . . . . . . . . . . . . 15
7 Sendmail mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.1 Envelope-from address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.2 Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.3 Bcc header. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8 Server informat io n mode . . . . . . . . . . . . . . . . . . . . . 18
9 Remote Message Queue Starting mode . . . . . . 19
10 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
10.1 A s ystem wide configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
10.2 A use r configuration file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
10.3 Using ms mtp with Mutt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
10.4 Using ms mtp with mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
ii
11 Developm ent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Appendix A Copying Informat io n . . . . . . . . . . . . . 24
GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
GNU GPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Chapter 1: Introduction 1
1 Introduction
msmtp is an SMTP client.
In its default mode of operation, it reads a mail from standard input and sends it to a
predefined SMTP server that takes care of prop er delivery. Command line options and exit
codes are compatible to sendmail.
Supported SMTP features include:
• Authentication methods PLAIN, LOGIN, CRAM-MD5 and EXTERNAL (and GSS-
API, DIGEST-MD5 and NTLM when compiled with GNU SASL support)
• TLS encrypted connections with the OpenSSL or GnuTLS libraries (including server
certificate verification and the possibility to send a client certificate)
• Support for Internationalized Domain Names (IDN)
• DSN (Delivery Status Notification) support
• PIPELINING support for increased transmission speed
• RMQS (Remote Message Queue Starting) support (ETRN keyword)
The best way to start is probably to have a look at the Examples section. See Chapter 10
[Examples], page 20.
In addition to sendmail mode, there are two other modes of operation:
• Server information mode. In this mode, msmtp prints as much information as it can
get about a given SMTP server (supported features, maximum mail size, . . .).
• Remote Message Queue Starting mode. In this mode, msmtp sends a Remote Message
Queue Starting request for a host, domain, or queue to a given SMTP server.
Normally, a system wide configuration file and/or a user configuration file contain infor-
mation about which SMTP server to use and how to use it, but almost all settings can also
be configured on the command line.
The information about SMTP servers is organized in accounts. Each account describes
one SMTP server: host name, authentication settings, TLS settings, and so on. Each
configuration file can define multiple accounts.