Re: [PATCH v3] send-email: add ability to send a copy of sent emails to an IMAP folder
- From
Aditya Garg <gargaditya08@live.com>
- Date
- Jul 23, 2025, 09:05 UTC
- Message-ID
- <PN3PR01MB9597EAA61E0E40B027B81DF6B85FA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
- In-Reply-To
- <da7cee769f25871ed3f934e3ec7f2cccf0a0420c.1753182534.git.gargaditya08@live.com>
On 22/07/25 4:44 pm, Aditya Garg wrote:
Show 23 quoted lines
> Some email providers like Apple iCloud Mail do not support sending a copy > of sent emails to the "Sent" folder if SMTP server is used. As a > workaround, various email clients like Thunderbird which rely on SMTP, > use IMAP to send a copy of sent emails to the "Sent" folder. Something > similar can be done if sending emails via `git send-email`, by using > the `git imap-send` command to send a copy of the sent email to an IMAP > folder specified by the user. > > Add this functionality to `git send-email` by introducing a new > configuration variable `sendemail.imapfolder` and command line option > `--imap-folder` which specifies the IMAP folder to send a copy of the > sent emails to. If specified, a copy of the sent emails will be sent > by piping the emails to `git imap-send` command, after the all emails are > sent via SMTP and the SMTP server has been closed. > > Signed-off-by: Aditya Garg <gargaditya08@live.com> > --- > > v2 - Fix indentation in patch for imap-send.c > - Minor edits to commit message > > v3 - Rename imap folder to imap sent folder > - Make an error message shorter by removing unecessary details
I just found a tiny bug here. It is sending emails to IMAP even if --dry-run is present. Will fix in v4. Also, this little bug has also gave me an easier way to implement --use-imap-only, which is what Junio suggested before.