[bug #20074] extra space in subject

View: New views
4 Messages — Rating Filter:   Alert me  

[bug #20074] extra space in subject

by Mario Castelán Castro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


URL:
  <http://savannah.nongnu.org/bugs/?20074>

                 Summary: extra space in subject
                 Project: MHonArc
            Submitted by: egmont
            Submitted on: Monday 06/04/2007 at 18:17
                Category: Mail Parsing
                Severity: 3 - Normal
              Item Group: Incorrect Behavior
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: Linux
            Perl Version: 5.8.8
       Component Version: 2.6.16
           Fixed Release:

    _______________________________________________________

Details:

I've just upgraded from an ancient sympa to 5.3 and this one runs mhonarc
with different arguments. The relevant part is:
<TextEncode>
utf-8; MHonArc::UTF8::to_utf8; MHonArc/UTF8.pm
</TextEncode>

I've just noticed a bug that we haven't faced before: in plenty of subjects
an extra space or tab character is inserted somewhere in the middle of a
word. For example a mail with subject "Blah Bláh Foobar" that was correctly
displayed so far might now be displayed as "Blah Bláh Foob ar".

This happens when mail clients encode the long accented subject using
=?x?Q?...?= or =?x?B?...?= notation. In this case they can wrap into a new
physical line everywhere, even in the middle of a word. For example, the raw
mailbox file might look like this:
Subject: =?utf-8?Q?Blah_Bl=C3=A1h_Foob?=
        =?utf-8?Q?ar?=

In this case mhonarc preserves the space or tab at the beginning of the new
line as if it was part of the subject, though it should drop it. If there is
actually a space then mail clients explicitely mention it within one of the
=?.?.?...?= blocks.

Ugly but forks-for-me patch attached, I hope it doesn't have negative side
effects. I haven't read and understood all the details of rfc 1522 and
friends, this patch just happens to work for this situation. I bet you'll
have a better solution :-)




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Monday 06/04/2007 at 18:17  Name:
mhonarc-2.6.16-header-extra-space.patch  Size: 2kB   By: egmont

<http://savannah.nongnu.org/bugs/download.php?file_id=12947>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20074>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/

---------------------------------------------------------------------
To sign-off this list, send email to majordomo@... with the
message text UNSUBSCRIBE MHONARC-DEV


[bug #20074] extra space in subject

by Mario Castelán Castro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #1, bug #20074 (project mhonarc):

I update a patch. Now it seems to me (looking at more mailbox files) that the
space should be dropped only if the previous line ends with a rfc1522-encoded
component _and_ the new line starts with another rfc1522 block.


(file #12955)
    _______________________________________________________

Additional Item Attachment:

File name: mhonarc-2.6.16-header-extra-space-v2.patch Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20074>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/

---------------------------------------------------------------------
To sign-off this list, send email to majordomo@... with the
message text UNSUBSCRIBE MHONARC-DEV


[bug #20074] extra space in subject

by Mario Castelán Castro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #2, bug #20074 (project mhonarc):

I think the correct and elegant solution would be to first concatenate raw
header fields that belong together, and then decode the result with
MAILdecode_1522_str.
MAILdecode_1522_str already takes care of dropping the space or tab if it's
surrounded by two =?...?= blocks, so it would drop the leading space or tab
of a physical mailbox line if and only if it should really be dropped.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20074>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/

---------------------------------------------------------------------
To sign-off this list, send email to majordomo@... with the
message text UNSUBSCRIBE MHONARC-DEV


[bug #20074] extra space in subject

by Mario Castelán Castro :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #3, bug #20074 (project mhonarc):

First, you could PLEASE resubmit your latest patch.
I had a brain fart and accidently deleted it from this
bug item.

Second, would you provide example data that illustrates
the problem?

One thing is to modify behavior according to what is
seen in the "wild" versus what the standard state about
this.  The core mail specs and the MIME specs come into
play about how to deal with line folding and extra spaces,
and I would have refresh my memory on how things should
work.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20074>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/

---------------------------------------------------------------------
To sign-off this list, send email to majordomo@... with the
message text UNSUBSCRIBE MHONARC-DEV