Skip to content

Commit 1a5c86a

Browse files
committed
Autogenerated HTML docs for v2.50.0-173-g8b6f1
1 parent 7144b22 commit 1a5c86a

File tree

4 files changed

+151
-28
lines changed

4 files changed

+151
-28
lines changed

RelNotes/2.51.0.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ UI, Workflows & Features
3131
use the compact-summary format, intead of diffstat, when showing
3232
the summary of the incoming changes.
3333

34+
* "git imap-send" has been broken for a long time, which has been
35+
resurrected and then taught to talk OAuth2.0 etc.
36+
37+
* Some error messages from "git imap-send" has been updated.
38+
3439

3540
Performance, Internal Implementation, Development Support etc.
3641
--------------------------------------------------------------
@@ -51,6 +56,8 @@ Performance, Internal Implementation, Development Support etc.
5156
* A test helper "test_seq" function learned the "-f <fmt>" option,
5257
which allowed us to simplify a lot of test scripts.
5358
59+
* A lot of stale stuff has been removed from the contrib/ hierarchy.
60+
5461
5562
Fixes since v2.50
5663
-----------------

git-config.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6296,8 +6296,10 @@ <h3 id="_variables">Variables</h3>
62966296
<dt class="hdlist1">imap.folder</dt>
62976297
<dd>
62986298
<p>The folder to drop the mails into, which is typically the Drafts
6299-
folder. For example: "INBOX.Drafts", "INBOX/Drafts" or
6300-
"[Gmail]/Drafts". Required.</p>
6299+
folder. For example: <code>INBOX.Drafts</code>, <code>INBOX/Drafts</code> or
6300+
[<code>Gmail</code>]<code>/Drafts</code>. The IMAP folder to interact with MUST be specified;
6301+
the value of this configuration variable is used as the fallback
6302+
default value when the <code>--folder</code> option is not given.</p>
63016303
</dd>
63026304
<dt class="hdlist1">imap.tunnel</dt>
63036305
<dd>
@@ -6344,8 +6346,9 @@ <h3 id="_variables">Variables</h3>
63446346
<p>Specify the authentication method for authenticating with the IMAP server.
63456347
If Git was built with the NO_CURL option, or if your curl version is older
63466348
than 7.34.0, or if you&#8217;re running git-imap-send with the <code>--no-curl</code>
6347-
option, the only supported method is <em>CRAM-MD5</em>. If this is not set
6348-
then <em>git imap-send</em> uses the basic IMAP plaintext LOGIN command.</p>
6349+
option, the only supported methods are <code>PLAIN</code>, <code>CRAM-MD5</code>, <code>OAUTHBEARER</code>
6350+
and <code>XOAUTH2</code>. If this is not set then <code>git</code> <code>imap-send</code> uses the basic IMAP
6351+
plaintext <code>LOGIN</code> command.</p>
63496352
</dd>
63506353
<dt class="hdlist1">include.path</dt>
63516354
<dt class="hdlist1">includeIf.&lt;condition&gt;.path</dt>

git-imap-send.adoc

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,24 @@ git-imap-send - Send a collection of patches from stdin to an IMAP folder
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git imap-send' [-v] [-q] [--[no-]curl]
12+
'git imap-send' [-v] [-q] [--[no-]curl] [(--folder|-f) <folder>]
13+
'git imap-send' --list
1314

1415

1516
DESCRIPTION
1617
-----------
17-
This command uploads a mailbox generated with 'git format-patch'
18+
This command uploads a mailbox generated with `git format-patch`
1819
into an IMAP drafts folder. This allows patches to be sent as
1920
other email is when using mail clients that cannot read mailbox
2021
files directly. The command also works with any general mailbox
21-
in which emails have the fields "From", "Date", and "Subject" in
22+
in which emails have the fields `From`, `Date`, and `Subject` in
2223
that order.
2324

2425
Typical usage is something like:
2526

26-
git format-patch --signoff --stdout --attach origin | git imap-send
27+
------
28+
$ git format-patch --signoff --stdout --attach origin | git imap-send
29+
------
2730

2831

2932
OPTIONS
@@ -37,6 +40,11 @@ OPTIONS
3740
--quiet::
3841
Be quiet.
3942

