interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / Documentation / git-send-email.adoc

726 lines · 29117 bytes Raw Blame History
1git-send-email(1)
2=================
3
4NAME
5----
6git-send-email - Send a collection of patches as emails
7
8
9SYNOPSIS
10--------
11[synopsis]
12git send-email [<options>] (<file>|<directory>)...
13git send-email [<options>] <format-patch-options>
14git send-email --dump-aliases
15git send-email --translate-aliases
16
17
18DESCRIPTION
19-----------
20Takes the patches given on the command line and emails them out.
21Patches can be specified as files, directories (which will send all
22files in the directory), or directly as a revision list. In the
23last case, any format accepted by linkgit:git-format-patch[1] can
24be passed to `git send-email`, as well as options understood by
25linkgit:git-format-patch[1].
26
27The header of the email is configurable via command-line options. If not
28specified on the command line, the user will be prompted with a ReadLine
29enabled interface to provide the necessary information.
30
31There are two formats accepted for patch files:
32
331. mbox format files
34+
35This is what linkgit:git-format-patch[1] generates. Most headers and MIME
36formatting are ignored.
37
382. The original format used by Greg Kroah-Hartman's `send_lots_of_email.pl`
39 script
40+
41This format expects the first line of the file to contain the `Cc:` value
42and the `Subject:` of the message as the second line.
43
44
45OPTIONS
46-------
47
48Composing
49~~~~~~~~~
50
51`--annotate`::
52 Review and edit each patch you're about to send. Default is the value
53 of `sendemail.annotate`. See the <<CONFIGURATION,CONFIGURATION>> section for
54 `sendemail.multiEdit`.
55
56`--bcc=<address>,...`::
57 Specify a `Bcc:` value for each email. Default is the value of
58 `sendemail.bcc`.
59+
60This option may be specified multiple times.
61
62`--cc=<address>,...`::
63 Specify a starting `Cc:` value for each email.
64 Default is the value of `sendemail.cc`.
65+
66This option may be specified multiple times.
67
68`--compose`::
69 Invoke a text editor (see GIT_EDITOR in linkgit:git-var[1])
70 to edit an introductory message for the patch series.
71+
72When `--compose` is used, `git send-email` will use the `From`, `To`, `Cc`,
73`Bcc`, `Subject`, `Reply-To`, and `In-Reply-To` headers specified in the
74message. If the body of the message (what you type after the headers and a
75blank line) only contains blank (or `Git:` prefixed) lines, the summary won't be
76sent, but the headers mentioned above will be used unless they are
77removed.
78+
79Missing `From` or `In-Reply-To` headers will be prompted for.
80+
81See the <<CONFIGURATION,CONFIGURATION>> section for `sendemail.multiEdit`.
82
83`--from=<address>`::
84 Specify the sender of the emails. If not specified on the command line,
85 the value of the `sendemail.from` configuration option is used. If
86 neither the command-line option nor `sendemail.from` are set, then the
87 user will be prompted for the value. The default for the prompt will be
88 the value of `GIT_AUTHOR_IDENT`, or `GIT_COMMITTER_IDENT` if that is not
89 set, as returned by `git var -l`.
90
91`--reply-to=<address>`::
92 Specify the address where replies from recipients should go to.
93 Use this if replies to messages should go to another address than what
94 is specified with the `--from` parameter.
95
96`--in-reply-to=<identifier>`::
97 Make the first mail (or all the mails with `--no-thread`) appear as a
98 reply to the given Message-ID, which avoids breaking threads to
99 provide a new patch series.
100 The second and subsequent emails will be sent as replies according to
101 the `--[no-]chain-reply-to` setting.
102+
103So for example when `--thread` and `--no-chain-reply-to` are specified, the
104second and subsequent patches will be replies to the first one like in the
105illustration below where `[PATCH v2 0/3]` is in reply to `[PATCH 0/2]`:
106+
107 [PATCH 0/2] Here is what I did...
108 [PATCH 1/2] Clean up and tests
109 [PATCH 2/2] Implementation
110 [PATCH v2 0/3] Here is a reroll
111 [PATCH v2 1/3] Clean up
112 [PATCH v2 2/3] New tests
113 [PATCH v2 3/3] Implementation
114+
115Only necessary if `--compose` is also set. If `--compose`
116is not set, this will be prompted for.
117
118`--outlook-id-fix`::
119`--no-outlook-id-fix`::
120 Microsoft Outlook SMTP servers discard the Message-ID sent via email and
121 assign a new random Message-ID, thus breaking threads.
122+
123With `--outlook-id-fix`, `git send-email` uses a mechanism specific to
124Outlook servers to learn the Message-ID the server assigned to fix the
125threading. Use it only when you know that the server reports the
126rewritten Message-ID the same way as Outlook servers do.
127+
128Without this option specified, the fix is done by default when talking
129to `smtp.office365.com` or `smtp-mail.outlook.com`. Use
130`--no-outlook-id-fix` to disable even when talking to these two servers.
131
132`--subject=<string>`::
133 Specify the initial subject of the email thread.
134 Only necessary if `--compose` is also set. If `--compose`
135 is not set, this will be prompted for.
136
137`--to=<address>,...`::
138 Specify the primary recipient of the emails generated. Generally, this
139 will be the upstream maintainer of the project involved. Default is the
140 value of the `sendemail.to` configuration value; if that is unspecified,
141 and `--to-cmd` is not specified, this will be prompted for.
142+
143This option may be specified multiple times.
144
145`--8bit-encoding=<encoding>`::
146 When encountering a non-ASCII message or subject that does not
147 declare its encoding, add headers/quoting to indicate it is
148 encoded in _<encoding>_. Default is the value of the
149 `sendemail.assume8bitEncoding`; if that is unspecified, this
150 will be prompted for if any non-ASCII files are encountered.
151+
152Note that no attempts whatsoever are made to validate the encoding.
153
154`--compose-encoding=<encoding>`::
155 Specify encoding of compose message. Default is the value of the
156 `sendemail.composeEncoding`; if that is unspecified, UTF-8 is assumed.
157
158`--transfer-encoding=(7bit|8bit|quoted-printable|base64|auto)`::
159 Specify the transfer encoding to be used to send the message over SMTP.
160 `7bit` will fail upon encountering a non-ASCII message. `quoted-printable`
161 can be useful when the repository contains files that contain carriage
162 returns, but makes the raw patch email file (as saved from an MUA) much
163 harder to inspect manually. `base64` is even more fool proof, but also
164 even more opaque. `auto` will use `8bit` when possible, and
165 `quoted-printable` otherwise.
166+
167Default is the value of the `sendemail.transferEncoding` configuration
168value; if that is unspecified, default to `auto`.
169
170`--xmailer`::
171`--no-xmailer`::
172 Add (or prevent adding) the `X-Mailer:` header. By default,
173 the header is added, but it can be turned off by setting the
174 `sendemail.xmailer` configuration variable to `false`.
175
176Sending
177~~~~~~~
178
179`--envelope-sender=<address>`::
180 Specify the envelope sender used to send the emails.
181 This is useful if your default address is not the address that is
182 subscribed to a list. In order to use the `From` address, set the
183 value to `auto`. If you use the `sendmail` binary, you must have
184 suitable privileges for the `-f` parameter. Default is the value of the
185 `sendemail.envelopeSender` configuration variable; if that is
186 unspecified, choosing the envelope sender is left to your MTA.
187
188`--sendmail-cmd=<command>`::
189 Specify a command to run to send the email. The command should
190 be sendmail-like; specifically, it must support the `-i` option.
191 The command will be executed in the shell if necessary. Default
192 is the value of `sendemail.sendmailCmd`. If unspecified, and if
193 `--smtp-server` is also unspecified, `git send-email` will search
194 for `sendmail` in `/usr/sbin`, `/usr/lib` and `$PATH`.
195
196`--smtp-encryption=<encryption>`::
197 Specify in what way encrypting begins for the SMTP connection.
198 Valid values are `ssl` and `tls`. Any other value reverts to plain
199 (unencrypted) SMTP, which defaults to port 25.
200 Despite the names, both values will use the same newer version of TLS,
201 but for historic reasons have these names. `ssl` refers to "implicit"
202 encryption (sometimes called SMTPS), that uses port 465 by default.
203 `tls` refers to "explicit" encryption (often known as STARTTLS),
204 that uses port 25 by default. Other ports might be used by the SMTP
205 server, which are not the default. Commonly found alternative port for
206 `tls` and unencrypted is 587. You need to check your provider's
207 documentation or your server configuration to make sure
208 for your own case. Default is the value of `sendemail.smtpEncryption`.
209
210`--smtp-domain=<FQDN>`::
211 Specify the Fully Qualified Domain Name (FQDN) used in the
212 HELO/EHLO command to the SMTP server. Some servers require the
213 FQDN to match your IP address. If not set, `git send-email` attempts
214 to determine your FQDN automatically. Default is the value of
215 `sendemail.smtpDomain`.
216
217`--smtp-auth=<mechanisms>`::
218 Whitespace-separated list of allowed SMTP-AUTH mechanisms. This setting
219 forces using only the listed mechanisms. Example:
220+
221------
222$ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ...
223------
224+
225If at least one of the specified mechanisms matches the ones advertised by the
226SMTP server and if it is supported by the utilized SASL library, the mechanism
227is used for authentication. If neither `sendemail.smtpAuth` nor `--smtp-auth`
228is specified, all mechanisms supported by the SASL library can be used. The
229special value `none` maybe specified to completely disable authentication
230independently of `--smtp-user`.
231
232`--smtp-pass[=<password>]`::
233 Password for SMTP-AUTH. The argument is optional: If no
234 argument is specified, then the empty string is used as
235 the password. Default is the value of `sendemail.smtpPass`,
236 however `--smtp-pass` always overrides this value.
237+
238Furthermore, passwords need not be specified in configuration files
239or on the command line. If a username has been specified (with
240`--smtp-user` or a `sendemail.smtpUser`), but no password has been
241specified (with `--smtp-pass` or `sendemail.smtpPass`), then
242a password is obtained using linkgit:git-credential[1].
243
244`--no-smtp-auth`::
245 Disable SMTP authentication. Short hand for `--smtp-auth=none`.
246
247`--smtp-server=<host>`::
248 Specify the outgoing SMTP server to use (e.g.
249 `smtp.example.com` or a raw IP address). If unspecified, and if
250 `--sendmail-cmd` is also unspecified, the default is to search
251 for `sendmail` in `/usr/sbin`, `/usr/lib` and `$PATH` if such a
252 program is available, falling back to `localhost` otherwise.
253+
254For backward compatibility, this option can also specify a full pathname
255of a sendmail-like program instead; the program must support the `-i`
256option. This method does not support passing arguments or using plain
257command names. For those use cases, consider using `--sendmail-cmd`
258instead.
259
260`--smtp-server-port=<port>`::
261 Specify a port different from the default port (SMTP
262 servers typically listen to smtp port 25, but may also listen to
263 submission port 587, or the common SSL smtp port 465);
264 symbolic port names (e.g. `submission` instead of 587)
265 are also accepted. The port can also be set with the
266 `sendemail.smtpServerPort` configuration variable.
267
268`--smtp-server-option=<option>`::
269 Specify the outgoing SMTP server option to use.
270 Default value can be specified by the `sendemail.smtpServerOption`
271 configuration option.
272+
273The `--smtp-server-option` option must be repeated for each option you want
274to pass to the server. Likewise, different lines in the configuration files
275must be used for each option.
276
277`--smtp-ssl`::
278 Legacy alias for `--smtp-encryption ssl`.
279
280`--smtp-ssl-cert-path <path>`::
281 Path to a store of trusted CA certificates for SMTP SSL/TLS
282 certificate validation (either a directory that has been processed
283 by `c_rehash`, or a single file containing one or more PEM format
284 certificates concatenated together: see the description of the
285 `-CAfile <file>` and the `-CApath <dir>` options of
286 https://docs.openssl.org/master/man1/openssl-verify/
287 [OpenSSL's verify(1) manual page] for more information on these).
288 Set it to an empty string to disable certificate verification.
289 Defaults to the value of the `sendemail.smtpSSLCertPath` configuration
290 variable, if set, or the backing SSL library's compiled-in default
291 otherwise (which should be the best choice on most platforms).
292
293`--smtp-ssl-client-cert <path>`::
294 Path to the client certificate file to present if requested by the
295 server. This option is required when the server is set up to verify
296 client certificates. If the corresponding private key is not included in
297 the file, it must be supplied using the `sendemail.smtpSSLClientKey`
298 configuration variable or the `--smtp-ssl-client-key` option. Defaults
299 to the value of the `sendemail.smtpSSLClientCert` configuration
300 variable, if set.
301
302`--smtp-ssl-client-key <path>`::
303 Path to the client private key file that corresponds to the client
304 certificate. To avoid misconfiguration, this option must be used in
305 conjunction with the `sendemail.smtpSSLClientKey` configuration variable
306 or the `--smtp-ssl-client-cert` option. If the client key is included in
307 the client certificate, the choice of private key depends on the format
308 of the certificate. Visit https://metacpan.org/pod/IO::Socket::SSL for
309 more details. Defaults to the value of the `sendemail.smtpSSLClientKey`
310 configuration variable, if set.
311
312`--smtp-user=<user>`::
313 Username for SMTP-AUTH. Default is the value of `sendemail.smtpUser`;
314 if a username is not specified (with `--smtp-user` or `sendemail.smtpUser`),
315 then authentication is not attempted.
316
317`--smtp-debug=(0|1)`::
318 Enable (1) or disable (0) debug output. If enabled, SMTP
319 commands and replies will be printed. Useful to debug TLS
320 connection and authentication problems.
321
322`--imap-sent-folder=<folder>`::
323 Some email providers (e.g. iCloud) do not send a copy of the emails sent
324 using SMTP to the `Sent` folder or similar in your mailbox. Use this option
325 to use `git imap-send` to send a copy of the emails to the folder specified
326 using this option. You can run `git imap-send --list` to get a list of
327 valid folder names, including the correct name of the `Sent` folder in
328 your mailbox. You can also use this option to send emails to a dedicated
329 IMAP folder of your choice.
330+
331This feature requires setting up `git imap-send`. See linkgit:git-imap-send[1]
332for instructions.
333
334`--use-imap-only`::
335`--no-use-imap-only`::
336 If this is set, all emails will only be copied to the IMAP folder specified
337 with `--imap-sent-folder` or `sendemail.imapSentFolder` and will not be sent
338 to the recipients. Useful if you just want to create a draft of the emails
339 and use another email client to send them.
340 If disabled with `--no-use-imap-only`, the emails will be sent like usual.
341 Disabled by default, but the `sendemail.useImapOnly` configuration
342 variable can be used to enable it.
343+
344This feature requires setting up `git imap-send`. See linkgit:git-imap-send[1]
345for instructions.
346
347`--batch-size=<num>`::
348 Some email servers (e.g. `smtp.163.com`) limit the number of emails to be
349 sent per session (connection) and this will lead to a failure when
350 sending many messages. With this option, send-email will disconnect after
351 sending _<num>_ messages and wait for a few seconds
352 (see `--relogin-delay`) and reconnect, to work around such a limit.
353 You may want to use some form of credential helper to avoid having to
354 retype your password every time this happens. Defaults to the
355 `sendemail.smtpBatchSize` configuration variable.
356
357`--relogin-delay=<int>`::
358 Waiting _<int>_ seconds before reconnecting to SMTP server. Used together
359 with `--batch-size` option. Defaults to the `sendemail.smtpReloginDelay`
360 configuration variable.
361
362Automating
363~~~~~~~~~~
364
365`--no-to`::
366`--no-cc`::
367`--no-bcc`::
368 Clear any list of `To:`, `Cc:`, `Bcc:` addresses previously
369 set via config.
370
371`--no-identity`::
372 Clear the previously read value of `sendemail.identity` set
373 via config, if any.
374
375`--to-cmd=<command>`::
376 Specify a command to execute once per patch file which
377 should generate patch file specific `To:` entries.
378 Output of this command must be single email address per line.
379 Default is the value of `sendemail.toCmd` configuration value.
380
381`--cc-cmd=<command>`::
382 Specify a command to execute once per patch file which
383 should generate patch file specific `Cc:` entries.
384 Output of this command must be single email address per line.
385 Default is the value of `sendemail.ccCmd` configuration value.
386
387`--header-cmd=<command>`::
388 Specify a command that is executed once per outgoing message
389 and output RFC 2822 style header lines to be inserted into
390 them. When the `sendemail.headerCmd` configuration variable is
391 set, its value is always used. When `--header-cmd` is provided
392 at the command line, its value takes precedence over the
393 `sendemail.headerCmd` configuration variable.
394
395`--no-header-cmd`::
396 Disable any header command in use.
397
398`--chain-reply-to`::
399`--no-chain-reply-to`::
400 If this is set, each email will be sent as a reply to the previous
401 email sent. If disabled with `--no-chain-reply-to`, all emails after
402 the first will be sent as replies to the first email sent. When using
403 this, it is recommended that the first file given be an overview of the
404 entire patch series. Disabled by default, but the `sendemail.chainReplyTo`
405 configuration variable can be used to enable it.
406
407`--identity=<identity>`::
408 A configuration identity. When given, causes values in the
409 `sendemail.<identity>` subsection to take precedence over
410 values in the `sendemail` section. The default identity is
411 the value of `sendemail.identity`.
412
413`--signed-off-by-cc`::
414`--no-signed-off-by-cc`::
415 If this is set, add emails found in the `Signed-off-by` trailer or `Cc:`
416 lines to the cc list. Default is the value of `sendemail.signedOffByCc`
417 configuration value; if that is unspecified, default to
418 `--signed-off-by-cc`.
419
420`--cc-cover`::
421`--no-cc-cover`::
422 If this is set, emails found in `Cc:` headers in the first patch of
423 the series (typically the cover letter) are added to the cc list
424 for each email set. Default is the value of `sendemail.ccCover`
425 configuration value; if that is unspecified, default to `--no-cc-cover`.
426
427`--to-cover`::
428`--no-to-cover`::
429 If this is set, emails found in `To:` headers in the first patch of
430 the series (typically the cover letter) are added to the to list
431 for each email set. Default is the value of `sendemail.toCover`
432 configuration value; if that is unspecified, default to `--no-to-cover`.
433
434`--suppress-cc=<category>`::
435 Specify an additional category of recipients to suppress the
436 auto-cc of:
437+
438--
439- `author` will avoid including the patch author.
440- `self` will avoid including the sender.
441- `cc` will avoid including anyone mentioned in Cc lines in the patch header
442 except for self (use `self` for that).
443- `bodycc` will avoid including anyone mentioned in Cc lines in the
444 patch body (commit message) except for self (use `self` for that).
445- `sob` will avoid including anyone mentioned in the Signed-off-by trailers except
446 for self (use `self` for that).
447- `misc-by` will avoid including anyone mentioned in Acked-by,
448 Reviewed-by, Tested-by and other "-by" lines in the patch body,
449 except Signed-off-by (use `sob` for that).
450- `cccmd` will avoid running the --cc-cmd.
451- `body` is equivalent to `sob` + `bodycc` + `misc-by`.
452- `all` will suppress all auto cc values.
453--
454+
455Default is the value of `sendemail.suppressCc` configuration value; if
456that is unspecified, default to `self` if `--suppress-from` is
457specified, as well as `body` if `--no-signed-off-by-cc` is specified.
458
459`--suppress-from`::
460`--no-suppress-from`::
461 If this is set, do not add the `From:` address to the `Cc:` list.
462 Default is the value of `sendemail.suppressFrom` configuration
463 value; if that is unspecified, default to `--no-suppress-from`.
464
465`--thread`::
466`--no-thread`::
467 If this is set, the `In-Reply-To` and `References` headers will be
468 added to each email sent. Whether each mail refers to the
469 previous email (`deep` threading per `git format-patch`
470 wording) or to the first email (`shallow` threading) is
471 governed by `--[no-]chain-reply-to`.
472+
473If disabled with `--no-thread`, those headers will not be added
474(unless specified with `--in-reply-to`). Default is the value of the
475`sendemail.thread` configuration value; if that is unspecified,
476default to `--thread`.
477+
478It is up to the user to ensure that no In-Reply-To header already
479exists when `git send-email` is asked to add it (especially note that
480`git format-patch` can be configured to do the threading itself).
481Failure to do so may not produce the expected result in the
482recipient's MUA.
483
484`--mailmap`::
485`--no-mailmap`::
486 Use the mailmap file (see linkgit:gitmailmap[5]) to map all
487 addresses to their canonical real name and email address. Additional
488 mailmap data specific to `git send-email` may be provided using the
489 `sendemail.mailmap.file` or `sendemail.mailmap.blob` configuration
490 values. Defaults to `sendemail.mailmap`.
491
492Administering
493~~~~~~~~~~~~~
494
495`--confirm=<mode>`::
496 Confirm just before sending:
497+
498--
499- `always` will always confirm before sending.
500- `never` will never confirm before sending.
501- `cc` will confirm before sending when send-email has automatically
502 added addresses from the patch to the Cc list.
503- `compose` will confirm before sending the first message when using --compose.
504- `auto` is equivalent to `cc` + `compose`.
505--
506+
507Default is the value of `sendemail.confirm` configuration value; if that
508is unspecified, default to `auto` unless any of the suppress options
509have been specified, in which case default to `compose`.
510
511`--dry-run`::
512 Do everything except actually send the emails.
513
514`--format-patch`::
515`--no-format-patch`::
516 When an argument may be understood either as a reference or as a file name,
517 choose to understand it as a format-patch argument (`--format-patch`)
518 or as a file name (`--no-format-patch`). By default, when such a conflict
519 occurs, `git send-email` will fail.
520
521`--quiet`::
522 Make `git send-email` less verbose. One line per email should be
523 all that is output.
524
525`--validate`::
526`--no-validate`::
527 Perform sanity checks on patches.
528 Currently, validation means the following:
529+
530--
531* Invoke the sendemail-validate hook if present (see linkgit:githooks[5]).
532* Warn of patches that contain lines longer than
533 998 characters unless a suitable transfer encoding
534 (`auto`, `base64`, or `quoted-printable`) is used;
535 this is due to SMTP limits as described by
536 https://www.ietf.org/rfc/rfc5322.txt.
537--
538+
539Default is the value of `sendemail.validate`; if this is not set,
540default to `--validate`.
541
542`--force`::
543 Send emails even if safety checks would prevent it.
544
545
546Information
547~~~~~~~~~~~
548
549`--dump-aliases`::
550 Instead of the normal operation, dump the shorthand alias names from
551 the configured alias file(s), one per line in alphabetical order. Note
552 that this only includes the alias name and not its expanded email addresses.
553 See `sendemail.aliasesFile` for more information about aliases.
554
555`--translate-aliases`::
556 Instead of the normal operation, read from standard input and
557 interpret each line as an email alias. Translate it according to the
558 configured alias file(s). Output each translated name and email
559 address to standard output, one per line. See `sendemail.aliasFile`
560 for more information about aliases.
561
562[[CONFIGURATION]]
563CONFIGURATION
564-------------
565
566include::includes/cmd-config-section-all.adoc[]
567
568include::config/sendemail.adoc[]
569
570EXAMPLES OF SMTP SERVERS
571------------------------
572Use Gmail as the SMTP Server
573~~~~~~~~~~~~~~~~~~~~~~~~~~~~
574To use `git send-email` to send your patches through the Gmail SMTP server,
575edit `~/.gitconfig` to specify your account settings:
576
577----
578[sendemail]
579 smtpEncryption = ssl
580 smtpServer = smtp.gmail.com
581 smtpUser = yourname@gmail.com
582 smtpServerPort = 465
583----
584
585Gmail does not allow using your regular password for `git send-email`.
586If you have multi-factor authentication set up on your Gmail account, you can
587generate an app-specific password for use with `git send-email`. Visit
588https://security.google.com/settings/security/apppasswords to create it.
589
590Alternatively, instead of using an app-specific password, you can use
591OAuth2.0 authentication with Gmail. OAuth2.0 is more secure than
592app-specific passwords, and works regardless of whether you have multi-factor
593authentication set up. `OAUTHBEARER` and `XOAUTH2` are common mechanisms used
594for this type of authentication. Gmail supports both of them. As an example,
595if you want to use `OAUTHBEARER`, edit your `~/.gitconfig` file and add
596`smtpAuth = OAUTHBEARER` to your account settings:
597
598----
599[sendemail]
600 smtpEncryption = ssl
601 smtpServer = smtp.gmail.com
602 smtpUser = yourname@gmail.com
603 smtpServerPort = 465
604 smtpAuth = OAUTHBEARER
605----
606
607Another alternative is using a tool developed by Google known as
608https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail[sendgmail]
609to send emails using `git send-email`.
610
611Use Microsoft Outlook as the SMTP Server
612~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
613Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords.
614Therefore, OAuth2.0 authentication must be used for Outlook. Also, it only
615supports `XOAUTH2` authentication mechanism.
616
617Edit `~/.gitconfig` to specify your account settings for Outlook and use its
618SMTP server with `git send-email`:
619
620----
621[sendemail]
622 smtpEncryption = tls
623 smtpServer = smtp.office365.com
624 smtpUser = yourname@outlook.com
625 smtpServerPort = 587
626 smtpAuth = XOAUTH2
627----
628
629SENDING PATCHES
630---------------
631Once your commits are ready to be sent to the mailing list, run the
632following commands:
633
634 $ git format-patch --cover-letter -M origin/master -o outgoing/
635 $ edit outgoing/0000-*
636 $ git send-email outgoing/*
637
638The first time you run it, you will be prompted for your credentials. Enter the
639app-specific or your regular password as appropriate.
640
641If you have a credential helper configured (see linkgit:git-credential[1]), the
642password will be saved in the credential store so you won't have to type it the
643next time.
644
645If you are using OAuth2.0 authentication, you need to use an access token in
646place of a password when prompted. Various OAuth2.0 token generators are
647available online. Community maintained credential helpers are also available:
648
649 - https://github.com/AdityaGarg8/git-credential-email[git-credential-gmail]
650 (cross platform, dedicated helper for authenticating Gmail accounts)
651
652 - https://github.com/AdityaGarg8/git-credential-email[git-credential-outlook]
653 (cross platform, dedicated helper for authenticating Microsoft Outlook accounts)
654
655 - https://github.com/AdityaGarg8/git-credential-email[git-credential-yahoo]
656 (cross platform, dedicated helper for authenticating Yahoo accounts)
657
658 - https://github.com/AdityaGarg8/git-credential-email[git-credential-aol]
659 (cross platform, dedicated helper for authenticating AOL accounts)
660
661You can also see linkgit:gitcredentials[7] for more OAuth based authentication
662helpers.
663
664Proton Mail does not provide an SMTP server to send emails. If you are a paid
665customer of Proton Mail, you can use
666https://proton.me/mail/bridge[Proton Mail Bridge]
667officially provided by Proton Mail to create a local SMTP server for sending
668emails. For both free and paid users, community maintained projects like
669https://github.com/AdityaGarg8/git-credential-email[git-protonmail] can be
670used.
671
672Note: the following core Perl modules that may be installed with your
673distribution of Perl are required:
674
675https://metacpan.org/pod/MIME::Base64[MIME::Base64],
676https://metacpan.org/pod/MIME::QuotedPrint[MIME::QuotedPrint],
677https://metacpan.org/pod/Net::Domain[Net::Domain] and
678https://metacpan.org/pod/Net::SMTP[Net::SMTP].
679
680These additional Perl modules are also required:
681
682https://metacpan.org/pod/Authen::SASL[Authen::SASL] and
683https://metacpan.org/pod/Mail::Address[Mail::Address].
684
685Exploiting the `sendmailCmd` option of `git send-email`
686~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
687
688Apart from sending emails via an SMTP server, `git send-email` can also send
689emails through any application that supports sendmail-like commands. You can
690read documentation of `--sendmail-cmd=<command>` above for more information.
691This ability can be very useful if you want to use another application as an
692SMTP client for `git send-email`, or if your email provider uses proprietary
693APIs instead of SMTP to send emails.
694
695As an example, lets see how to configure https://marlam.de/msmtp/[msmtp], a
696popular SMTP client found in many Linux distributions. Edit `~/.gitconfig`
697to instruct `git-send-email` to use it for sending emails.
698
699----
700[sendemail]
701 sendmailCmd = /usr/bin/msmtp # Change this to the path where msmtp is installed
702----
703
704Links of a few such community maintained helpers are:
705
706 - https://marlam.de/msmtp/[msmtp]
707 (popular SMTP client with many features, available for Linux and macOS)
708
709 - https://github.com/AdityaGarg8/git-credential-email[git-protonmail]
710 (cross platform client that can send emails using the ProtonMail API)
711
712 - https://github.com/AdityaGarg8/git-credential-email[git-msgraph]
713 (cross platform client that can send emails using the Microsoft Graph API)
714
715CAVEATS
716-------
717
718include::format-patch-caveats.adoc[]
719
720SEE ALSO
721--------
722linkgit:git-format-patch[1], linkgit:git-imap-send[1], `mbox`(5)
723
724GIT
725---
726Part of the linkgit:git[1] suite