@@ -9,21 +9,24 @@ git-imap-send - Send a collection of patches from stdin to an IMAP folder
99SYNOPSIS
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
1516DESCRIPTION
1617-----------
17- This command uploads a mailbox generated with ' git format-patch'
18+ This command uploads a mailbox generated with ` git format-patch`
1819into an IMAP drafts folder. This allows patches to be sent as
1920other email is when using mail clients that cannot read mailbox
2021files 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
2223that order.
2324
2425Typical 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
2932OPTIONS
@@ -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
5161CONFIGURATION
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 can generate
123+ an app-specific password for use with `git imap-send` .
124+ Visit https://security.google.com/settings/security/apppasswords to create it.
125+ Alternatively, use OAuth2.0 authentication as described below.
126+
111127[NOTE]
112128You 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]
116133If your Gmail account is set to another language than English, the name of the "Drafts"
117134folder will be localized.
118135
136+ If you want to use OAuth2.0 based authentication, you can specify `OAUTHBEARER`
137+ or `XOAUTH2` mechanism in your config. It is more secure than using app-specific
138+ passwords, and also does not enforce the need of having multi-factor authentication.
139+ You will have to use an OAuth2.0 access token in place of your password when using this
140+ 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+
119165Once 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
124170interface will wrap lines no matter what, so you need to use a real
125171IMAP 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+
127177CAUTION
128178-------
129179It is still your responsibility to make sure that the email message
0 commit comments