On Tue, Jul 23, 2019 at 02:19:27PM -0500, David Wright wrote:
> On Tue 23 Jul 2019 at 11:07:37 (-0400), Greg Wooledge wrote:
> > Yup.  Two NUL bytes in the body of the message.  How completely bizarre.
> > 
> > Apparently what mutt does is truncate that *line* at the first NUL
> > byte, but then show all the other lines after that just fine.

> I don't see any NUL characters, but x80 as shown below. I'm reading
> the cached message that mutt downloaded from an IMAP server. Is that
> different from you?

In my case, the email is sent first to a Debian 9 system running qmail +
magic-smtpd (with possible interference from corporate firewall products
over which I have no control), and from there to my Debian 10 desktop
system, also running qmail, with qmail-smtpd as the receiver.  Mail is
delivered locally on the Debian 10 system to a Maildir in my home
directory, and mutt reads it directly from there.  No IMAP or POP3 for me.

I'll try to remember to keep a copy of the next one for hex-dumping.

Meanwhile, as a test, I ran the following from my home system outside
the workplace firewall:

printf 'Testing \0nul\0\nDid it work?\n' | mailx -s test wool...@eeg.ccf.org

Here's what hd shows (last few lines only):

00000370  38 22 0a 43 6f 6e 74 65  6e 74 2d 54 72 61 6e 73  |8".Content-Trans|
00000380  66 65 72 2d 45 6e 63 6f  64 69 6e 67 3a 20 38 62  |fer-Encoding: 8b|
00000390  69 74 0a 0a 54 65 73 74  69 6e 67 20 0a 44 69 64  |it..Testing .Did|
000003a0  20 69 74 20 77 6f 72 6b  3f 0a                    | it work?.|
000003aa

Which probably means mailx on my sender truncates the line with the
raw NUL bytes, and the test is inconclusive.

So, next test:

printf 'Test two \0nul\0\nDid it work?\n' | mutt -s test wool...@eeg.ccf.org

Here's what I got:

000003b0  73 66 65 72 2d 45 6e 63  6f 64 69 6e 67 3a 20 71  |sfer-Encoding: q|
000003c0  75 6f 74 65 64 2d 70 72  69 6e 74 61 62 6c 65 0a  |uoted-printable.|
000003d0  58 2d 4f 70 65 72 61 74  69 6e 67 2d 53 79 73 74  |X-Operating-Syst|
000003e0  65 6d 3a 20 4c 69 6e 75  78 20 34 2e 31 39 2e 30  |em: Linux 4.19.0|
000003f0  2d 35 2d 61 6d 64 36 34  0a 55 73 65 72 2d 41 67  |-5-amd64.User-Ag|
00000400  65 6e 74 3a 20 4d 75 74  74 2f 31 2e 31 30 2e 31  |ent: Mutt/1.10.1|
00000410  20 28 32 30 31 38 2d 30  37 2d 31 33 29 0a 0a 54  | (2018-07-13)..T|
00000420  65 73 74 20 74 77 6f 20  3d 30 30 6e 75 6c 3d 30  |est two =00nul=0|
00000430  30 0a 44 69 64 20 69 74  20 77 6f 72 6b 3f 0a     |0.Did it work?.|
0000043f

... well, that's self-explanatory, isn't it.  I don't feel like writing
a script to send raw NUL bytes through /usr/sbin/sendmail or through
netcat mxhost 25 at this time, so I'll just leave it at that.

Reply via email to