43+
-f <folder>::
44+
--folder=<folder>::
45+
Specify the folder in which the emails have to saved.
46+
For example: `--folder=[Gmail]/Drafts` or `-f INBOX/Drafts`.
47+
4048
--curl::
4149
Use libcurl to communicate with the IMAP server, unless tunneling
4250
into it. Ignored if Git was built without the USE_CURL_FOR_IMAP_SEND
@@ -47,6 +55,8 @@ OPTIONS
4755
using libcurl. Ignored if Git was built with the NO_OPENSSL option
4856
set.
4957

58+
--list::
59+
Run the IMAP LIST command to output a list of all the folders present.
5060

5161
CONFIGURATION
5262
-------------
@@ -102,20 +112,56 @@ Using Gmail's IMAP interface:
102112

103113
---------
104114
[imap]
105-
folder = "[Gmail]/Drafts"
106-
host = imaps://imap.gmail.com
107-
108-
port = 993
115+
folder = "[Gmail]/Drafts"
116+
host = imaps://imap.gmail.com
117+
118+
port = 993
109119
---------
110120

121+
Gmail does not allow using your regular password for `git imap-send`.
122+
If you have multi-factor authentication set up on your Gmail account, you
123+
can generate an app-specific password for use with `git imap-send`.
124+
Visit https://security.google.com/settings/security/apppasswords to create
125+
it. Alternatively, use OAuth2.0 authentication as described below.
126+
111127
[NOTE]
112128
You might need to instead use: `folder = "[Google Mail]/Drafts"` if you get an error
113-
that the "Folder doesn't exist".
129+
that the "Folder doesn't exist". You can also run `git imap-send --list` to get a
130+
list of available folders.
114131

115132
[NOTE]
116133
If your Gmail account is set to another language than English, the name of the "Drafts"
117134
folder will be localized.
118135

136+
If you want to use OAuth2.0 based authentication, you can specify
137+
`OAUTHBEARER` or `XOAUTH2` mechanism in your config. It is more secure
138+
than using app-specific passwords, and also does not enforce the need of
139+
having multi-factor authentication. You will have to use an OAuth2.0
140+
access token in place of your password when using this authentication.
141+
142+
---------
143+
[imap]
144+
folder = "[Gmail]/Drafts"
145+
host = imaps://imap.gmail.com
146+
147+
port = 993
148+
authmethod = OAUTHBEARER
149+
---------
150+
151+
Using Outlook's IMAP interface:
152+
153+
Unlike Gmail, Outlook only supports OAuth2.0 based authentication. Also, it
154+
supports only `XOAUTH2` as the mechanism.
155+
156+
---------
157+
[imap]
158+
folder = "Drafts"
159+
host = imaps://outlook.office365.com
160+
161+
port = 993
162+
authmethod = XOAUTH2
163+
---------
164+
119165
Once the commits are ready to be sent, run the following command:
120166

121167
$ git format-patch --cover-letter -M --stdout origin/master | git imap-send
@@ -124,6 +170,10 @@ Just make sure to disable line wrapping in the email client (Gmail's web
124170
interface will wrap lines no matter what, so you need to use a real
125171
IMAP client).
126172

173+
In case you are using OAuth2.0 authentication, it is easier to use credential
174+
helpers to generate tokens. Credential helpers suggested in
175+
linkgit:git-send-email[1] can be used for `git imap-send` as well.
176+
127177
CAUTION
128178
-------
129179
It is still your responsibility to make sure that the email message

git-imap-send.html

