GNU bug report logs - #47330
[PATCH] Add options to save sent mail

Previous Next

Package: emacs;

Reported by: "Andrea G. Monaco" <andrea.monaco <at> autistici.org>

Date: Mon, 22 Mar 2021 22:06:02 UTC

Severity: wishlist

Tags: patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47330 in the body.
You can then email your comments to 47330 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47330; Package emacs. (Mon, 22 Mar 2021 22:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Andrea G. Monaco" <andrea.monaco <at> autistici.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 22 Mar 2021 22:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Andrea G. Monaco" <andrea.monaco <at> autistici.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add options to save sent mail 
Date: Mon, 22 Mar 2021 23:04:56 +0100
I think this might be useful, for me it is.



Add options to save sent mail

* lisp/gnus/message.el: add defcustoms message-save-sent-mail and
  message-sent-mail-directory
  (message-send): save sent mail if message-save-sent-mail is set



diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 1e0362a3bf..e159d50ebe 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -469,6 +469,18 @@ message-confirm-send
   :link '(custom-manual "(message)Sending Variables")
   :type 'boolean)
 
+(defcustom message-save-sent-mail nil
+  "When non-nil, save messages after successfully sending them, after running message-sent-hook."
+  :group 'message-sending
+  :group 'message-mail
+  :type 'boolean)
+
+(defcustom message-sent-mail-directory (concat message-directory "sent/")
+  "Directory where sent mail is saved, when message-save-sent-mail is set."
+  :group 'message-sending
+  :group 'message-mail
+  :type 'directory)
+
 (defcustom message-generate-new-buffers 'unsent
   "Say whether to create a new message buffer to compose a message.
 Valid values include:
@@ -4364,7 +4376,7 @@ message-send
       (message-do-fcc)
       (save-excursion
        (run-hooks 'message-sent-hook))
-      (message "Sending...done")
+      (message "Sending... done")
       ;; Do ecomplete address snarfing.
       (when (and (message-mail-alias-type-p 'ecomplete)
                 (not message-inhibit-ecomplete))
@@ -4373,6 +4385,9 @@ message-send
       (set-buffer-modified-p nil)
       (delete-auto-save-file-if-necessary t)
       (message-disassociate-draft)
+      ;; Save mail if the user wishes so
+      (if message-save-sent-mail
+          (write-file (concat message-sent-mail-directory (format-time-string "%Y%m%d-%H%M%S"))))
       ;; Delete other mail buffers and stuff.
       (message-do-send-housekeeping)
       (message-do-actions message-send-actions)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47330; Package emacs. (Tue, 23 Mar 2021 07:27:01 GMT) Full text and rfc822 format available.

Message #8 received at 47330 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Andrea G. Monaco" <andrea.monaco <at> autistici.org>
Cc: 47330 <at> debbugs.gnu.org
Subject: Re: bug#47330: [PATCH] Add options to save sent mail
Date: Tue, 23 Mar 2021 09:26:06 +0200
> From: "Andrea G. Monaco" <andrea.monaco <at> autistici.org>
> Date: Mon, 22 Mar 2021 23:04:56 +0100
> 
> Add options to save sent mail
> 
> * lisp/gnus/message.el: add defcustoms message-save-sent-mail and
>   message-sent-mail-directory
>   (message-send): save sent mail if message-save-sent-mail is set

This happens already if you add the Fcc header to the message, AFAIK.
Why is there a need for a separate global knob, when you can specify
that on a per-message basis?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47330; Package emacs. (Tue, 23 Mar 2021 21:14:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Andrea G. Monaco" <andrea.monaco <at> autistici.org>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#47330: [PATCH] Add options to save sent mail
Date: Tue, 23 Mar 2021 22:13:02 +0100
  > This happens already if you add the Fcc header to the message,
  > AFAIK.

This is not mentioned in the docs. Also, I think it's a bit of a hack,
it sends mail back and forth needlessly and lumps it with other received
mail.
I think it's more natural to save it when you send it.


Andrea Monaco




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47330; Package emacs. (Tue, 23 Mar 2021 21:22:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Andrea G. Monaco" <andrea.monaco <at> autistici.org>
To: bug-gnu-emacs <at> gnu.org
Subject: bug#47330: [PATCH] Add options to save sent mail
Date: Tue, 23 Mar 2021 22:21:25 +0100
Wait, I thought you were talking about Bcc. I didn't see Fcc, now I
found it.


Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47330; Package emacs. (Wed, 24 Mar 2021 10:31:02 GMT) Full text and rfc822 format available.

Message #17 received at 47330 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Andrea G. Monaco" <andrea.monaco <at> autistici.org>
Cc: 47330 <at> debbugs.gnu.org
Subject: Re: bug#47330: [PATCH] Add options to save sent mail 
Date: Wed, 24 Mar 2021 11:30:29 +0100
"Andrea G. Monaco" <andrea.monaco <at> autistici.org> writes:

> Wait, I thought you were talking about Bcc. I didn't see Fcc, now I
> found it.

So I think Message already has a facility for this, and I'm closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 47330 <at> debbugs.gnu.org and "Andrea G. Monaco" <andrea.monaco <at> autistici.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 24 Mar 2021 10:31:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Apr 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.