1GIT-SEND-EMAIL(1)                 Git Manual                 GIT-SEND-EMAIL(1)
2
3
4

NAME

6       git-send-email - Send a collection of patches as emails
7

SYNOPSIS

9       git send-email [options] <file|directory|rev-list options>...
10
11

DESCRIPTION

13       Takes the patches given on the command line and emails them out.
14       Patches can be specified as files, directories (which will send all
15       files in the directory), or directly as a revision list. In the last
16       case, any format accepted by git-format-patch(1) can be passed to git
17       send-email.
18
19       The header of the email is configurable by command line options. If not
20       specified on the command line, the user will be prompted with a
21       ReadLine enabled interface to provide the necessary information.
22
23       There are two formats accepted for patch files:
24
25        1. mbox format files
26
27           This is what git-format-patch(1) generates. Most headers and MIME
28           formatting are ignored.
29
30        2. The original format used by Greg Kroah-Hartman’s
31           send_lots_of_email.pl script
32
33           This format expects the first line of the file to contain the "Cc:"
34           value and the "Subject:" of the message as the second line.
35

OPTIONS

37   Composing
38       --annotate
39           Review and edit each patch you’re about to send. Default is the
40           value of sendemail.annotate. See the CONFIGURATION section for
41           sendemail.multiedit.
42
43       --bcc=<address>
44           Specify a "Bcc:" value for each email. Default is the value of
45           sendemail.bcc.
46
47           The --bcc option must be repeated for each user you want on the bcc
48           list.
49
50       --cc=<address>
51           Specify a starting "Cc:" value for each email. Default is the value
52           of sendemail.cc.
53
54           The --cc option must be repeated for each user you want on the cc
55           list.
56
57       --compose
58           Invoke a text editor (see GIT_EDITOR in git-var(1)) to edit an
59           introductory message for the patch series.
60
61           When --compose is used, git send-email will use the From, Subject,
62           and In-Reply-To headers specified in the message. If the body of
63           the message (what you type after the headers and a blank line) only
64           contains blank (or Git: prefixed) lines the summary won’t be sent,
65           but From, Subject, and In-Reply-To headers will be used unless they
66           are removed.
67
68           Missing From or In-Reply-To headers will be prompted for.
69
70           See the CONFIGURATION section for sendemail.multiedit.
71
72       --from=<address>
73           Specify the sender of the emails. If not specified on the command
74           line, the value of the sendemail.from configuration option is used.
75           If neither the command line option nor sendemail.from are set, then
76           the user will be prompted for the value. The default for the prompt
77           will be the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if
78           that is not set, as returned by "git var -l".
79
80       --in-reply-to=<identifier>
81           Make the first mail (or all the mails with --no-thread) appear as a
82           reply to the given Message-Id, which avoids breaking threads to
83           provide a new patch series. The second and subsequent emails will
84           be sent as replies according to the --[no]-chain-reply-to setting.
85
86           So for example when --thread and --no-chain-reply-to are specified,
87           the second and subsequent patches will be replies to the first one
88           like in the illustration below where [PATCH v2 0/3] is in reply to
89           [PATCH 0/2]:
90
91               [PATCH 0/2] Here is what I did...
92                 [PATCH 1/2] Clean up and tests
93                 [PATCH 2/2] Implementation
94                 [PATCH v2 0/3] Here is a reroll
95                   [PATCH v2 1/3] Clean up
96                   [PATCH v2 2/3] New tests
97                   [PATCH v2 3/3] Implementation
98
99           Only necessary if --compose is also set. If --compose is not set,
100           this will be prompted for.
101
102       --subject=<string>
103           Specify the initial subject of the email thread. Only necessary if
104           --compose is also set. If --compose is not set, this will be
105           prompted for.
106
107       --to=<address>
108           Specify the primary recipient of the emails generated. Generally,
109           this will be the upstream maintainer of the project involved.
110           Default is the value of the sendemail.to configuration value; if
111           that is unspecified, and --to-cmd is not specified, this will be
112           prompted for.
113
114           The --to option must be repeated for each user you want on the to
115           list.
116
117       --8bit-encoding=<encoding>
118           When encountering a non-ASCII message or subject that does not
119           declare its encoding, add headers/quoting to indicate it is encoded
120           in <encoding>. Default is the value of the
121           sendemail.assume8bitEncoding; if that is unspecified, this will be
122           prompted for if any non-ASCII files are encountered.
123
124           Note that no attempts whatsoever are made to validate the encoding.
125
126       --compose-encoding=<encoding>
127           Specify encoding of compose message. Default is the value of the
128           sendemail.composeencoding; if that is unspecified, UTF-8 is
129           assumed.
130
131   Sending
132       --envelope-sender=<address>
133           Specify the envelope sender used to send the emails. This is useful
134           if your default address is not the address that is subscribed to a
135           list. In order to use the From address, set the value to "auto". If
136           you use the sendmail binary, you must have suitable privileges for
137           the -f parameter. Default is the value of the
138           sendemail.envelopesender configuration variable; if that is
139           unspecified, choosing the envelope sender is left to your MTA.
140
141       --smtp-encryption=<encryption>
142           Specify the encryption to use, either ssl or tls. Any other value
143           reverts to plain SMTP. Default is the value of
144           sendemail.smtpencryption.
145
146       --smtp-domain=<FQDN>
147           Specifies the Fully Qualified Domain Name (FQDN) used in the
148           HELO/EHLO command to the SMTP server. Some servers require the FQDN
149           to match your IP address. If not set, git send-email attempts to
150           determine your FQDN automatically. Default is the value of
151           sendemail.smtpdomain.
152
153       --smtp-pass[=<password>]
154           Password for SMTP-AUTH. The argument is optional: If no argument is
155           specified, then the empty string is used as the password. Default
156           is the value of sendemail.smtppass, however --smtp-pass always
157           overrides this value.
158
159           Furthermore, passwords need not be specified in configuration files
160           or on the command line. If a username has been specified (with
161           --smtp-user or a sendemail.smtpuser), but no password has been
162           specified (with --smtp-pass or sendemail.smtppass), then a password
163           is obtained using git-credential.
164
165       --smtp-server=<host>
166           If set, specifies the outgoing SMTP server to use (e.g.
167           smtp.example.com or a raw IP address). Alternatively it can specify
168           a full pathname of a sendmail-like program instead; the program
169           must support the -i option. Default value can be specified by the
170           sendemail.smtpserver configuration option; the built-in default is
171           /usr/sbin/sendmail or /usr/lib/sendmail if such program is
172           available, or localhost otherwise.
173
174       --smtp-server-port=<port>
175           Specifies a port different from the default port (SMTP servers
176           typically listen to smtp port 25, but may also listen to submission
177           port 587, or the common SSL smtp port 465); symbolic port names
178           (e.g. "submission" instead of 587) are also accepted. The port can
179           also be set with the sendemail.smtpserverport configuration
180           variable.
181
182       --smtp-server-option=<option>
183           If set, specifies the outgoing SMTP server option to use. Default
184           value can be specified by the sendemail.smtpserveroption
185           configuration option.
186
187           The --smtp-server-option option must be repeated for each option
188           you want to pass to the server. Likewise, different lines in the
189           configuration files must be used for each option.
190
191       --smtp-ssl
192           Legacy alias for --smtp-encryption ssl.
193
194       --smtp-user=<user>
195           Username for SMTP-AUTH. Default is the value of sendemail.smtpuser;
196           if a username is not specified (with --smtp-user or
197           sendemail.smtpuser), then authentication is not attempted.
198
199       --smtp-debug=0|1
200           Enable (1) or disable (0) debug output. If enabled, SMTP commands
201           and replies will be printed. Useful to debug TLS connection and
202           authentication problems.
203
204   Automating
205       --to-cmd=<command>
206           Specify a command to execute once per patch file which should
207           generate patch file specific "To:" entries. Output of this command
208           must be single email address per line. Default is the value of
209           sendemail.tocmd configuration value.
210
211       --cc-cmd=<command>
212           Specify a command to execute once per patch file which should
213           generate patch file specific "Cc:" entries. Output of this command
214           must be single email address per line. Default is the value of
215           sendemail.cccmd configuration value.
216
217       --[no-]chain-reply-to
218           If this is set, each email will be sent as a reply to the previous
219           email sent. If disabled with "--no-chain-reply-to", all emails
220           after the first will be sent as replies to the first email sent.
221           When using this, it is recommended that the first file given be an
222           overview of the entire patch series. Disabled by default, but the
223           sendemail.chainreplyto configuration variable can be used to enable
224           it.
225
226       --identity=<identity>
227           A configuration identity. When given, causes values in the
228           sendemail.<identity> subsection to take precedence over values in
229           the sendemail section. The default identity is the value of
230           sendemail.identity.
231
232       --[no-]signed-off-by-cc
233           If this is set, add emails found in Signed-off-by: or Cc: lines to
234           the cc list. Default is the value of sendemail.signedoffbycc
235           configuration value; if that is unspecified, default to
236           --signed-off-by-cc.
237
238       --suppress-cc=<category>
239           Specify an additional category of recipients to suppress the
240           auto-cc of:
241
242           ·   author will avoid including the patch author
243
244           ·   self will avoid including the sender
245
246           ·   cc will avoid including anyone mentioned in Cc lines in the
247               patch header except for self (use self for that).
248
249           ·   bodycc will avoid including anyone mentioned in Cc lines in the
250               patch body (commit message) except for self (use self for
251               that).
252
253           ·   sob will avoid including anyone mentioned in Signed-off-by
254               lines except for self (use self for that).
255
256           ·   cccmd will avoid running the --cc-cmd.
257
258           ·   body is equivalent to sob + bodycc
259
260           ·   all will suppress all auto cc values.
261
262           Default is the value of sendemail.suppresscc configuration value;
263           if that is unspecified, default to self if --suppress-from is
264           specified, as well as body if --no-signed-off-cc is specified.
265
266       --[no-]suppress-from
267           If this is set, do not add the From: address to the cc: list.
268           Default is the value of sendemail.suppressfrom configuration value;
269           if that is unspecified, default to --no-suppress-from.
270
271       --[no-]thread
272           If this is set, the In-Reply-To and References headers will be
273           added to each email sent. Whether each mail refers to the previous
274           email (deep threading per git format-patch wording) or to the first
275           email (shallow threading) is governed by "--[no-]chain-reply-to".
276
277           If disabled with "--no-thread", those headers will not be added
278           (unless specified with --in-reply-to). Default is the value of the
279           sendemail.thread configuration value; if that is unspecified,
280           default to --thread.
281
282           It is up to the user to ensure that no In-Reply-To header already
283           exists when git send-email is asked to add it (especially note that
284           git format-patch can be configured to do the threading itself).
285           Failure to do so may not produce the expected result in the
286           recipient’s MUA.
287
288   Administering
289       --confirm=<mode>
290           Confirm just before sending:
291
292           ·   always will always confirm before sending
293
294           ·   never will never confirm before sending
295
296           ·   cc will confirm before sending when send-email has
297               automatically added addresses from the patch to the Cc list
298
299           ·   compose will confirm before sending the first message when
300               using --compose.
301
302           ·   auto is equivalent to cc + compose
303
304           Default is the value of sendemail.confirm configuration value; if
305           that is unspecified, default to auto unless any of the suppress
306           options have been specified, in which case default to compose.
307
308       --dry-run
309           Do everything except actually send the emails.
310
311       --[no-]format-patch
312           When an argument may be understood either as a reference or as a
313           file name, choose to understand it as a format-patch argument
314           (--format-patch) or as a file name (--no-format-patch). By default,
315           when such a conflict occurs, git send-email will fail.
316
317       --quiet
318           Make git-send-email less verbose. One line per email should be all
319           that is output.
320
321       --[no-]validate
322           Perform sanity checks on patches. Currently, validation means the
323           following:
324
325           ·   Warn of patches that contain lines longer than 998 characters;
326               this is due to SMTP limits as described by
327               http://www.ietf.org/rfc/rfc2821.txt.
328
329           Default is the value of sendemail.validate; if this is not set,
330           default to --validate.
331
332       --force
333           Send emails even if safety checks would prevent it.
334

