blob: 907b82718c629831cca2c348fc154116727762b1 [file] [log] [blame]
'\" t
.\" Title: git-send-email
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
.\" Date: 2025-07-16
.\" Manual: Git Manual
.\" Source: Git 2.50.1.319.g90c0775e97
.\" Language: English
.\"
.TH "GIT\-SEND\-EMAIL" "1" "2025-07-16" "Git 2\&.50\&.1\&.319\&.g90c077" "Git Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-send-email \- Send a collection of patches as emails
.SH "SYNOPSIS"
.sp
.nf
\fIgit send\-email\fR [<options>] (<file>|<directory>)\&...\:
\fIgit send\-email\fR [<options>] <format\-patch\-options>
\fIgit send\-email\fR \-\-dump\-aliases
\fIgit send\-email\fR \-\-translate\-aliases
.fi
.SH "DESCRIPTION"
.sp
Takes the patches given on the command line and emails them out\&. Patches can be specified as files, directories (which will send all files in the directory), or directly as a revision list\&. In the last case, any format accepted by \fBgit-format-patch\fR(1) can be passed to \fBgit\fR \fBsend\-email\fR, as well as options understood by \fBgit-format-patch\fR(1)\&.
.sp
The header of the email is configurable via command\-line options\&. If not specified on the command line, the user will be prompted with a ReadLine enabled interface to provide the necessary information\&.
.sp
There are two formats accepted for patch files:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
mbox format files
.sp
This is what
\fBgit-format-patch\fR(1)
generates\&. Most headers and MIME formatting are ignored\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
The original format used by Greg Kroah\-Hartman\(cqs
\fBsend_lots_of_email\&.pl\fR
script
.sp
This format expects the first line of the file to contain the
\fBCc:\fR
value and the
\fBSubject:\fR
of the message as the second line\&.
.RE
.SH "OPTIONS"
.SS "Composing"
.PP
\-\-annotate
.RS 4
Review and edit each patch you\(cqre about to send\&. Default is the value of
\fBsendemail\&.annotate\fR\&. See the CONFIGURATION section for
\fBsendemail\&.multiEdit\fR\&.
.RE
.PP
\-\-bcc=<address>,\&...\:
.RS 4
Specify a
\fBBcc:\fR
value for each email\&. Default is the value of
\fBsendemail\&.bcc\fR\&.
.sp
This option may be specified multiple times\&.
.RE
.PP
\-\-cc=<address>,\&...\:
.RS 4
Specify a starting
\fBCc:\fR
value for each email\&. Default is the value of
\fBsendemail\&.cc\fR\&.
.sp
This option may be specified multiple times\&.
.RE
.PP
\-\-compose
.RS 4
Invoke a text editor (see GIT_EDITOR in
\fBgit-var\fR(1)) to edit an introductory message for the patch series\&.
.sp
When
\fB\-\-compose\fR
is used,
\fBgit\fR
\fBsend\-email\fR
will use the
\fBFrom\fR,
\fBTo\fR,
\fBCc\fR,
\fBBcc\fR,
\fBSubject\fR,
\fBReply\-To\fR, and
\fBIn\-Reply\-To\fR
headers specified in the message\&. If the body of the message (what you type after the headers and a blank line) only contains blank (or
\fBGit:\fR
prefixed) lines, the summary won\(cqt be sent, but the headers mentioned above will be used unless they are removed\&.
.sp
Missing
\fBFrom\fR
or
\fBIn\-Reply\-To\fR
headers will be prompted for\&.
.sp
See the CONFIGURATION section for
\fBsendemail\&.multiEdit\fR\&.
.RE
.PP
\-\-from=<address>
.RS 4
Specify the sender of the emails\&. If not specified on the command line, the value of the
\fBsendemail\&.from\fR
configuration option is used\&. If neither the command\-line option nor
\fBsendemail\&.from\fR
are set, then the user will be prompted for the value\&. The default for the prompt will be the value of
\fBGIT_AUTHOR_IDENT\fR, or
\fBGIT_COMMITTER_IDENT\fR
if that is not set, as returned by
\fBgit\fR
\fBvar\fR
\fB\-l\fR\&.
.RE
.PP
\-\-reply\-to=<address>
.RS 4
Specify the address where replies from recipients should go to\&. Use this if replies to messages should go to another address than what is specified with the
\fB\-\-from\fR
parameter\&.
.RE
.PP
\-\-in\-reply\-to=<identifier>
.RS 4
Make the first mail (or all the mails with
\fB\-\-no\-thread\fR) appear as a reply to the given Message\-ID, which avoids breaking threads to provide a new patch series\&. The second and subsequent emails will be sent as replies according to the
\fB\-\-\fR[\fBno\-\fR]\fBchain\-reply\-to\fR
setting\&.
.sp
So for example when
\fB\-\-thread\fR
and
\fB\-\-no\-chain\-reply\-to\fR
are specified, the second and subsequent patches will be replies to the first one like in the illustration below where [\fBPATCH\fR
\fBv2\fR
\fB0/3\fR] is in reply to [\fBPATCH\fR
\fB0/2\fR]:
.sp
.if n \{\
.RS 4
.\}
.nf
[PATCH 0/2] Here is what I did\&.\&.\&.
[PATCH 1/2] Clean up and tests
[PATCH 2/2] Implementation
[PATCH v2 0/3] Here is a reroll
[PATCH v2 1/3] Clean up
[PATCH v2 2/3] New tests
[PATCH v2 3/3] Implementation
.fi
.if n \{\
.RE
.\}
.sp
Only necessary if
\fB\-\-compose\fR
is also set\&. If
\fB\-\-compose\fR
is not set, this will be prompted for\&.
.RE
.PP
\-\-[no\-]outlook\-id\-fix
.RS 4
Microsoft Outlook SMTP servers discard the Message\-ID sent via email and assign a new random Message\-ID, thus breaking threads\&.
.sp
With
\fB\-\-outlook\-id\-fix\fR,
\fBgit\fR
\fBsend\-email\fR
uses a mechanism specific to Outlook servers to learn the Message\-ID the server assigned to fix the threading\&. Use it only when you know that the server reports the rewritten Message\-ID the same way as Outlook servers do\&.
.sp
Without this option specified, the fix is done by default when talking to
\fIsmtp\&.office365\&.com\fR
or
\fIsmtp\-mail\&.outlook\&.com\fR\&. Use
\fB\-\-no\-outlook\-id\-fix\fR
to disable even when talking to these two servers\&.
.RE
.PP
\-\-subject=<string>
.RS 4
Specify the initial subject of the email thread\&. Only necessary if
\fB\-\-compose\fR
is also set\&. If
\fB\-\-compose\fR
is not set, this will be prompted for\&.
.RE
.PP
\-\-to=<address>,\&...\:
.RS 4
Specify the primary recipient of the emails generated\&. Generally, this will be the upstream maintainer of the project involved\&. Default is the value of the
\fBsendemail\&.to\fR
configuration value; if that is unspecified, and
\fB\-\-to\-cmd\fR
is not specified, this will be prompted for\&.
.sp
This option may be specified multiple times\&.
.RE
.PP
\-\-8bit\-encoding=<encoding>
.RS 4
When encountering a non\-ASCII message or subject that does not declare its encoding, add headers/quoting to indicate it is encoded in <encoding>\&. Default is the value of the
\fBsendemail\&.assume8bitEncoding\fR; if that is unspecified, this will be prompted for if any non\-ASCII files are encountered\&.
.sp
Note that no attempts whatsoever are made to validate the encoding\&.
.RE
.PP
\-\-compose\-encoding=<encoding>
.RS 4
Specify encoding of compose message\&. Default is the value of the
\fBsendemail\&.composeEncoding\fR; if that is unspecified, UTF\-8 is assumed\&.
.RE
.PP
\-\-transfer\-encoding=(7bit|8bit|quoted\-printable|base64|auto)
.RS 4
Specify the transfer encoding to be used to send the message over SMTP\&.
\fB7bit\fR
will fail upon encountering a non\-ASCII message\&.
\fBquoted\-printable\fR
can be useful when the repository contains files that contain carriage returns, but makes the raw patch email file (as saved from an MUA) much harder to inspect manually\&.
\fBbase64\fR
is even more fool proof, but also even more opaque\&.
\fBauto\fR
will use
\fB8bit\fR
when possible, and
\fBquoted\-printable\fR
otherwise\&.
.sp
Default is the value of the
\fBsendemail\&.transferEncoding\fR
configuration value; if that is unspecified, default to
\fBauto\fR\&.
.RE
.PP
\-\-xmailer, \-\-no\-xmailer
.RS 4
Add (or prevent adding) the
\fBX\-Mailer:\fR
header\&. By default, the header is added, but it can be turned off by setting the
\fBsendemail\&.xmailer\fR
configuration variable to
\fBfalse\fR\&.
.RE
.SS "Sending"
.PP
\-\-envelope\-sender=<address>
.RS 4
Specify the envelope sender used to send the emails\&. This is useful if your default address is not the address that is subscribed to a list\&. In order to use the
\fBFrom\fR
address, set the value to
\fBauto\fR\&. If you use the
\fBsendmail\fR
binary, you must have suitable privileges for the
\fB\-f\fR
parameter\&. Default is the value of the
\fBsendemail\&.envelopeSender\fR
configuration variable; if that is unspecified, choosing the envelope sender is left to your MTA\&.
.RE
.PP
\-\-sendmail\-cmd=<command>
.RS 4
Specify a command to run to send the email\&. The command should be sendmail\-like; specifically, it must support the
\fB\-i\fR
option\&. The command will be executed in the shell if necessary\&. Default is the value of
\fBsendemail\&.sendmailCmd\fR\&. If unspecified, and if
\fB\-\-smtp\-server\fR
is also unspecified,
\fBgit\fR
\fBsend\-email\fR
will search for
\fBsendmail\fR
in
\fB/usr/sbin\fR,
\fB/usr/lib\fR
and
\fB$PATH\fR\&.
.RE
.PP
\-\-smtp\-encryption=<encryption>
.RS 4
Specify in what way encrypting begins for the SMTP connection\&. Valid values are
\fBssl\fR
and
\fBtls\fR\&. Any other value reverts to plain (unencrypted) SMTP, which defaults to port 25\&. Despite the names, both values will use the same newer version of TLS, but for historic reasons have these names\&.
\fBssl\fR
refers to "implicit" encryption (sometimes called SMTPS), that uses port 465 by default\&.
\fBtls\fR
refers to "explicit" encryption (often known as STARTTLS), that uses port 25 by default\&. Other ports might be used by the SMTP server, which are not the default\&. Commonly found alternative port for
\fBtls\fR
and unencrypted is 587\&. You need to check your provider\(cqs documentation or your server configuration to make sure for your own case\&. Default is the value of
\fBsendemail\&.smtpEncryption\fR\&.
.RE
.PP
\-\-smtp\-domain=<FQDN>
.RS 4
Specifies the Fully Qualified Domain Name (FQDN) used in the HELO/EHLO command to the SMTP server\&. Some servers require the FQDN to match your IP address\&. If not set,
\fBgit\fR
\fBsend\-email\fR
attempts to determine your FQDN automatically\&. Default is the value of
\fBsendemail\&.smtpDomain\fR\&.
.RE
.PP
\-\-smtp\-auth=<mechanisms>
.RS 4
Whitespace\-separated list of allowed SMTP\-AUTH mechanisms\&. This setting forces using only the listed mechanisms\&. Example:
.sp
.if n \{\
.RS 4
.\}
.nf
$ git send\-email \-\-smtp\-auth="PLAIN LOGIN GSSAPI" \&.\&.\&.
.fi
.if n \{\
.RE
.\}
.sp
If at least one of the specified mechanisms matches the ones advertised by the SMTP server and if it is supported by the utilized SASL library, the mechanism is used for authentication\&. If neither
\fBsendemail\&.smtpAuth\fR
nor
\fB\-\-smtp\-auth\fR
is specified, all mechanisms supported by the SASL library can be used\&. The special value
\fBnone\fR
maybe specified to completely disable authentication independently of
\fB\-\-smtp\-user\fR\&.
.RE
.PP
\-\-smtp\-pass[=<password>]
.RS 4
Password for SMTP\-AUTH\&. The argument is optional: If no argument is specified, then the empty string is used as the password\&. Default is the value of
\fBsendemail\&.smtpPass\fR, however
\fB\-\-smtp\-pass\fR
always overrides this value\&.
.sp
Furthermore, passwords need not be specified in configuration files or on the command line\&. If a username has been specified (with
\fB\-\-smtp\-user\fR
or a
\fBsendemail\&.smtpUser\fR), but no password has been specified (with
\fB\-\-smtp\-pass\fR
or
\fBsendemail\&.smtpPass\fR), then a password is obtained using
\fBgit-credential\fR(1)\&.
.RE
.PP
\-\-no\-smtp\-auth
.RS 4
Disable SMTP authentication\&. Short hand for
\fB\-\-smtp\-auth=none\fR\&.
.RE
.PP
\-\-smtp\-server=<host>
.RS 4
If set, specifies the outgoing SMTP server to use (e\&.g\&.
\fBsmtp\&.example\&.com\fR
or a raw IP address)\&. If unspecified, and if
\fB\-\-sendmail\-cmd\fR
is also unspecified, the default is to search for
\fBsendmail\fR
in
\fB/usr/sbin\fR,
\fB/usr/lib\fR
and
\fB$PATH\fR
if such a program is available, falling back to
\fBlocalhost\fR
otherwise\&.
.sp
For backward compatibility, this option can also specify a full pathname of a sendmail\-like program instead; the program must support the
\fB\-i\fR
option\&. This method does not support passing arguments or using plain command names\&. For those use cases, consider using
\fB\-\-sendmail\-cmd\fR
instead\&.
.RE
.PP
\-\-smtp\-server\-port=<port>
.RS 4
Specifies a port different from the default port (SMTP servers typically listen to smtp port 25, but may also listen to submission port 587, or the common SSL smtp port 465); symbolic port names (e\&.g\&.
\fBsubmission\fR
instead of 587) are also accepted\&. The port can also be set with the
\fBsendemail\&.smtpServerPort\fR
configuration variable\&.
.RE
.PP
\-\-smtp\-server\-option=<option>
.RS 4
If set, specifies the outgoing SMTP server option to use\&. Default value can be specified by the
\fBsendemail\&.smtpServerOption\fR
configuration option\&.
.sp
The
\fB\-\-smtp\-server\-option\fR
option must be repeated for each option you want to pass to the server\&. Likewise, different lines in the configuration files must be used for each option\&.
.RE
.PP
\-\-smtp\-ssl
.RS 4
Legacy alias for
\fB\-\-smtp\-encryption\fR
\fBssl\fR\&.
.RE
.PP
\-\-smtp\-ssl\-cert\-path
.RS 4
Path to a store of trusted CA certificates for SMTP SSL/TLS certificate validation (either a directory that has been processed by
\fBc_rehash\fR, or a single file containing one or more PEM format certificates concatenated together: see the description of the
\fB\-CAfile\fR
\fI<file>\fR
and the
\fB\-CApath\fR
\fI<dir>\fR
options of
\m[blue]\fBhttps://docs\&.openssl\&.org/master/man1/openssl\-verify/\fR\m[]
[OpenSSL\(cqs verify(1) manual page] for more information on these)\&. Set it to an empty string to disable certificate verification\&. Defaults to the value of the
\fBsendemail\&.smtpSSLCertPath\fR
configuration variable, if set, or the backing SSL library\(cqs compiled\-in default otherwise (which should be the best choice on most platforms)\&.
.RE
.PP
\-\-smtp\-user=<user>
.RS 4
Username for SMTP\-AUTH\&. Default is the value of
\fBsendemail\&.smtpUser\fR; if a username is not specified (with
\fB\-\-smtp\-user\fR
or
\fBsendemail\&.smtpUser\fR), then authentication is not attempted\&.
.RE
.PP
\-\-smtp\-debug=(0|1)
.RS 4
Enable (1) or disable (0) debug output\&. If enabled, SMTP commands and replies will be printed\&. Useful to debug TLS connection and authentication problems\&.
.RE
.PP
\-\-batch\-size=<num>
.RS 4
Some email servers (e\&.g\&.
\fIsmtp\&.163\&.com\fR) limit the number of emails to be sent per session (connection) and this will lead to a failure when sending many messages\&. With this option, send\-email will disconnect after sending
\fI<num>\fR
messages and wait for a few seconds (see
\fB\-\-relogin\-delay\fR) and reconnect, to work around such a limit\&. You may want to use some form of credential helper to avoid having to retype your password every time this happens\&. Defaults to the
\fBsendemail\&.smtpBatchSize\fR
configuration variable\&.
.RE
.PP
\-\-relogin\-delay=<int>
.RS 4
Waiting
\fI<int>\fR
seconds before reconnecting to SMTP server\&. Used together with
\fB\-\-batch\-size\fR
option\&. Defaults to the
\fBsendemail\&.smtpReloginDelay\fR
configuration variable\&.
.RE
.SS "Automating"
.PP
\-\-no\-to, \-\-no\-cc, \-\-no\-bcc
.RS 4
Clears any list of
\fBTo:\fR,
\fBCc:\fR,
\fBBcc:\fR
addresses previously set via config\&.
.RE
.PP
\-\-no\-identity
.RS 4
Clears the previously read value of
\fBsendemail\&.identity\fR
set via config, if any\&.
.RE
.PP
\-\-to\-cmd=<command>
.RS 4
Specify a command to execute once per patch file which should generate patch file specific
\fBTo:\fR
entries\&. Output of this command must be single email address per line\&. Default is the value of
\fBsendemail\&.toCmd\fR
configuration value\&.
.RE
.PP
\-\-cc\-cmd=<command>
.RS 4
Specify a command to execute once per patch file which should generate patch file specific
\fBCc:\fR
entries\&. Output of this command must be single email address per line\&. Default is the value of
\fBsendemail\&.ccCmd\fR
configuration value\&.
.RE
.PP
\-\-header\-cmd=<command>
.RS 4
Specify a command that is executed once per outgoing message and output RFC 2822 style header lines to be inserted into them\&. When the
\fBsendemail\&.headerCmd\fR
configuration variable is set, its value is always used\&. When
\fB\-\-header\-cmd\fR
is provided at the command line, its value takes precedence over the
\fBsendemail\&.headerCmd\fR
configuration variable\&.
.RE
.PP
\-\-no\-header\-cmd
.RS 4
Disable any header command in use\&.
.RE
.PP
\-\-[no\-]chain\-reply\-to
.RS 4
If this is set, each email will be sent as a reply to the previous email sent\&. If disabled with
\fB\-\-no\-chain\-reply\-to\fR, all emails after the first will be sent as replies to the first email sent\&. When using this, it is recommended that the first file given be an overview of the entire patch series\&. Disabled by default, but the
\fBsendemail\&.chainReplyTo\fR
configuration variable can be used to enable it\&.
.RE
.PP
\-\-identity=<identity>
.RS 4
A configuration identity\&. When given, causes values in the
\fBsendemail\&.\fR\fI<identity>\fR
subsection to take precedence over values in the
\fBsendemail\fR
section\&. The default identity is the value of
\fBsendemail\&.identity\fR\&.
.RE
.PP
\-\-[no\-]signed\-off\-by\-cc
.RS 4
If this is set, add emails found in the
\fBSigned\-off\-by\fR
trailer or
\fBCc:\fR
lines to the cc list\&. Default is the value of
\fBsendemail\&.signedOffByCc\fR
configuration value; if that is unspecified, default to
\fB\-\-signed\-off\-by\-cc\fR\&.
.RE
.PP
\-\-[no\-]cc\-cover
.RS 4
If this is set, emails found in
\fBCc:\fR
headers in the first patch of the series (typically the cover letter) are added to the cc list for each email set\&. Default is the value of
\fBsendemail\&.ccCover\fR
configuration value; if that is unspecified, default to
\fB\-\-no\-cc\-cover\fR\&.
.RE
.PP
\-\-[no\-]to\-cover
.RS 4
If this is set, emails found in
\fBTo:\fR
headers in the first patch of the series (typically the cover letter) are added to the to list for each email set\&. Default is the value of
\fBsendemail\&.toCover\fR
configuration value; if that is unspecified, default to
\fB\-\-no\-to\-cover\fR\&.
.RE
.PP
\-\-suppress\-cc=<category>
.RS 4
Specify an additional category of recipients to suppress the auto\-cc of:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBauthor\fR
will avoid including the patch author\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBself\fR
will avoid including the sender\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBcc\fR
will avoid including anyone mentioned in Cc lines in the patch header except for self (use
\fBself\fR
for that)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBbodycc\fR
will avoid including anyone mentioned in Cc lines in the patch body (commit message) except for self (use
\fBself\fR
for that)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBsob\fR
will avoid including anyone mentioned in the Signed\-off\-by trailers except for self (use
\fBself\fR
for that)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBmisc\-by\fR
will avoid including anyone mentioned in Acked\-by, Reviewed\-by, Tested\-by and other "\-by" lines in the patch body, except Signed\-off\-by (use
\fBsob\fR
for that)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBcccmd\fR
will avoid running the \-\-cc\-cmd\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBbody\fR
is equivalent to
\fBsob\fR
+
\fBbodycc\fR
+
\fBmisc\-by\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBall\fR
will suppress all auto cc values\&.
.RE
.sp
Default is the value of
\fBsendemail\&.suppressCc\fR
configuration value; if that is unspecified, default to
\fBself\fR
if
\fB\-\-suppress\-from\fR
is specified, as well as
\fBbody\fR
if
\fB\-\-no\-signed\-off\-cc\fR
is specified\&.
.RE
.PP
\-\-[no\-]suppress\-from
.RS 4
If this is set, do not add the
\fBFrom:\fR
address to the
\fBCc:\fR
list\&. Default is the value of
\fBsendemail\&.suppressFrom\fR
configuration value; if that is unspecified, default to
\fB\-\-no\-suppress\-from\fR\&.
.RE
.PP
\-\-[no\-]thread
.RS 4
If this is set, the
\fBIn\-Reply\-To\fR
and
\fBReferences\fR
headers will be added to each email sent\&. Whether each mail refers to the previous email (\fBdeep\fR
threading per
\fBgit\fR
\fBformat\-patch\fR
wording) or to the first email (\fBshallow\fR
threading) is governed by
\fB\-\-\fR[\fBno\-\fR]\fBchain\-reply\-to\fR\&.
.sp
If disabled with
\fB\-\-no\-thread\fR, those headers will not be added (unless specified with
\fB\-\-in\-reply\-to\fR)\&. Default is the value of the
\fBsendemail\&.thread\fR
configuration value; if that is unspecified, default to
\fB\-\-thread\fR\&.
.sp
It is up to the user to ensure that no In\-Reply\-To header already exists when
\fBgit\fR
\fBsend\-email\fR
is asked to add it (especially note that
\fBgit\fR
\fBformat\-patch\fR
can be configured to do the threading itself)\&. Failure to do so may not produce the expected result in the recipient\(cqs MUA\&.
.RE
.PP
\-\-[no\-]mailmap
.RS 4
Use the mailmap file (see
\fBgitmailmap\fR(5)) to map all addresses to their canonical real name and email address\&. Additional mailmap data specific to
\fBgit\fR
\fBsend\-email\fR
may be provided using the
\fBsendemail\&.mailmap\&.file\fR
or
\fBsendemail\&.mailmap\&.blob\fR
configuration values\&. Defaults to
\fBsendemail\&.mailmap\fR\&.
.RE
.SS "Administering"
.PP
\-\-confirm=<mode>
.RS 4
Confirm just before sending:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBalways\fR
will always confirm before sending\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBnever\fR
will never confirm before sending\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBcc\fR
will confirm before sending when send\-email has automatically added addresses from the patch to the Cc list\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBcompose\fR
will confirm before sending the first message when using \-\-compose\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBauto\fR
is equivalent to
\fBcc\fR
+
\fBcompose\fR\&.
.RE
.sp
Default is the value of
\fBsendemail\&.confirm\fR
configuration value; if that is unspecified, default to
\fBauto\fR
unless any of the suppress options have been specified, in which case default to
\fBcompose\fR\&.
.RE
.PP
\-\-dry\-run
.RS 4
Do everything except actually send the emails\&.
.RE
.PP
\-\-[no\-]format\-patch
.RS 4
When an argument may be understood either as a reference or as a file name, choose to understand it as a format\-patch argument (\fB\-\-format\-patch\fR) or as a file name (\fB\-\-no\-format\-patch\fR)\&. By default, when such a conflict occurs,
\fBgit\fR
\fBsend\-email\fR
will fail\&.
.RE
.PP
\-\-quiet
.RS 4
Make
\fBgit\fR
\fBsend\-email\fR
less verbose\&. One line per email should be all that is output\&.
.RE
.PP
\-\-[no\-]validate
.RS 4
Perform sanity checks on patches\&. Currently, validation means the following:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Invoke the sendemail\-validate hook if present (see
\fBgithooks\fR(5))\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Warn of patches that contain lines longer than 998 characters unless a suitable transfer encoding (\fBauto\fR,
\fBbase64\fR, or
\fBquoted\-printable\fR) is used; this is due to SMTP limits as described by
\m[blue]\fBhttps://www\&.ietf\&.org/rfc/rfc5322\&.txt\fR\m[]\&.
.RE
.sp
Default is the value of
\fBsendemail\&.validate\fR; if this is not set, default to
\fB\-\-validate\fR\&.
.RE
.PP
\-\-force
.RS 4
Send emails even if safety checks would prevent it\&.
.RE
.SS "Information"
.PP
\-\-dump\-aliases
.RS 4
Instead of the normal operation, dump the shorthand alias names from the configured alias file(s), one per line in alphabetical order\&. Note that this only includes the alias name and not its expanded email addresses\&. See
\fBsendemail\&.aliasesFile\fR
for more information about aliases\&.
.RE
.PP
\-\-translate\-aliases
.RS 4
Instead of the normal operation, read from standard input and interpret each line as an email alias\&. Translate it according to the configured alias file(s)\&. Output each translated name and email address to standard output, one per line\&. See
\fBsendemail\&.aliasFile\fR
for more information about aliases\&.
.RE
.SH "CONFIGURATION"
.sp
Everything below this line in this section is selectively included from the \fBgit-config\fR(1) documentation\&. The content is the same as what\(cqs found there:
.PP
sendemail\&.identity
.RS 4
A configuration identity\&. When given, causes values in the
\fBsendemail\&.\fR\fI<identity>\fR
subsection to take precedence over values in the
\fBsendemail\fR
section\&. The default identity is the value of
\fBsendemail\&.identity\fR\&.
.RE
.PP
sendemail\&.smtpEncryption
.RS 4
See
\fBgit-send-email\fR(1)
for description\&. Note that this setting is not subject to the
\fBidentity\fR
mechanism\&.
.RE
.PP
sendemail\&.smtpSSLCertPath
.RS 4
Path to ca\-certificates (either a directory or a single file)\&. Set it to an empty string to disable certificate verification\&.
.RE
.PP
sendemail\&.<identity>\&.*
.RS 4
Identity\-specific versions of the
\fBsendemail\&.*\fR
parameters found below, taking precedence over those when this identity is selected, through either the command\-line or
\fBsendemail\&.identity\fR\&.
.RE
.PP
sendemail\&.multiEdit
.RS 4
If
\fBtrue\fR
(default), a single editor instance will be spawned to edit files you have to edit (patches when
\fB\-\-annotate\fR
is used, and the summary when
\fB\-\-compose\fR
is used)\&. If
\fBfalse\fR, files will be edited one after the other, spawning a new editor each time\&.
.RE
.PP
sendemail\&.confirm
.RS 4
Sets the default for whether to confirm before sending\&. Must be one of
\fBalways\fR,
\fBnever\fR,
\fBcc\fR,
\fBcompose\fR, or
\fBauto\fR\&. See
\fB\-\-confirm\fR
in the
\fBgit-send-email\fR(1)
documentation for the meaning of these values\&.
.RE
.PP
sendemail\&.mailmap
.RS 4
If
\fBtrue\fR, makes
\fBgit-send-email\fR(1)
assume
\fB\-\-mailmap\fR, otherwise assume
\fB\-\-no\-mailmap\fR\&.
\fBFalse\fR
by default\&.
.RE
.PP
sendemail\&.mailmap\&.file
.RS 4
The location of a
\fBgit-send-email\fR(1)
specific augmenting mailmap file\&. The default mailmap and
\fBmailmap\&.file\fR
are loaded first\&. Thus, entries in this file take precedence over entries in the default mailmap locations\&. See
\fBgitmailmap\fR(5)\&.
.RE
.PP
sendemail\&.mailmap\&.blob
.RS 4
Like
\fBsendemail\&.mailmap\&.file\fR, but consider the value as a reference to a blob in the repository\&. Entries in
\fBsendemail\&.mailmap\&.file\fR
take precedence over entries here\&. See
\fBgitmailmap\fR(5)\&.
.RE
.PP
sendemail\&.aliasesFile
.RS 4
To avoid typing long email addresses, point this to one or more email aliases files\&. You must also supply
\fBsendemail\&.aliasFileType\fR\&.
.RE
.PP
sendemail\&.aliasFileType
.RS 4
Format of the file(s) specified in sendemail\&.aliasesFile\&. Must be one of
\fBmutt\fR,
\fBmailrc\fR,
\fBpine\fR,
\fBelm\fR,
\fBgnus\fR, or
\fBsendmail\fR\&.
.sp
What an alias file in each format looks like can be found in the documentation of the email program of the same name\&. The differences and limitations from the standard formats are described below:
.PP
sendmail
.RS 4
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Quoted aliases and quoted addresses are not supported: lines that contain a " symbol are ignored\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Redirection to a file (\fB/path/name\fR) or pipe (|\fBcommand\fR) is not supported\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
File inclusion (\fB:include:\fR
\fB/path/name\fR) is not supported\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Warnings are printed on the standard error output for any explicitly unsupported constructs, and any other lines that are not recognized by the parser\&.
.RE
.RE
.RE
.PP
sendemail\&.annotate, sendemail\&.bcc, sendemail\&.cc, sendemail\&.ccCmd, sendemail\&.chainReplyTo, sendemail\&.envelopeSender, sendemail\&.from, sendemail\&.headerCmd, sendemail\&.signedOffByCc, sendemail\&.smtpPass, sendemail\&.suppressCc, sendemail\&.suppressFrom, sendemail\&.to, sendemail\&.toCmd, sendemail\&.smtpDomain, sendemail\&.smtpServer, sendemail\&.smtpServerPort, sendemail\&.smtpServerOption, sendemail\&.smtpUser, sendemail\&.thread, sendemail\&.transferEncoding, sendemail\&.validate, sendemail\&.xmailer
.RS 4
These configuration variables all provide a default for
\fBgit-send-email\fR(1)
command\-line options\&. See its documentation for details\&.
.RE
.PP
sendemail\&.outlookidfix
.RS 4
If
\fBtrue\fR, makes
\fBgit-send-email\fR(1)
assume
\fB\-\-outlook\-id\-fix\fR, and if
\fBfalse\fR
assume
\fB\-\-no\-outlook\-id\-fix\fR\&. If not specified, it will behave the same way as if
\fB\-\-outlook\-id\-fix\fR
is not specified\&.
.RE
.PP
sendemail\&.signedOffCc (deprecated)
.RS 4
Deprecated alias for
\fBsendemail\&.signedOffByCc\fR\&.
.RE
.PP
sendemail\&.smtpBatchSize
.RS 4
Number of messages to be sent per connection, after that a relogin will happen\&. If the value is
\fB0\fR
or undefined, send all messages in one connection\&. See also the
\fB\-\-batch\-size\fR
option of
\fBgit-send-email\fR(1)\&.
.RE
.PP
sendemail\&.smtpReloginDelay
.RS 4
Seconds to wait before reconnecting to the smtp server\&. See also the
\fB\-\-relogin\-delay\fR
option of
\fBgit-send-email\fR(1)\&.
.RE
.PP
sendemail\&.forbidSendmailVariables
.RS 4
To avoid common misconfiguration mistakes,
\fBgit-send-email\fR(1)
will abort with a warning if any configuration options for
\fBsendmail\fR
exist\&. Set this variable to bypass the check\&.
.RE
.SH "EXAMPLES OF SMTP SERVERS"
.SS "Use Gmail as the SMTP Server"
.sp
To use \fBgit\fR \fBsend\-email\fR to send your patches through the Gmail SMTP server, edit \fB~/\&.gitconfig\fR to specify your account settings:
.sp
.if n \{\
.RS 4
.\}
.nf
[sendemail]
smtpEncryption = tls
smtpServer = smtp\&.gmail\&.com
smtpUser = yourname@gmail\&.com
smtpServerPort = 587
.fi
.if n \{\
.RE
.\}
.sp
Gmail does not allow using your regular password for \fBgit\fR \fBsend\-email\fR\&. If you have multi\-factor authentication set up on your Gmail account, you can generate an app\-specific password for use with \fBgit\fR \fBsend\-email\fR\&. Visit \m[blue]\fBhttps://security\&.google\&.com/settings/security/apppasswords\fR\m[] to create it\&.
.sp
Alternatively, instead of using an app\-specific password, you can use OAuth2\&.0 authentication with Gmail\&. OAuth2\&.0 is more secure than app\-specific passwords, and works regardless of whether you have multi\-factor authentication set up\&. \fBOAUTHBEARER\fR and \fBXOAUTH2\fR are common mechanisms used for this type of authentication\&. Gmail supports both of them\&. As an example, if you want to use \fBOAUTHBEARER\fR, edit your \fB~/\&.gitconfig\fR file and add \fBsmtpAuth\fR \fB=\fR \fBOAUTHBEARER\fR to your account settings:
.sp
.if n \{\
.RS 4
.\}
.nf
[sendemail]
smtpEncryption = tls
smtpServer = smtp\&.gmail\&.com
smtpUser = yourname@gmail\&.com
smtpServerPort = 587
smtpAuth = OAUTHBEARER
.fi
.if n \{\
.RE
.\}
.sp
Another alternative is using a tool developed by Google known as \m[blue]\fBsendgmail\fR\m[]\&\s-2\u[1]\d\s+2 to send emails using \fBgit\fR \fBsend\-email\fR\&.
.SS "Use Microsoft Outlook as the SMTP Server"
.sp
Unlike Gmail, Microsoft Outlook no longer supports app\-specific passwords\&. Therefore, OAuth2\&.0 authentication must be used for Outlook\&. Also, it only supports \fBXOAUTH2\fR authentication mechanism\&.
.sp
Edit \fB~/\&.gitconfig\fR to specify your account settings for Outlook and use its SMTP server with \fBgit\fR \fBsend\-email\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
[sendemail]
smtpEncryption = tls
smtpServer = smtp\&.office365\&.com
smtpUser = yourname@outlook\&.com
smtpServerPort = 587
smtpAuth = XOAUTH2
.fi
.if n \{\
.RE
.\}
.SH "SENDING PATCHES"
.sp
Once your commits are ready to be sent to the mailing list, run the following commands:
.sp
.if n \{\
.RS 4
.\}
.nf
$ git format\-patch \-\-cover\-letter \-M origin/master \-o outgoing/
$ edit outgoing/0000\-*
$ git send\-email outgoing/*
.fi
.if n \{\
.RE
.\}
.sp
The first time you run it, you will be prompted for your credentials\&. Enter the app\-specific or your regular password as appropriate\&.
.sp
If you have a credential helper configured (see \fBgit-credential\fR(1)), the password will be saved in the credential store so you won\(cqt have to type it the next time\&.
.sp
If you are using OAuth2\&.0 authentication, you need to use an access token in place of a password when prompted\&. Various OAuth2\&.0 token generators are available online\&. Community maintained credential helpers are also available:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\m[blue]\fBgit\-credential\-gmail\fR\m[]\&\s-2\u[2]\d\s+2
(cross platform, dedicated helper for authenticating Gmail accounts)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\m[blue]\fBgit\-credential\-outlook\fR\m[]\&\s-2\u[2]\d\s+2
(cross platform, dedicated helper for authenticating Microsoft Outlook accounts)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\m[blue]\fBgit\-credential\-yahoo\fR\m[]\&\s-2\u[2]\d\s+2
(cross platform, dedicated helper for authenticating Yahoo accounts)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\m[blue]\fBgit\-credential\-aol\fR\m[]\&\s-2\u[2]\d\s+2
(cross platform, dedicated helper for authenticating AOL accounts)
.RE
.sp
You can also see \fBgitcredentials\fR(7) for more OAuth based authentication helpers\&.
.sp
Proton Mail does not provide an SMTP server to send emails\&. If you are a paid customer of Proton Mail, you can use \m[blue]\fBProton Mail Bridge\fR\m[]\&\s-2\u[3]\d\s+2 officially provided by Proton Mail to create a local SMTP server for sending emails\&. For both free and paid users, community maintained projects like \m[blue]\fBgit\-protonmail\fR\m[]\&\s-2\u[2]\d\s+2 can be used\&.
.sp
Note: the following core Perl modules that may be installed with your distribution of Perl are required:
.sp
\m[blue]\fBMIME::Base64\fR\m[]\&\s-2\u[4]\d\s+2, \m[blue]\fBMIME::QuotedPrint\fR\m[]\&\s-2\u[5]\d\s+2, \m[blue]\fBNet::Domain\fR\m[]\&\s-2\u[6]\d\s+2 and \m[blue]\fBNet::SMTP\fR\m[]\&\s-2\u[7]\d\s+2\&.
.sp
These additional Perl modules are also required:
.sp
\m[blue]\fBAuthen::SASL\fR\m[]\&\s-2\u[8]\d\s+2 and \m[blue]\fBMail::Address\fR\m[]\&\s-2\u[9]\d\s+2\&.
.SS "Exploiting the \fBsendmailCmd\fR option of \fBgit\fR \fBsend\-email\fR"
.sp
Apart from sending emails via an SMTP server, \fBgit\fR \fBsend\-email\fR can also send emails through any application that supports sendmail\-like commands\&. You can read documentation of \fB\-\-sendmail\-cmd=\fR\fI<command>\fR above for more information\&. This ability can be very useful if you want to use another application as an SMTP client for \fBgit\fR \fBsend\-email\fR, or if your email provider uses proprietary APIs instead of SMTP to send emails\&.
.sp
As an example, lets see how to configure \m[blue]\fBmsmtp\fR\m[]\&\s-2\u[10]\d\s+2, a popular SMTP client found in many Linux distributions\&. Edit \fB~/\&.gitconfig\fR to instruct \fBgit\-send\-email\fR to use it for sending emails\&.
.sp
.if n \{\
.RS 4
.\}
.nf
[sendemail]
sendmailCmd = /usr/bin/msmtp # Change this to the path where msmtp is installed
.fi
.if n \{\
.RE
.\}
.sp
Links of a few such community maintained helpers are:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\m[blue]\fBmsmtp\fR\m[]\&\s-2\u[10]\d\s+2
(popular SMTP client with many features, available for Linux and macOS)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\m[blue]\fBgit\-protonmail\fR\m[]\&\s-2\u[2]\d\s+2
(cross platform client that can send emails using the ProtonMail API)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\m[blue]\fBgit\-msgraph\fR\m[]\&\s-2\u[2]\d\s+2
(cross platform client that can send emails using the Microsoft Graph API)
.RE
.SH "SEE ALSO"
.sp
\fBgit-format-patch\fR(1), \fBgit-imap-send\fR(1), mbox(5)
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite
.SH "NOTES"
.IP " 1." 4
sendgmail
.RS 4
\%https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail
.RE
.IP " 2." 4
git-credential-gmail
.RS 4
\%https://github.com/AdityaGarg8/git-credential-email
.RE
.IP " 3." 4
Proton Mail Bridge
.RS 4
\%https://proton.me/mail/bridge
.RE
.IP " 4." 4
MIME::Base64
.RS 4
\%https://metacpan.org/pod/MIME::Base64
.RE
.IP " 5." 4
MIME::QuotedPrint
.RS 4
\%https://metacpan.org/pod/MIME::QuotedPrint
.RE
.IP " 6." 4
Net::Domain
.RS 4
\%https://metacpan.org/pod/Net::Domain
.RE
.IP " 7." 4
Net::SMTP
.RS 4
\%https://metacpan.org/pod/Net::SMTP
.RE
.IP " 8." 4
Authen::SASL
.RS 4
\%https://metacpan.org/pod/Authen::SASL
.RE
.IP " 9." 4
Mail::Address
.RS 4
\%https://metacpan.org/pod/Mail::Address
.RE
.IP "10." 4
msmtp
.RS 4
\%https://marlam.de/msmtp/
.RE