Opened 9 years ago

Last modified 4 years ago

#1443 defect new

[imap4] mismatched quoting spuriously raised

Reported by: jojo Owned by:
Priority: normal Milestone:
Component: mail Keywords:
Cc: exarkun, jojo, therve, khorn, iny+dev@… Branch:
Author: Launchpad Bug:

Description


Attachments (2)

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

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 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 9 years ago by therve

comment:2 Changed 9 years ago by therve

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

Changed 9 years ago by therve

comment:3 Changed 8 years ago by exarkun

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 5 years ago by khorn

  • Cc khorn added

comment:5 Changed 4 years ago by biny

  • Cc iny+dev@… added

comment:6 Changed 4 years ago by exarkun

  • Priority changed from high to normal

comment:7 Changed 4 years ago by <automation>

  • Owner exarkun deleted
Note: See TracTickets for help on using tickets.