Ticket #1443 defect new

Opened 7 years ago

Last modified 3 years ago

[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

imap4_quote.diff Download (0.6 KB) - added by therve 7 years ago.
test_imap_quote.diff Download (0.6 KB) - added by therve 7 years ago.

Change History

1

Changed 7 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 7 years ago by therve

2

Changed 7 years ago by therve

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

Changed 7 years ago by therve

3

Changed 7 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.

4

Changed 4 years ago by khorn

  • cc khorn added

5

Changed 3 years ago by biny

  • cc iny+dev@… added

6

Changed 3 years ago by exarkun

  • priority changed from high to normal

7

Changed 2 years ago by <automation>

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