Opened 12 years ago

Last modified 7 years ago

#1443 defect new

[imap4] mismatched quoting spuriously raised

Reported by: jojo Owned by:
Priority: normal Milestone:
Component: mail Keywords:
Cc: Jean-Paul Calderone, jojo, therve, khorn, Ilpo Nyyssönen Branch:
Author:

Description


Attachments (2)

imap4_quote.diff (612 bytes) - added by therve 12 years ago.
test_imap_quote.diff (633 bytes) - added by therve 12 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 12 years ago by jojo

A MismatchedQuoting is raised when there is a mismatched quoting (e.g.) in the
subject of a mail, even if the server returns a correctly escaped string.

In my case, the server returns (in the middle of a correct FETCH ENVELOPE
response) something like

 "foo bar \" baz quux"

as the subject.

The reason for the exceptoin seems to be that parseNestedParens() removes the
escape character "\", but splitQuoted() (called in collapseStrings()) would need
it to split the string correctly (code handling escaped quotes needs then to be
added to splitQuoted()).

I'm sorry, but for the moment I am rather short of time, so I am not able to
contribute a patch or a test that would trigger the exception. In a few weeks
I'll have another look at the problem if no one has fixed it in the meantime.

-jojo

Changed 12 years ago by therve

Attachment: imap4_quote.diff added

comment:2 Changed 12 years ago by therve

Good catch, but not easy to handle, because '"' == '\"'. Attached a patch adding
a test and making it naively works.

Changed 12 years ago by therve

Attachment: test_imap_quote.diff added

comment:3 Changed 12 years ago by Jean-Paul Calderone

Urrgggggg this is really hard. I can't see any solution other than rewriting parseNestedParens completely, and I am not yet feeling up to that task.

splitOn and collapseStrings are horribly sucktastic as well. I think they should be gotten rid of.

comment:4 Changed 8 years ago by khorn

Cc: khorn added

comment:5 Changed 7 years ago by Ilpo Nyyssönen

Cc: Ilpo Nyyssönen added

comment:6 Changed 7 years ago by Jean-Paul Calderone

Priority: highnormal

comment:7 Changed 7 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.