GNU bug report logs - #70338
message-fcc-externalize-attachments has no effect

Previous Next

Package: emacs;

Reported by: Nicolas Graner <nicolas <at> graner.name>

Date: Thu, 11 Apr 2024 12:40:02 UTC

Severity: normal

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

To reply to this bug, email your comments to 70338 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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#70338; Package emacs. (Thu, 11 Apr 2024 12:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Graner <nicolas <at> graner.name>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Apr 2024 12:40:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Graner <nicolas <at> graner.name>
To: bug-gnu-emacs <at> gnu.org
Subject: message-fcc-externalize-attachments has no effect
Date: Thu, 11 Apr 2024 14:39:12 +0200
The variable message-fcc-externalize-attachments seems to have no effect
(tested in emacs 30.0.50). Whether I set it to t or nil, whenever I send
a mail message with a file attached, the file is included as an internal
message part in the FCC mailbox.

I am not sure if this is a bug or if I am missing something, such as
another variable that interferes with this one.

Nicolas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70338; Package emacs. (Thu, 18 Apr 2024 10:14:10 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicolas Graner <nicolas <at> graner.name>, eric <at> ericabrahamsen.net
Cc: 70338 <at> debbugs.gnu.org
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Thu, 18 Apr 2024 13:11:57 +0300
> From: Nicolas Graner <nicolas <at> graner.name>
> Date: Thu, 11 Apr 2024 14:39:12 +0200
> 
> The variable message-fcc-externalize-attachments seems to have no effect
> (tested in emacs 30.0.50). Whether I set it to t or nil, whenever I send
> a mail message with a file attached, the file is included as an internal
> message part in the FCC mailbox.
> 
> I am not sure if this is a bug or if I am missing something, such as
> another variable that interferes with this one.

Eric, can you please look into this?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70338; Package emacs. (Sat, 20 Apr 2024 15:38:04 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70338 <at> debbugs.gnu.org, Nicolas Graner <nicolas <at> graner.name>
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Sat, 20 Apr 2024 08:36:40 -0700
On 04/18/24 13:11 PM, Eli Zaretskii wrote:
>> From: Nicolas Graner <nicolas <at> graner.name>
>> Date: Thu, 11 Apr 2024 14:39:12 +0200
>> 
>> The variable message-fcc-externalize-attachments seems to have no effect
>> (tested in emacs 30.0.50). Whether I set it to t or nil, whenever I send
>> a mail message with a file attached, the file is included as an internal
>> message part in the FCC mailbox.
>> 
>> I am not sure if this is a bug or if I am missing something, such as
>> another variable that interferes with this one.
>
> Eric, can you please look into this?

I'm trying to figure out what "externalization" is actually supposed to
do. 

So far I don't see that this option would actually do anything in an FCC
context. `message-fcc-externalize-attachments' is only used in
`message-do-fcc`, where its value is let-bound to
`mml-externalize-attachments'.

But `mml-externalize-attachments' is only consulted in
`gnus-inews-do-gcc', which already doesn't sound very promising. That
function first let-binds `mml-externalize-attachments' to nil, before
doing its own setting, so any dynamic value is getting overridden
anyway.

I tried starting with `gnus-gcc-externalize-attachments' and sending a
message with an attachment, just to see how it's supposed to work.
Nothing seemed to happen.

Can you tell me what the desired effect is supposed to be? Does the
"gcc" version of this option work for you?

Eric




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70338; Package emacs. (Sat, 20 Apr 2024 16:21:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: nicolas <at> graner.name, Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 70338 <at> debbugs.gnu.org
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Sat, 20 Apr 2024 19:20:09 +0300
> From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
> Cc: Nicolas Graner <nicolas <at> graner.name>,  70338 <at> debbugs.gnu.org
> Date: Sat, 20 Apr 2024 08:36:40 -0700
> 
> Can you tell me what the desired effect is supposed to be? Does the
> "gcc" version of this option work for you?

I guess you are asking Nicolas, not me?  Because I don't use these
features (and don't use message.el at all).

Nicolas, can you please answer Eric's question?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70338; Package emacs. (Sat, 20 Apr 2024 16:23:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70338 <at> debbugs.gnu.org, nicolas <at> graner.name
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Sat, 20 Apr 2024 09:22:34 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
>> Cc: Nicolas Graner <nicolas <at> graner.name>,  70338 <at> debbugs.gnu.org
>> Date: Sat, 20 Apr 2024 08:36:40 -0700
>> 
>> Can you tell me what the desired effect is supposed to be? Does the
>> "gcc" version of this option work for you?
>
> I guess you are asking Nicolas, not me?  Because I don't use these
> features (and don't use message.el at all).
>
> Nicolas, can you please answer Eric's question?

Yes, sorry, that was aimed at Nicolas.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70338; Package emacs. (Sat, 20 Apr 2024 17:30:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Graner <nicolas <at> graner.name>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: eliz <at> gnu.org, 70338 <at> debbugs.gnu.org
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Sat, 20 Apr 2024 19:29:25 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> wrote on 2024-04-20 08:36:
> So far I don't see that this option would actually do anything in an FCC
> context. `message-fcc-externalize-attachments' is only used in
> `message-do-fcc`, where its value is let-bound to
> `mml-externalize-attachments'.
>
> But `mml-externalize-attachments' is only consulted in
> `gnus-inews-do-gcc', which already doesn't sound very promising. That
> function first let-binds `mml-externalize-attachments' to nil, before
> doing its own setting, so any dynamic value is getting overridden
> anyway.
>
> I tried starting with `gnus-gcc-externalize-attachments' and sending a
> message with an attachment, just to see how it's supposed to work.
> Nothing seemed to happen.
>
> Can you tell me what the desired effect is supposed to be? Does the
> "gcc" version of this option work for you?
>
> Eric

When you attach a file to a mail message you are writing, only an anchor
with the file name is inserted in the message buffer. When the message
is sent, the anchor is replaced with the actual MIME-encoded contents of
the attached file. The copy of the message that is written to the FCC
file also includes the MIME-encoded attached file.

I was expecting that externalization would mean that the copy in the FCC
file would only include an anchor rather than the attachment, which
would be extremely useful. I must admit this was only a guess (wishful
thinking?) since the documentation is not explicit at all.

I don't use gnus. To test the gnus version of the variable, I guess I
would need access to a free, public NNTP server, which I don't know
where to find. Can you help?

Nicolas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70338; Package emacs. (Sun, 21 Apr 2024 00:30:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Nicolas Graner <nicolas <at> graner.name>
Cc: 70338 <at> debbugs.gnu.org
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Sat, 20 Apr 2024 17:28:58 -0700
[Message part 1 (text/plain, inline)]
On 04/20/24 19:29 PM, Nicolas Graner wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> wrote on 2024-04-20 08:36:
>> So far I don't see that this option would actually do anything in an FCC
>> context. `message-fcc-externalize-attachments' is only used in
>> `message-do-fcc`, where its value is let-bound to
>> `mml-externalize-attachments'.
>>
>> But `mml-externalize-attachments' is only consulted in
>> `gnus-inews-do-gcc', which already doesn't sound very promising. That
>> function first let-binds `mml-externalize-attachments' to nil, before
>> doing its own setting, so any dynamic value is getting overridden
>> anyway.
>>
>> I tried starting with `gnus-gcc-externalize-attachments' and sending a
>> message with an attachment, just to see how it's supposed to work.
>> Nothing seemed to happen.
>>
>> Can you tell me what the desired effect is supposed to be? Does the
>> "gcc" version of this option work for you?
>>
>> Eric
>
> When you attach a file to a mail message you are writing, only an anchor
> with the file name is inserted in the message buffer. When the message
> is sent, the anchor is replaced with the actual MIME-encoded contents of
> the attached file. The copy of the message that is written to the FCC
> file also includes the MIME-encoded attached file.
>
> I was expecting that externalization would mean that the copy in the FCC
> file would only include an anchor rather than the attachment, which
> would be extremely useful. I must admit this was only a guess (wishful
> thinking?) since the documentation is not explicit at all.

Oh, that sounds very useful, I've often wanted that.

> I don't use gnus. To test the gnus version of the variable, I guess I
> would need access to a free, public NNTP server, which I don't know
> where to find. Can you help?

I think most of us use news.gmane.io

I tested the GCC version again (now that I know what it's supposed to
do), and it did work -- the version of the message in my Sent folder had
a mime part of "message/external-body".

Long story short, the encoded body of the message is cached during
sending, and the cached version is re-used during GCC/FCC handling. If
the user has requested the externalization of attachments, the GCC
version of the code knows to use that as a flag to dump the cache and
re-generate it with externalized attachments; the FCC code doesn't do
the equivalent.

I've pushed a change that fixes this issue in my testing -- are you
using Emacs master? If not, I've attached the commit here, I hope you'll
be able to test it.

Thanks,
Eric

[0001-Re-encode-message-bodies-with-externalized-attachmen.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70338; Package emacs. (Mon, 22 Apr 2024 04:20:03 GMT) Full text and rfc822 format available.

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

From: Nicolas Graner <nicolas <at> graner.name>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 70338 <at> debbugs.gnu.org
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Mon, 22 Apr 2024 06:19:30 +0200
Yes, your patch works for me.
Great, thanks!

Nicolas

Eric Abrahamsen <eric <at> ericabrahamsen.net> wrote on 2024-04-20 17:28:
> On 04/20/24 19:29 PM, Nicolas Graner wrote:
>> Eric Abrahamsen <eric <at> ericabrahamsen.net> wrote on 2024-04-20 08:36:
>>> So far I don't see that this option would actually do anything in an FCC
>>> context. `message-fcc-externalize-attachments' is only used in
>>> `message-do-fcc`, where its value is let-bound to
>>> `mml-externalize-attachments'.
>>>
>>> But `mml-externalize-attachments' is only consulted in
>>> `gnus-inews-do-gcc', which already doesn't sound very promising. That
>>> function first let-binds `mml-externalize-attachments' to nil, before
>>> doing its own setting, so any dynamic value is getting overridden
>>> anyway.
>>>
>>> I tried starting with `gnus-gcc-externalize-attachments' and sending a
>>> message with an attachment, just to see how it's supposed to work.
>>> Nothing seemed to happen.
>>>
>>> Can you tell me what the desired effect is supposed to be? Does the
>>> "gcc" version of this option work for you?
>>>
>>> Eric
>>
>> When you attach a file to a mail message you are writing, only an anchor
>> with the file name is inserted in the message buffer. When the message
>> is sent, the anchor is replaced with the actual MIME-encoded contents of
>> the attached file. The copy of the message that is written to the FCC
>> file also includes the MIME-encoded attached file.
>>
>> I was expecting that externalization would mean that the copy in the FCC
>> file would only include an anchor rather than the attachment, which
>> would be extremely useful. I must admit this was only a guess (wishful
>> thinking?) since the documentation is not explicit at all.
>
> Oh, that sounds very useful, I've often wanted that.
>
>> I don't use gnus. To test the gnus version of the variable, I guess I
>> would need access to a free, public NNTP server, which I don't know
>> where to find. Can you help?
>
> I think most of us use news.gmane.io
>
> I tested the GCC version again (now that I know what it's supposed to
> do), and it did work -- the version of the message in my Sent folder had
> a mime part of "message/external-body".
>
> Long story short, the encoded body of the message is cached during
> sending, and the cached version is re-used during GCC/FCC handling. If
> the user has requested the externalization of attachments, the GCC
> version of the code knows to use that as a flag to dump the cache and
> re-generate it with externalized attachments; the FCC code doesn't do
> the equivalent.
>
> I've pushed a change that fixes this issue in my testing -- are you
> using Emacs master? If not, I've attached the commit here, I hope you'll
> be able to test it.
>
> Thanks,
> Eric




Reply sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
You have taken responsibility. (Mon, 22 Apr 2024 04:29:03 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Graner <nicolas <at> graner.name>:
bug acknowledged by developer. (Mon, 22 Apr 2024 04:29:03 GMT) Full text and rfc822 format available.

Message #31 received at 70338-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Nicolas Graner <nicolas <at> graner.name>
Cc: 70338-done <at> debbugs.gnu.org
Subject: Re: bug#70338: message-fcc-externalize-attachments has no effect
Date: Sun, 21 Apr 2024 21:27:59 -0700
Nicolas Graner <nicolas <at> graner.name> writes:

> Yes, your patch works for me.
> Great, thanks!

Excellent! I'll close the bug report now.




This bug report was last modified 12 days ago.

Previous Next


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