Thread (12 messages) 12 messages, 2 authors, 2025-08-12

Re: [PATCH v3] send-email: add ability to send a copy of sent emails to an IMAP folder

From: Aditya Garg <hidden>
Date: 2025-07-23 09:05:44


On 22/07/25 4:44 pm, Aditya Garg wrote:
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 <redacted>
---

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.


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help