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-imap-send.adoc

233 lines · 6860 bytes Raw Blame History
1git-imap-send(1)
2================
3
4NAME
5----
6git-imap-send - Send a collection of patches from stdin to an IMAP folder
7
8
9SYNOPSIS
10--------
11[synopsis]
12git imap-send [-v] [-q] [--[no-]curl] [--[no-]draft] [(--folder|-f) <folder>]
13git imap-send --list
14
15
16DESCRIPTION
17-----------
18This command uploads a mailbox generated with `git format-patch`
19into an IMAP drafts folder. This allows patches to be sent as
20other email is when using mail clients that cannot read mailbox
21files directly. The command also works with any general mailbox
22in which emails have the fields `From`, `Date`, and `Subject` in
23that order.
24
25Typical usage is something like:
26
27----
28$ git format-patch --signoff --stdout --attach origin | git imap-send
29----
30
31
32OPTIONS
33-------
34
35`-v`::
36`--verbose`::
37 Be verbose.
38
39`-q`::
40`--quiet`::
41 Be quiet.
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
48`--curl`::
49 Use libcurl to communicate with the IMAP server, unless tunneling
50 into it. Ignored if Git was built without the USE_CURL_FOR_IMAP_SEND
51 option set.
52
53`--no-curl`::
54 Talk to the IMAP server using git's own IMAP routines instead of
55 using libcurl. Ignored if Git was built with the NO_OPENSSL option
56 set.
57
58`--draft`::
59`--no-draft`::
60 Mark uploaded messages with the IMAP `\Draft` flag. The default is `--no-draft`.
61+
62With libcurl, `--draft` requires version 8.13.0 or later.
63Older libcurl still uploads the message but cannot set the flag.
64
65`--list`::
66 Run the IMAP LIST command to output a list of all the folders present.
67
68CONFIGURATION
69-------------
70
71To use the tool, `imap.folder` and either `imap.tunnel` or `imap.host` must be set
72to appropriate values.
73
74include::includes/cmd-config-section-rest.adoc[]
75
76include::config/imap.adoc[]
77
78GETTING A LIST OF AVAILABLE FOLDERS
79-----------------------------------
80
81In order to send an email to a specific folder, you need to know the correct name of
82intended folder in your mailbox. The names like "Junk", "Trash" etc. displayed by
83various email clients need not be the actual names of the folders stored in the mail
84server of your email provider.
85
86In order to get the correct folder name to be used with `git imap-send`, you can run
87`git imap-send --list`. This will display a list of valid folder names. An example
88of such an output when run on a Gmail account is:
89
90.........................
91* LIST (\HasNoChildren) "/" "INBOX"
92* LIST (\HasChildren \Noselect) "/" "[Gmail]"
93* LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
94* LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
95* LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
96* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
97* LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
98* LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
99* LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"
100.........................
101
102Here, you can observe that the correct name for the "Junk" folder is `[Gmail]/Spam`
103and for the "Trash" folder is `[Gmail]/Trash`. Similar logic can be used to determine
104other folders as well.
105
106EXAMPLES
107--------
108Using tunnel mode:
109
110..........................
111[imap]
112 folder = "INBOX.Drafts"
113 tunnel = "ssh -q -C user@example.com /usr/bin/imapd ./Maildir 2> /dev/null"
114..........................
115
116Using direct mode:
117
118.........................
119[imap]
120 folder = "INBOX.Drafts"
121 host = imap://imap.example.com
122 user = bob
123 pass = p4ssw0rd
124.........................
125
126Using direct mode with SSL:
127
128.........................
129[imap]
130 folder = "INBOX.Drafts"
131 host = imaps://imap.example.com
132 user = bob
133 pass = p4ssw0rd
134 port = 123
135 ; sslVerify = false
136.........................
137
138
139[NOTE]
140You may want to use `sslVerify=false`
141while troubleshooting, if you suspect that the reason you are
142having trouble connecting is because the certificate you use at
143the private server `example.com` you are trying to set up (or
144have set up) may not be verified correctly.
145
146Using Gmail's IMAP interface:
147
148----
149[imap]
150 folder = "[Gmail]/Drafts"
151 host = imaps://imap.gmail.com
152 user = user@gmail.com
153 port = 993
154----
155
156Gmail does not allow using your regular password for `git imap-send`.
157If you have multi-factor authentication set up on your Gmail account, you
158can generate an app-specific password for use with `git imap-send`.
159Visit https://security.google.com/settings/security/apppasswords to create
160it. Alternatively, use OAuth2.0 authentication as described below.
161
162[NOTE]
163You might need to instead use: `folder = "[Google Mail]/Drafts"` if you get an error
164that the "Folder doesn't exist". You can also run `git imap-send --list` to get a
165list of available folders.
166
167[NOTE]
168If your Gmail account is set to another language than English, the name of the "Drafts"
169folder will be localized.
170
171If you want to use OAuth2.0 based authentication, you can specify
172`OAUTHBEARER` or `XOAUTH2` mechanism in your config. It is more secure
173than using app-specific passwords, and also does not enforce the need of
174having multi-factor authentication. You will have to use an OAuth2.0
175access token in place of your password when using this authentication.
176
177----
178[imap]
179 folder = "[Gmail]/Drafts"
180 host = imaps://imap.gmail.com
181 user = user@gmail.com
182 port = 993
183 authmethod = OAUTHBEARER
184----
185
186Using Outlook's IMAP interface:
187
188Unlike Gmail, Outlook only supports OAuth2.0 based authentication. Also, it
189supports only `XOAUTH2` as the mechanism.
190
191----
192[imap]
193 folder = "Drafts"
194 host = imaps://outlook.office365.com
195 user = user@outlook.com
196 port = 993
197 authmethod = XOAUTH2
198----
199
200Once the commits are ready to be sent, run the following command:
201
202----
203$ git format-patch --cover-letter -M --stdout origin/master | git imap-send
204----
205
206Just make sure to disable line wrapping in the email client (Gmail's web
207interface will wrap lines no matter what, so you need to use a real
208IMAP client).
209
210In case you are using OAuth2.0 authentication, it is easier to use credential
211helpers to generate tokens. Credential helpers suggested in
212linkgit:git-send-email[1] can be used for `git imap-send` as well.
213
214CAUTION
215-------
216It is still your responsibility to make sure that the email message
217sent by your email program meets the standards of your project.
218Many projects do not like patches to be attached. Some mail
219agents will transform patches (e.g. wrap lines, send them as
220format=flowed) in ways that make them fail. You will get angry
221flames ridiculing you if you don't check this.
222
223Thunderbird in particular is known to be problematic. Thunderbird
224users may wish to visit this web page for more information:
225 https://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email
226
227SEE ALSO
228--------
229linkgit:git-format-patch[1], linkgit:git-send-email[1], `mbox`(5)
230
231GIT
232---
233Part of the linkgit:git[1] suite