Lines changed: 78 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -452,26 +452,29 @@ <h2 id="_name">NAME</h2>
452452
<h2 id="_synopsis">SYNOPSIS</h2>
453453
<div class="sectionbody">
454454
<div class="verseblock">
455-
<pre class="content"><em>git imap-send</em> [-v] [-q] [--[no-]curl]</pre>
455+
<pre class="content"><em>git imap-send</em> [-v] [-q] [--[no-]curl] [(--folder|-f) &lt;folder&gt;]
456+
<em>git imap-send</em> --list</pre>
456457
</div>
457458
</div>
458459
</div>
459460
<div class="sect1">
460461
<h2 id="_description">DESCRIPTION</h2>
461462
<div class="sectionbody">
462463
<div class="paragraph">
463-
<p>This command uploads a mailbox generated with <em>git format-patch</em>
464+
<p>This command uploads a mailbox generated with <code>git</code> <code>format-patch</code>
464465
into an IMAP drafts folder. This allows patches to be sent as
465466
other email is when using mail clients that cannot read mailbox
466467
files directly. The command also works with any general mailbox
467-
in which emails have the fields "From", "Date", and "Subject" in
468+
in which emails have the fields <code>From</code>, <code>Date</code>, and <code>Subject</code> in
468469
that order.</p>
469470
</div>
470471
<div class="paragraph">
471472
<p>Typical usage is something like:</p>
472473
</div>
473-
<div class="paragraph">
474-
<p>git format-patch --signoff --stdout --attach origin | git imap-send</p>
474+
<div class="listingblock">
475+
<div class="content">
476+
<pre>$ git format-patch --signoff --stdout --attach origin | git imap-send</pre>
477+
</div>
475478
</div>
476479
</div>
477480
</div>
@@ -490,6 +493,12 @@ <h2 id="_options">OPTIONS</h2>
490493
<dd>
491494
<p>Be quiet.</p>
492495
</dd>
496+
<dt class="hdlist1">-f &lt;folder&gt;</dt>
497+
<dt class="hdlist1">--folder=&lt;folder&gt;</dt>
498+
<dd>
499+
<p>Specify the folder in which the emails have to saved.
500+
For example: <code>--folder=</code>[<code>Gmail</code>]<code>/Drafts</code> or <code>-f</code> <code>INBOX/Drafts</code>.</p>
501+
</dd>
493502
<dt class="hdlist1">--curl</dt>
494503
<dd>
495504
<p>Use libcurl to communicate with the IMAP server, unless tunneling
@@ -502,6 +511,10 @@ <h2 id="_options">OPTIONS</h2>
502511
using libcurl. Ignored if Git was built with the NO_OPENSSL option
503512
set.</p>
504513
</dd>
514+
<dt class="hdlist1">--list</dt>
515+
<dd>
516+
<p>Run the IMAP LIST command to output a list of all the folders present.</p>
517+
</dd>
505518
</dl>
506519
</div>
507520
</div>
@@ -523,8 +536,10 @@ <h2 id="_configuration">CONFIGURATION</h2>
523536
<dt class="hdlist1">imap.folder</dt>
524537
<dd>
525538
<p>The folder to drop the mails into, which is typically the Drafts
526-
folder. For example: "INBOX.Drafts", "INBOX/Drafts" or
527-
"[Gmail]/Drafts". Required.</p>
539+
folder. For example: <code>INBOX.Drafts</code>, <code>INBOX/Drafts</code> or
540+
[<code>Gmail</code>]<code>/Drafts</code>. The IMAP folder to interact with MUST be specified;
541+
the value of this configuration variable is used as the fallback
542+
default value when the <code>--folder</code> option is not given.</p>
528543
</dd>
529544
<dt class="hdlist1">imap.tunnel</dt>
530545
<dd>
@@ -571,8 +586,9 @@ <h2 id="_configuration">CONFIGURATION</h2>
571586
<p>Specify the authentication method for authenticating with the IMAP server.
572587
If Git was built with the NO_CURL option, or if your curl version is older
573588
than 7.34.0, or if you&#8217;re running git-imap-send with the <code>--no-curl</code>
574-
option, the only supported method is <em>CRAM-MD5</em>. If this is not set
575-
then <em>git imap-send</em> uses the basic IMAP plaintext LOGIN command.</p>
589+
option, the only supported methods are <code>PLAIN</code>, <code>CRAM-MD5</code>, <code>OAUTHBEARER</code>
590+
and <code>XOAUTH2</code>. If this is not set then <code>git</code> <code>imap-send</code> uses the basic IMAP
591+
plaintext <code>LOGIN</code> command.</p>
576592
</dd>
577593
</dl>
578594
</div>
@@ -639,11 +655,18 @@ <h2 id="_examples">EXAMPLES</h2>
639655
<div class="listingblock">
640656
<div class="content">
641657
<pre>[imap]
642-
folder = "[Gmail]/Drafts"
643-
host = imaps://imap.gmail.com
644-
645-
port = 993</pre>
658+
folder = "[Gmail]/Drafts"
659+
host = imaps://imap.gmail.com
660+
661+
port = 993</pre>
662+
</div>
646663
</div>
664+
<div class="paragraph">
665+
<p>Gmail does not allow using your regular password for <code>git</code> <code>imap-send</code>.
666+
If you have multi-factor authentication set up on your Gmail account, you
667+
can generate an app-specific password for use with <code>git</code> <code>imap-send</code>.
668+
Visit <a href="https://security.google.com/settings/security/apppasswords" class="bare">https://security.google.com/settings/security/apppasswords</a> to create
669+
it. Alternatively, use OAuth2.0 authentication as described below.</p>
647670
</div>
648671
<div class="admonitionblock note">
649672
<table>
@@ -653,7 +676,8 @@ <h2 id="_examples">EXAMPLES</h2>
653676
</td>
654677
<td class="content">
655678
You might need to instead use: <code>folder</code> <code>=</code> "[<code>Google</code> <code>Mail</code>]<code>/Drafts</code>" if you get an error
656-
that the "Folder doesn&#8217;t exist".
679+
that the "Folder doesn&#8217;t exist". You can also run <code>git</code> <code>imap-send</code> <code>--list</code> to get a
680+
list of available folders.
657681
</td>
658682
</tr>
659683
</table>
@@ -672,6 +696,40 @@ <h2 id="_examples">EXAMPLES</h2>
672696
</table>
673697
</div>
674698
<div class="paragraph">
699+
<p>If you want to use OAuth2.0 based authentication, you can specify
700+
<code>OAUTHBEARER</code> or <code>XOAUTH2</code> mechanism in your config. It is more secure
701+
than using app-specific passwords, and also does not enforce the need of
702+
having multi-factor authentication. You will have to use an OAuth2.0
703+
access token in place of your password when using this authentication.</p>
704+
</div>
705+
<div class="listingblock">
706+
<div class="content">
707+
<pre>[imap]
708+
folder = "[Gmail]/Drafts"
709+
host = imaps://imap.gmail.com
710+
711+
port = 993
712+
authmethod = OAUTHBEARER</pre>
713+
</div>
714+
</div>
715+
<div class="paragraph">
716+
<p>Using Outlook&#8217;s IMAP interface:</p>
717+
</div>
718+
<div class="paragraph">
719+
<p>Unlike Gmail, Outlook only supports OAuth2.0 based authentication. Also, it
720+
supports only <code>XOAUTH2</code> as the mechanism.</p>
721+
</div>
722+
<div class="listingblock">
723+
<div class="content">
724+
<pre>[imap]
725+
folder = "Drafts"
726+
host = imaps://outlook.office365.com
727+
728+
port = 993
729+
authmethod = XOAUTH2</pre>
730+
</div>
731+
</div>
732+
<div class="paragraph">
675733
<p>Once the commits are ready to be sent, run the following command:</p>
676734
</div>
677735
<div class="literalblock">
@@ -684,6 +742,11 @@ <h2 id="_examples">EXAMPLES</h2>
684742
interface will wrap lines no matter what, so you need to use a real
685743
IMAP client).</p>
686744
</div>
745+
<div class="paragraph">
746+
<p>In case you are using OAuth2.0 authentication, it is easier to use credential
747+
helpers to generate tokens. Credential helpers suggested in
748+
<a href="git-send-email.html">git-send-email(1)</a> can be used for <code>git</code> <code>imap-send</code> as well.</p>
749+
</div>
687750
</div>
688751
</div>
689752
<div class="sect1">
@@ -723,7 +786,7 @@ <h2 id="_git">GIT</h2>
723786
</div>
724787
<div id="footer">
725788
<div id="footer-text">
726-
Last updated 2025-02-14 21:38:14 -0800
789+
Last updated 2025-07-02 13:17:18 -0700
727790
</div>
728791
</div>
729792
</body>

0 commit comments

Comments
 (0)