git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 0/2] send-email: integrate with git imap-send

From
Aditya Garg <gargaditya08@live.com>
Date
Jul 23, 2025, 10:33 UTC
Message-ID
<PN3PR01MB9597EC4C5DF97943587AEEB4B85FA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
In-Reply-To
<08528f201acc1038ebc5861321395d17516094fd.1753003385.git.gargaditya08@live.com>
Hi all
This patch series introduces integration of `git send-email` with `git imap-send`.

The first patch adds the ability to send a copy of sent emails to an IMAP folder specified by the user, which is useful for email providers that do not support sending a copy of sent emails to the "Sent" folder via SMTP.

The second patch allows users to copy emails to an IMAP folder without actually sending them.

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
v4 - Fix a bug causing emails to be copied to an IMAP folder even if
     --dry-run is specified.
   - Minor edits to commit messages and docs.
   - Add another patch that enables copying emails to an IMAP folder
     without actually sending them.
Aditya Garg (2):
  send-email: add ability to send a copy of sent emails to an IMAP
    folder
  send-email: enable copying emails to IMAP folder without actually
    sending them
 Documentation/config/sendemail.adoc |  2 ++
 Documentation/git-send-email.adoc   | 25 ++++++++++++++++++
 git-send-email.perl                 | 40 +++++++++++++++++++++++++++--
 imap-send.c                         | 26 +++++++++++++------
 4 files changed, 83 insertions(+), 10 deletions(-)
Range-diff against v3:
1:  da7cee769f ! 1:  27b5eb33bb send-email: add ability to send a copy of sent emails to an IMAP folder
    @@ Commit message
         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
    +    by piping the emails to `git imap-send` command, after all emails are
         sent via SMTP and the SMTP server has been closed.
     
         Signed-off-by: Aditya Garg <gargaditya08@live.com>
    @@ Documentation/git-send-email.adoc: must be used for each option.
     +	IMAP folder of your choice.
     ++
     +This feature requires setting up `git imap-send`. See linkgit:git-imap-send[1]
    -+to get instructions for the same.
    ++for instructions.
     +
      --batch-size=<num>::
      	Some email servers (e.g. 'smtp.163.com') limit the number of emails to be
    @@ git-send-email.perl: sub usage {
                                           `--smtp-auth=none`
          --smtp-debug            <0|1>  * Disable, enable Net::SMTP debug.
     +    --imap-sent-folder      <str>  * IMAP folder where a copy of the emails should be sent.
    -+                                     Make sure `git imap-send` is setup to use this feature.
    ++                                     Make sure `git imap-send` is set up to use this feature.
      
          --batch-size            <int>  * send max <int> message per connection.
          --relogin-delay         <int>  * delay <int> seconds between two successive login.
    @@ git-send-email.perl: sub send_message {
      		print "\n";
      	}
      
    -+	if ($imap_sent_folder) {
    ++	if ($imap_sent_folder && !$dry_run) {
     +		my $imap_header = $header;
     +		if (@initial_bcc) {
     +			# Bcc is not a part of $header, so we add it here.
    @@ git-send-email.perl: sub cleanup_compose_files {
      
      $smtp->quit if $smtp;
      
    -+if ($imap_sent_folder && @imap_copy) {
    ++if ($imap_sent_folder && @imap_copy && !$dry_run) {
     +	my $imap_input = join("\n", @imap_copy);
     +	eval {
     +		print "\nStarting git imap-send...\n";
-:  ---------- > 2:  2ad311502d send-email: enable copying emails to IMAP folder without actually sending them
-- 
2.50.1.320.g2ad311502d
Previous: Aditya GargNext: Aditya Garg
Message 21 of 33 in “send-email: add ability to send a copy of sent emails to an IMAP folder”
  1. send-email: add ability to send a copy of sent emails to an IMAP folderAditya Garg, Jul 20, 2025
  2. send-email: add ability to send a copy of sent emails to an IMAP folderAditya Garg, Jul 21, 2025
  3. Eric SunshineJul 21, 2025
  4. Aditya GargJul 23, 2025
  5. Junio C HamanoJul 21, 2025
  6. brian m. carlsonJul 22, 2025
  7. Aditya GargJul 22, 2025
  8. Aditya GargJul 22, 2025
  9. Junio C HamanoJul 22, 2025
  10. Aditya GargJul 22, 2025
  11. Aditya GargJul 22, 2025
  12. Junio C HamanoJul 22, 2025
  13. Aditya GargJul 22, 2025
  14. Aditya GargJul 22, 2025
  15. Junio C HamanoJul 22, 2025
  16. Aditya GargJul 22, 2025
  17. Junio C HamanoJul 22, 2025
  18. Aditya GargJul 22, 2025
  19. send-email: add ability to send a copy of sent emails to an IMAP folderAditya Garg, Jul 22, 2025
  20. Aditya GargJul 23, 2025
  21. 0/2 send-email: integrate with git imap-sendAditya Garg, Jul 23, 2025
  22. 1/2 send-email: add ability to send a copy of sent emails to an IMAP folderAditya Garg, Jul 23, 2025
  23. 2/2 send-email: enable copying emails to IMAP folder without actually sending themAditya Garg, Jul 23, 2025
  24. Junio C HamanoAug 11, 2025
  25. Aditya GargAug 12, 2025
  26. Aditya GargAug 12, 2025
  27. Junio C HamanoAug 12, 2025
  28. Aditya GargAug 12, 2025
  29. 0/2 send-email: integrate with git imap-sendAditya Garg, Aug 12, 2025
  30. 1/2 send-email: add ability to send a copy of sent emails to an IMAP folderAditya Garg, Aug 12, 2025
  31. 2/2 send-email: enable copying emails to an IMAP folder without actually sending themAditya Garg, Aug 12, 2025
  32. Junio C HamanoAug 12, 2025
  33. Junio C HamanoAug 15, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.