nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] 2047 bug (with test), but I have no fix


From: Eric Gillespie
Subject: [Nmh-workers] 2047 bug (with test), but I have no fix
Date: Mon, 02 Nov 2009 22:28:08 -0800

This is the latest bogosity from Gmail.  A guy configures his
from name as "Jim [ a guy ]" (actually it has non-Latin
characters, too, but that's not important for testing the bug)
and Gmail 2047-encodes that entire string, with no quotes.
repl doesn't like it:

repl: bad addresses:
       Jim [ a guy ] <address@hidden> -- missing mailbox ([ a guy ])

Of course it's invalid; it would need quotes.  What I can't
figure out is where mh should add the quotes (not interested in
arguments over whether Gmail is sending out garbage; we lost that
war long ago).

It seems to me it has to be an optional feature of decode_2047,
because the FT_LS_DECODE handler in fmt_scan.c doesn't have
enough information.  Since it can't parse the string, it can't
know where the quotes should go.

Thoughts?

Here's a simple test case to show the problem; plop it into
tests/repl/test-over2047 and it comes out like this:

0 test% ./runtest tests/repl/test-over2047
--- /tmp/nmh-test-koU16395/28487.expected       2009-11-02 22:19:39.000000000 
-0800
+++ /tmp/nmh-test-koU16395/Mail/draft   2009-11-02 22:19:39.000000000 -0800
@@ -1,4 +1,6 @@
-To: "Jim [ a guy ]" <address@hidden>
+To: 
 
+repl: bad addresses:
+       Jim [ a guy ] <address@hidden> -- missing mailbox ([ a guy ])
 Jim [ a guy ] writes:
 > This is message number 10
Test tests/repl/test-over2047 FAIL



#!/bin/sh

# create test replgroupcomps
form=$MH_TEST_DIR/$$.replgroupcomps
cat > $form <<EOF
%(lit)%(formataddr{reply-to})\
%(formataddr %<{from}%(void(decode{from}))%|%(void(decode{apparently-from}))%>)\
%(formataddr{resent-to})\
%(formataddr{prev-resent-to})\
%(formataddr{x-to})\
%(formataddr{apparently-to})\
%(void(width))%(putaddr To: )
EOF

# create test message with 2047-encoded "Jim [ a guy ]"
cat > $MH_TEST_DIR/Mail/inbox/10 <<EOF
From: =?UTF-8?b?SmltIFsgYSBndXkgXQ==?= <address@hidden>
To: Some User <address@hidden>
Date: Fri, 29 Sep 2006 00:00:00
Subject: Testing message 10

This is message number 10
EOF

expected=$MH_TEST_DIR/$$.expected
actual=$MH_TEST_DIR/Mail/draft

cat > $expected <<EOF
To: "Jim [ a guy ]" <address@hidden>

Jim [ a guy ] writes:
> This is message number 10
EOF

repl -editor true -format -form $form -group -nocc me -nowhatnowproc 10

diff -u $expected $actual




reply via email to

[Prev in Thread] Current Thread [Next in Thread]