CONFIGURATION

336       sendemail.aliasesfile
337           To avoid typing long email addresses, point this to one or more
338           email aliases files. You must also supply sendemail.aliasfiletype.
339
340       sendemail.aliasfiletype
341           Format of the file(s) specified in sendemail.aliasesfile. Must be
342           one of mutt, mailrc, pine, elm, or gnus.
343
344       sendemail.multiedit
345           If true (default), a single editor instance will be spawned to edit
346           files you have to edit (patches when --annotate is used, and the
347           summary when --compose is used). If false, files will be edited one
348           after the other, spawning a new editor each time.
349
350       sendemail.confirm
351           Sets the default for whether to confirm before sending. Must be one
352           of always, never, cc, compose, or auto. See --confirm in the
353           previous section for the meaning of these values.
354

EXAMPLE

356   Use gmail as the smtp server
357       To use git send-email to send your patches through the GMail SMTP
358       server, edit ~/.gitconfig to specify your account settings:
359
360           [sendemail]
361                   smtpencryption = tls
362                   smtpserver = smtp.gmail.com
363                   smtpuser = yourname@gmail.com
364                   smtpserverport = 587
365
366       Once your commits are ready to be sent to the mailing list, run the
367       following commands:
368
369           $ git format-patch --cover-letter -M origin/master -o outgoing/
370           $ edit outgoing/0000-*
371           $ git send-email outgoing/*
372
373       Note: the following perl modules are required Net::SMTP::SSL,
374       MIME::Base64 and Authen::SASL
375

SEE ALSO

377       git-format-patch(1), git-imap-send(1), mbox(5)
378

GIT

380       Part of the git(1) suite
381
382
383
384Git 1.8.3.1                       11/19/2018                 GIT-SEND-EMAIL(1)
Impressum