Re: Gnus capitalizes non-header "from"

2017-11-13 Thread Adam Sjøgren
Christoph writes:

> 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).

Let me try attaching it here, and we'll see what happens (maybe my email
gets rejected :-))


  Best regards,

Adam

-- 
 "Efter 90?"  Adam Sjøgren
 "89"a...@koldfront.dk
 "Efter 89 blev det faste pladser. Kopper med navn på."

import kwant, numpy
from math import cos, sin
import matplotlib.pyplot as plt

lat = kwant.lattice.square()
___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-13 Thread Eric Abrahamsen
a...@koldfront.dk (Adam Sjøgren) writes:

> Christoph writes:
>
>> 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.


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-13 Thread Adam Sjøgren
Eric writes:

>> 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).

I would guess that storage formats that have more than one email per
file need to "escape" lines starting with "From " (as that is the
separator), and maybe something then happens to lines starting with
"from " as well?

If you view the raw article, what does the line look like then?

 o o o

Interestingly my attachment here was unmangled! What happens if you do a
similar attachment to your next follow-up here?


  Best regards,

Adam

-- 
 "Repetition is the death of magic."  Adam Sjøgren
 a...@koldfront.dk


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Lars-Johan Liman
e...@ericabrahamsen.net:
> a...@koldfront.dk (Adam Sjøgren) writes:

>> Christoph writes:
>> 
>>> 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.

(Without having gone through your testing, and not knowing to which
detail you're familiar with the mail standards, so please excuse is this
is too basic:)

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 "quoted",
typically with a ">" leading to text like this:

   text text text text text text text text text text 
   text text text text text text text text text text 

   >From this day on, I had to write everything using the
   Comic Sans font, and I was very upset with my editor ...

Mail user agents typically convert this back to "From ..." when showing
a message, but as you undoubtedly realise, there is ample room for
mistakes here. One bug is to also "quote" lower case "from ..." to
">from ..." or even ">From ...", and/or when converting back make
another mistake ">from ..." --> "From ...".

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 ;-).

Then again, I could be completely off here. I usuaslly am ... ;-)

Cheers,
  /Liman
#-
# Lars-Johan Liman, M.Sc.! E-mail: li...@cafax.se
# Cafax AB   ! HTTP  : //www.cafax.se/
# Computer Consultants, Sweden   ! Voice : +46 8 - 564 702 30
#-

___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Christoph Groth
Adam Sjøgren wrote:
> Eric writes:
>
> >> 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!

Thanks for your interest!

I did some more systematic tests.  The mangling is visible in the
locally saved version of the message, so it's definitely caused locally.
Moreover, the mangling seems to simply affect all the lines that begin
with a lower-case "from ", also in the main body.

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.

> Difference in versions? In storage type?
>
> (GNU Emacs 27.0.50 built from
> a7b7b85567f766ff510a5eaaaf32dbbbec15efd0, nnml).

GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of
2017-09-12 on hullmann, modified by Debian

It's not a new problem, I remember seeing it for the first time years
ago.

> I would guess that storage formats that have more than one email per
> file need to "escape" lines starting with "From " (as that is the
> separator), and maybe something then happens to lines starting with
> "from " as well?

It seems indeed have something to do with it, and not with SMTP headers.

> If you view the raw article, what does the line look like then?

I attach the pristine mbox file of a sent message (saved directly from
Gnus with 'o').  I only removed the host parts of email addresses.  The
MD5 sum of the attached file is ec7588fe8704b1d48aba09976894bc2e.

I am signing this mail, so let's see what will happen:
From this time forward, you will service us.

Christoph


mbox
Description: Binary data


signature.asc
Description: PGP signature
___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Christoph Groth
Lars-Johan Liman wrote:

> 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
> "quoted", typically with a ">" leading to text like this:

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


signature.asc
Description: PGP signature
___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Adam Sjøgren
Christoph writes:

> 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." a...@koldfront.dk


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Eric Abrahamsen
a...@koldfront.dk (Adam Sjøgren) writes:

> Eric writes:
>
>>> 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.


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Christoph Groth
Adam Sjøgren wrote:
>
> > 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.

> > 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?


signature.asc
Description: PGP signature
___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Adam Sjøgren
Christoph writes:

> 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
 a...@koldfront.dk


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-14 Thread Eric Abrahamsen
a...@koldfront.dk (Adam Sjøgren) writes:

> Christoph writes:
>
>> 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.


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: Gnus capitalizes non-header "from"

2017-11-15 Thread Eric Abrahamsen
Eric Abrahamsen  writes:

> a...@koldfront.dk (Adam Sjøgren) writes:
>
>> Christoph writes:
>>
>>> 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...


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english