Re: fcc and external attachments

Subject: Re: fcc and external attachments

Date: Wed, 09 Feb 2022 10:16:56 +0100

To: David Bremner

Cc:

From: Alfredo Finelli


David Bremner <david@tethera.net> writes:

> It seems likely this is an unintended consequence of
> da302e1cbaaab89b2bbb32c0f59e1aa6ee708455.
>
> Since notmuch-emacs does it's own Fcc processing, it's a bit
> hit-and-miss whether a given message-fcc-* variable is respected. I'll
> have a look at how hard it is to fix, but first I need a reliable recipe
> for triggering the externalization in message-mode (i.e. without
> involving notmuch).  I tried in emacs -q, customize
> message-fcc-externalize-attachments, and running M-x compose-mail, but
> that still saved the whole attachments. Maybe it was the type of
> attachement or something, I don't understand it yet.
>
> d

While trying to understand the problem I found out that gnus had a
somewhat related issue, as you can see in this commit from emacs branch
"emacs-28":

https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-28&id=d8bd7d015e626c73351938626a01288028ebe1c5

So I made this little modification to notmuch in the function
notmuch-maildir-setup-message-for-saving:


diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 51020788..d58f209b 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -159,6 +159,8 @@ Otherwise set it according to `notmuch-fcc-dirs'."
 
 This should be called on a temporary copy.
 This is taken from the function message-do-fcc."
+  (when mml-externalize-attachments
+    (setq message-encoded-mail-cache nil))
   (if (not message-encoded-mail-cache)
       (message-encode-message-body)
     (erase-buffer)


Now I have again the original behaviour with external attachments in fcc
copies.  I understand that this forces a new encoding for the local copy
in the fcc-externalize case and ignores the cached encoded message, which
is maybe what you were trying to avoid in the first place.  I did not test
what happens to a signed message with attachments.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: