@@ -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) <folder>]
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 >
464465into an IMAP drafts folder. This allows patches to be sent as
465466other email is when using mail clients that cannot read mailbox
466467files 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
468469that 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 <folder></ dt >
497+ < dt class ="hdlist1 "> --folder=<folder></ 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>
502511using libcurl. Ignored if Git was built with the NO_OPENSSL option
503512set.</ 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.
572587If Git was built with the NO_CURL option, or if your curl version is older
573588than 7.34.0, or if you’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 ">
655678You 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’t exist".
679+ that the "Folder doesn’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’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>
684742interface will wrap lines no matter what, so you need to use a real
685743IMAP 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