Raw
1 git-send-email(1)
2 =================
3
4 NAME
5 ----
6 git-send-email - Send a collection of patches as emails
7
8
9 SYNOPSIS
10 --------
11 [verse]
12 'git send-email' [<options>] (<file>|<directory>)...
13 'git send-email' [<options>] <format-patch-options>
14 'git send-email' --dump-aliases
15 'git send-email' --translate-aliases
16
17
18 DESCRIPTION
19 -----------
20 Takes the patches given on the command line and emails them out.
21 Patches can be specified as files, directories (which will send all
22 files in the directory), or directly as a revision list. In the
23 last case, any format accepted by linkgit:git-format-patch[1] can
24 be passed to `git send-email`, as well as options understood by
25 linkgit:git-format-patch[1].
26
27 The header of the email is configurable via command-line options. If not
28 specified on the command line, the user will be prompted with a ReadLine
29 enabled interface to provide the necessary information.
30
31 There are two formats accepted for patch files:
32
33 1. mbox format files
34 +
35 This is what linkgit:git-format-patch[1] generates. Most headers and MIME
36 formatting are ignored.
37
38 2. The original format used by Greg Kroah-Hartman's `send_lots_of_email.pl`
39 script
40 +
41 This format expects the first line of the file to contain the `Cc:` value
42 and the `Subject:` of the message as the second line.
43
44
45 OPTIONS
46 -------
47
48 Composing
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 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 +
60 This 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 +
66 This 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 +
72 When `--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
74 message. If the body of the message (what you type after the headers and a
75 blank line) only contains blank (or `Git:` prefixed) lines, the summary won't be
76 sent, but the headers mentioned above will be used unless they are
77 removed.
78 +
79 Missing `From` or `In-Reply-To` headers will be prompted for.
80 +
81 See the 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 +
103 So for example when `--thread` and `--no-chain-reply-to` are specified, the
104 second and subsequent patches will be replies to the first one like in the
105 illustration 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 +
115 Only necessary if `--compose` is also set. If `--compose`
116 is 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 +
123 With `--outlook-id-fix`, `git send-email` uses a mechanism specific to
124 Outlook servers to learn the Message-ID the server assigned to fix the
125 threading. Use it only when you know that the server reports the
126 rewritten Message-ID the same way as Outlook servers do.
127 +
128 Without this option specified, the fix is done by default when talking
129 to '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 +
143 This 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 +
152 Note 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 +
167 Default is the value of the `sendemail.transferEncoding` configuration
168 value; 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
176 Sending
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 +
225 If at least one of the specified mechanisms matches the ones advertised by the
226 SMTP server and if it is supported by the utilized SASL library, the mechanism
227 is used for authentication. If neither `sendemail.smtpAuth` nor `--smtp-auth`
228 is specified, all mechanisms supported by the SASL library can be used. The
229 special value `none` maybe specified to completely disable authentication
230 independently 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 +
238 Furthermore, passwords need not be specified in configuration files
239 or on the command line. If a username has been specified (with
240 `--smtp-user` or a `sendemail.smtpUser`), but no password has been
241 specified (with `--smtp-pass` or `sendemail.smtpPass`), then
242 a 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 +
254 For backward compatibility, this option can also specify a full pathname
255 of a sendmail-like program instead; the program must support the `-i`
256 option. This method does not support passing arguments or using plain
257 command names. For those use cases, consider using `--sendmail-cmd`
258 instead.
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 +
273 The `--smtp-server-option` option must be repeated for each option you want
274 to pass to the server. Likewise, different lines in the configuration files
275 must 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 +
331 This feature requires setting up `git imap-send`. See linkgit:git-imap-send[1]
332 for 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 +
344 This feature requires setting up `git imap-send`. See linkgit:git-imap-send[1]
345 for 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
362 Automating
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 +
455 Default is the value of `sendemail.suppressCc` configuration value; if
456 that is unspecified, default to `self` if `--suppress-from` is
457 specified, 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 +
473 If 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,
476 default to `--thread`.
477 +
478 It is up to the user to ensure that no In-Reply-To header already
479 exists when `git send-email` is asked to add it (especially note that
480 `git format-patch` can be configured to do the threading itself).
481 Failure to do so may not produce the expected result in the
482 recipient'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
492 Administering
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 +
507 Default is the value of `sendemail.confirm` configuration value; if that
508 is unspecified, default to `auto` unless any of the suppress options
509 have 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 +
539 Default is the value of `sendemail.validate`; if this is not set,
540 default to `--validate`.
541
542 --force::
543 Send emails even if safety checks would prevent it.
544
545
546 Information
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
563 -------------
564
565 include::includes/cmd-config-section-all.adoc[]
566
567 include::config/sendemail.adoc[]
568
569 EXAMPLES OF SMTP SERVERS
570 ------------------------
571 Use Gmail as the SMTP Server
572 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
573 To use `git send-email` to send your patches through the Gmail SMTP server,
574 edit `~/.gitconfig` to specify your account settings:
575
576 ----
577 [sendemail]
578 smtpEncryption = ssl
579 smtpServer = smtp.gmail.com
580 smtpUser = yourname@gmail.com
581 smtpServerPort = 465
582 ----
583
584 Gmail does not allow using your regular password for `git send-email`.
585 If you have multi-factor authentication set up on your Gmail account, you can
586 generate an app-specific password for use with `git send-email`. Visit
587 https://security.google.com/settings/security/apppasswords to create it.
588
589 Alternatively, instead of using an app-specific password, you can use
590 OAuth2.0 authentication with Gmail. OAuth2.0 is more secure than
591 app-specific passwords, and works regardless of whether you have multi-factor
592 authentication set up. `OAUTHBEARER` and `XOAUTH2` are common mechanisms used
593 for this type of authentication. Gmail supports both of them. As an example,
594 if you want to use `OAUTHBEARER`, edit your `~/.gitconfig` file and add
595 `smtpAuth = OAUTHBEARER` to your account settings:
596
597 ----
598 [sendemail]
599 smtpEncryption = ssl
600 smtpServer = smtp.gmail.com
601 smtpUser = yourname@gmail.com
602 smtpServerPort = 465
603 smtpAuth = OAUTHBEARER
604 ----
605
606 Another alternative is using a tool developed by Google known as
607 https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail[sendgmail]
608 to send emails using `git send-email`.
609
610 Use Microsoft Outlook as the SMTP Server
611 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
612 Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords.
613 Therefore, OAuth2.0 authentication must be used for Outlook. Also, it only
614 supports `XOAUTH2` authentication mechanism.
615
616 Edit `~/.gitconfig` to specify your account settings for Outlook and use its
617 SMTP server with `git send-email`:
618
619 ----
620 [sendemail]
621 smtpEncryption = tls
622 smtpServer = smtp.office365.com
623 smtpUser = yourname@outlook.com
624 smtpServerPort = 587
625 smtpAuth = XOAUTH2
626 ----
627
628 SENDING PATCHES
629 ---------------
630 Once your commits are ready to be sent to the mailing list, run the
631 following commands:
632
633 $ git format-patch --cover-letter -M origin/master -o outgoing/
634 $ edit outgoing/0000-*
635 $ git send-email outgoing/*
636
637 The first time you run it, you will be prompted for your credentials. Enter the
638 app-specific or your regular password as appropriate.
639
640 If you have a credential helper configured (see linkgit:git-credential[1]), the
641 password will be saved in the credential store so you won't have to type it the
642 next time.
643
644 If you are using OAuth2.0 authentication, you need to use an access token in
645 place of a password when prompted. Various OAuth2.0 token generators are
646 available online. Community maintained credential helpers are also available:
647
648 - https://github.com/AdityaGarg8/git-credential-email[git-credential-gmail]
649 (cross platform, dedicated helper for authenticating Gmail accounts)
650
651 - https://github.com/AdityaGarg8/git-credential-email[git-credential-outlook]
652 (cross platform, dedicated helper for authenticating Microsoft Outlook accounts)
653
654 - https://github.com/AdityaGarg8/git-credential-email[git-credential-yahoo]
655 (cross platform, dedicated helper for authenticating Yahoo accounts)
656
657 - https://github.com/AdityaGarg8/git-credential-email[git-credential-aol]
658 (cross platform, dedicated helper for authenticating AOL accounts)
659
660 You can also see linkgit:gitcredentials[7] for more OAuth based authentication
661 helpers.
662
663 Proton Mail does not provide an SMTP server to send emails. If you are a paid
664 customer of Proton Mail, you can use
665 https://proton.me/mail/bridge[Proton Mail Bridge]
666 officially provided by Proton Mail to create a local SMTP server for sending
667 emails. For both free and paid users, community maintained projects like
668 https://github.com/AdityaGarg8/git-credential-email[git-protonmail] can be
669 used.
670
671 Note: the following core Perl modules that may be installed with your
672 distribution of Perl are required:
673
674 https://metacpan.org/pod/MIME::Base64[MIME::Base64],
675 https://metacpan.org/pod/MIME::QuotedPrint[MIME::QuotedPrint],
676 https://metacpan.org/pod/Net::Domain[Net::Domain] and
677 https://metacpan.org/pod/Net::SMTP[Net::SMTP].
678
679 These additional Perl modules are also required:
680
681 https://metacpan.org/pod/Authen::SASL[Authen::SASL] and
682 https://metacpan.org/pod/Mail::Address[Mail::Address].
683
684 Exploiting the `sendmailCmd` option of `git send-email`
685 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
686
687 Apart from sending emails via an SMTP server, `git send-email` can also send
688 emails through any application that supports sendmail-like commands. You can
689 read documentation of `--sendmail-cmd=<command>` above for more information.
690 This ability can be very useful if you want to use another application as an
691 SMTP client for `git send-email`, or if your email provider uses proprietary
692 APIs instead of SMTP to send emails.
693
694 As an example, lets see how to configure https://marlam.de/msmtp/[msmtp], a
695 popular SMTP client found in many Linux distributions. Edit `~/.gitconfig`
696 to instruct `git-send-email` to use it for sending emails.
697
698 ----
699 [sendemail]
700 sendmailCmd = /usr/bin/msmtp # Change this to the path where msmtp is installed
701 ----
702
703 Links of a few such community maintained helpers are:
704
705 - https://marlam.de/msmtp/[msmtp]
706 (popular SMTP client with many features, available for Linux and macOS)
707
708 - https://github.com/AdityaGarg8/git-credential-email[git-protonmail]
709 (cross platform client that can send emails using the ProtonMail API)
710
711 - https://github.com/AdityaGarg8/git-credential-email[git-msgraph]
712 (cross platform client that can send emails using the Microsoft Graph API)
713
714 CAVEATS
715 -------
716
717 include::format-patch-caveats.adoc[]
718
719 SEE ALSO
720 --------
721 linkgit:git-format-patch[1], linkgit:git-imap-send[1], mbox(5)
722
723 GIT
724 ---
725 Part of the linkgit:git[1] suite