@@ -9,21 +9,24 @@ git-imap-send - Send a collection of patches from stdin to an IMAP folder
9
9
SYNOPSIS
10
10
--------
11
11
[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
13
14
14
15
15
16
DESCRIPTION
16
17
-----------
17
- This command uploads a mailbox generated with ' git format-patch'
18
+ This command uploads a mailbox generated with ` git format-patch`
18
19
into an IMAP drafts folder. This allows patches to be sent as
19
20
other email is when using mail clients that cannot read mailbox
20
21
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
22
23
that order.
23
24
24
25
Typical usage is something like:
25
26
26
- git format-patch -- signoff -- stdout -- attach origin | git imap-send
27
+ ------
28
+ $ git format-patch --signoff --stdout --attach origin | git imap-send
29
+ ------
27
30
28
31
29
32
OPTIONS
@@ -37,6 +40,11 @@ OPTIONS
37
40
-- quiet::
38
41
Be quiet.
39
42
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
+
40
48
-- curl::
41
49
Use libcurl to communicate with the IMAP server, unless tunneling
42
50
into it. Ignored if Git was built without the USE_CURL_FOR_IMAP_SEND
@@ -47,6 +55,8 @@ OPTIONS
47
55
using libcurl. Ignored if Git was built with the NO_OPENSSL option
48
56
set.
49
57
58
+ -- list::
59
+ Run the IMAP LIST command to output a list of all the folders present.
50
60
51
61
CONFIGURATION
52
62
-------------
@@ -102,20 +112,56 @@ Using Gmail's IMAP interface:
102
112
103
113
---------
104
114
[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
109
119
---------
110
120
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
+
111
127
[NOTE]
112
128
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.
114
131
115
132
[NOTE]
116
133
If your Gmail account is set to another language than English, the name of the "Drafts"
117
134
folder will be localized.
118
135
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
+
119
165
Once the commits are ready to be sent, run the following command:
120
166
121
167
$ 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
124
170
interface will wrap lines no matter what, so you need to use a real
125
171
IMAP client).
126
172
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
+
127
177
CAUTION
128
178
-------
129
179
It is still your responsibility to make sure that the email message
0 commit comments