unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* fcc and external attachments
@ 2022-02-08  8:27 Alfredo Finelli
  2022-02-08 12:47 ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: Alfredo Finelli @ 2022-02-08  8:27 UTC (permalink / raw)
  To: notmuch

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.

Best regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fcc and external attachments
  2022-02-08  8:27 fcc and external attachments Alfredo Finelli
@ 2022-02-08 12:47 ` David Bremner
  2022-02-09  9:16   ` Alfredo Finelli
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2022-02-08 12:47 UTC (permalink / raw)
  To: Alfredo Finelli, notmuch

Alfredo Finelli <alf@computationes.de> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fcc and external attachments
  2022-02-08 12:47 ` David Bremner
@ 2022-02-09  9:16   ` Alfredo Finelli
  0 siblings, 0 replies; 3+ messages in thread
From: Alfredo Finelli @ 2022-02-09  9:16 UTC (permalink / raw)
  To: David Bremner

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.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-09 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08  8:27 fcc and external attachments Alfredo Finelli
2022-02-08 12:47 ` David Bremner
2022-02-09  9:16   ` Alfredo Finelli

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).