Re: fcc and external attachments

2022-02-09 Thread Alfredo Finelli
David Bremner  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=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-le...@notmuchmail.org


Re: fcc and external attachments

2022-02-08 Thread David Bremner
Alfredo Finelli  writes:

> Since notmuch version 0.35 the emacs interface is not respecting this
> configuration variable setting any more:
>
>   (setq message-fcc-externalize-attachments t)
>
> With earlier versions I used to get fcc copies in my sent folder where
> each attachment was replaced by a reference to the external file that was
> attached (Content-Type: message/external-body, etc.).  After upgrading to
> 0.35, without changing the configuration, the fcc copies of sent messages
> include instead the complete attachments.
>
> I am not sure if this is a bug or if my configuration is not supported any
> more.

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
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org