Discussion:
Gnus capitalizes non-header "from"
Eric Abrahamsen
2017-11-14 16:13:15 UTC
Permalink
Are you sure Gnus is the program mangling it? It is mangled in your
sent-folder?
I just tried emailing myself an attachment and "from" was untouched -
both in the copy in the sent-folder and the one I received through my
local Postfix. (I tried both with disposition=attachment and inline,
same result).
FWIW, I tried it, and the "from" was capitalized in both the received
and sent version.
Hm, interesting!
Difference in versions? In storage type?
(GNU Emacs 27.0.50 built from a7b7b85567f766ff510a5eaaaf32dbbbec15efd0,
nnml).
GNU Emacs 27.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.22.25)
of 2017-11-09

And dovecot IMAP, unfortunately, which rules out old storage formats.

Unless I'm doing something else wrong -- I'll have time to check this
out in detail tonight.
Adam Sjøgren
2017-11-14 16:00:10 UTC
Permalink
I did some more systematic tests. The mangling is visible in the
locally saved version of the message, so it's definitely caused locally.
What format do you use for your sent messages folder? nnfolder?
The problem does *not* occur if I do not sign the message! It *does*
occur when the message is signed either with an OpenPGP or with an
S/MIME key.
Aha. Maybe that is to avoid the lines starting with "[Ff]rom " being
(potentially) mangled after signing, leaving the signature invalid.
It's not a new problem, I remember seeing it for the first time years
ago.
Yeah, mbox has used "From " as the separator for decades.


Best regards,

Adam
--
"It's not denial. I'm just very selective about the Adam Sjøgren
reality I accept." ***@koldfront.dk
Christoph Groth
2017-11-14 19:13:16 UTC
Permalink
Post by Adam Sjøgren
I did some more systematic tests. The mangling is visible in the
locally saved version of the message, so it's definitely caused locally.
What format do you use for your sent messages folder? nnfolder?
My setup is similar to Eric's. I use nnimap and the backend is a local
dovecot that is synchronized (but that doesn't matter here) using isync.
Post by Adam Sjøgren
The problem does *not* occur if I do not sign the message! It
*does* occur when the message is signed either with an OpenPGP or
with an S/MIME key.
Aha. Maybe that is to avoid the lines starting with "[Ff]rom " being
(potentially) mangled after signing, leaving the signature invalid.
Maybe... In order to debug this, it would be useful to examine the
various steps that lie between pressing C-c C-c and storing the
message. Is "Edebug" the way to go?
Adam Sjøgren
2017-11-14 19:19:40 UTC
Permalink
Post by Christoph Groth
Maybe... In order to debug this, it would be useful to examine the
various steps that lie between pressing C-c C-c and storing the
message. Is "Edebug" the way to go?
edebug-defun is my go-to (but I am no expert in the topic :-))


Best regards,

Adam
--
"Tom has put all my music into this rectangle." Adam Sjøgren
***@koldfront.dk
Eric Abrahamsen
2017-11-14 19:47:44 UTC
Permalink
Post by Adam Sjøgren
Post by Christoph Groth
Maybe... In order to debug this, it would be useful to examine the
various steps that lie between pressing C-c C-c and storing the
message. Is "Edebug" the way to go?
edebug-defun is my go-to (but I am no expert in the topic :-))
What I would do is first find the chain of function calls that sends a
message, and then pick a likely one for edebugging. I started looking at
this yesterday: I thought `message-fix-before-sending' sounded a likely
culprit, but it wasn't to blame. That's as far as I got.
Christoph Groth
2017-11-14 11:26:44 UTC
Permalink
This can possibly boil down to the old e-mail standard for the
"mailbox" format - the old local storage format for incoming mail to a
user (typically in /var/(spool/)mail/liman (in my case). In those
files, messages are separated by a "From ...." line (no colon! not
header!), and in order to not mistake a text line starting with "From
" for a message separator, all "From " lines in a message had to be
Yest that must be indeed the source of the problem, thanks for your
explaination.
One way around this could be to see whether you can append your Python
code as something else than "text/plain", and have it encoded in
Quoted-Printable (or even BASE64), which ought to eliminate the
problem. (Q-P encoding would lead to "From ..." --> "=70rom ...", if I
remember the standard correctly, which I probably don't ;-).
The body of the mbox file I attached to my reply to Adam is encoded in
quoted-printable.

Christoph
Eric Abrahamsen
2017-11-15 19:56:06 UTC
Permalink
The bug occurs when I send an email message with an attachment that is a
Python source file. Lines in that file that begin with "from" (or
perhaps just the first such line), get capitalized, as if they were a
SMTP header. For an example see the message [1] that I've just sent to
a mailing list.
Are you sure Gnus is the program mangling it? It is mangled in your
sent-folder?
I just tried emailing myself an attachment and "from" was untouched -
both in the copy in the sent-folder and the one I received through my
local Postfix. (I tried both with disposition=attachment and inline,
same result).
FWIW, I tried it, and the "from" was capitalized in both the received
and sent version.
Bah, now I can't reproduce it. I have no idea what's going on...

Loading...