Summary: | The "]" character is not accepted for the "astring" grammar rule | ||
---|---|---|---|
Product: | [Unmaintained] trojita | Reporter: | Miguel <migtavares> |
Component: | IMAP | Assignee: | Trojita default assignee <trojita-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | NOR | ||
Version: | 0.4 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/trojita/8c1a01e97e82f0e3db221c05cc4ae5c1e4cc2dc8 | Version Fixed In: | |
Sentry Crash Report: |
Description
Miguel
2014-03-26 20:46:02 UTC
If it helps, here's the relevant part of a tcpdump -i lo port imap -A -l: 21:50:14.621602 IP 127.0.0.1.46709 > 127.0.0.1.imap: Flags [P.], seq 2349126418:2349126500, ack 2578692290, win 1058, options [nop,nop,TS val 404300889 ecr 404268342], length 82 E.....@.@............u.............".z..... ..$Y...6y7 LIST "" "BEST.%" RETURN (SUBSCRIBED CHILDREN STATUS (MESSAGES UNSEEN RECENT)) 21:50:14.625943 IP 127.0.0.1.imap > 127.0.0.1.46709: Flags [P.], seq 1:844, ack 82, win 516, options [nop,nop,TS val 404300893 ecr 404300889], length 843 E....2@.@.`D...........u.......d.....t..... ..$]..$Y* LIST (\Subscribed \HasNoChildren) "." BEST.[Trainers] * STATUS BEST.[Trainers] (MESSAGES 2025 RECENT 0 UNSEEN 0) * LIST (\Subscribed \HasNoChildren) "." "BEST.[Carrer support]" * STATUS "BEST.[Carrer support]" (MESSAGES 90 RECENT 0 UNSEEN 0) * LIST (\Subscribed \HasNoChildren) "." BEST.Aveiro * STATUS BEST.Aveiro (MESSAGES 22 RECENT 0 UNSEEN 0) * LIST (\Subscribed \HasChildren) "." BEST.Coimbra * STATUS BEST.Coimbra (MESSAGES 18348 RECENT 0 UNSEEN 0) * LIST (\Subscribed \HasNoChildren) "." BEST.[Portugal] * STATUS BEST.[Portugal] (MESSAGES 2838 RECENT 0 UNSEEN 0) * LIST (\Subscribed \HasNoChildren) "." BEST.[TrainersHome] * STATUS BEST.[TrainersHome] (MESSAGES 4440 RECENT 0 UNSEEN 0) * LIST (\Subscribed \HasNoChildren) "." BEST.[alumni] * STATUS BEST.[alumni] (MESSAGES 4049 RECENT 0 UNSEEN 0) y7 OK List completed. 21:50:14.625969 IP 127.0.0.1.46709 > 127.0.0.1.imap: Flags [.], ack 844, win 1089, options [nop,nop,TS val 404300893 ecr 404300893], length 0 ...A.(...............u.....d... ..$]..$] 21:50:14.686698 IP 127.0.0.1.46709 > 127.0.0.1.imap: Flags [P.], seq 82:93, ack 844, win 1089, options [nop,nop,TS val 404300954 ecr 404300893], length 11 ...A.3...............u.....d... ..$...$]y8 LOGOUT 21:50:14.687072 IP 127.0.0.1.imap > 127.0.0.1.46709: Flags [P.], seq 844:888, ack 93, win 516, options [nop,nop,TS val 404300954 ecr 404300954], length 44 ...o.....T.............u... ..$...$.* BYE Logging out y8 OK Logout completed. 21:50:14.687091 IP 127.0.0.1.46709 > 127.0.0.1.imap: Flags [.], ack 888, win 1089, options [nop,nop,TS val 404300954 ecr 404300954], length 0 E..4..@.@............u.....o...9...A.(..... ..$...$. 21:50:14.687327 IP 127.0.0.1.imap > 127.0.0.1.46709: Flags [F.], seq 888, ack 93, win 516, options [nop,nop,TS val 404300954 ecr 404300954], length 0 E..4.4@.@.c............u...9...o.....(..... ..$...$. 21:50:14.696904 IP 127.0.0.1.46709 > 127.0.0.1.imap: Flags [F.], seq 93, ack 889, win 1089, options [nop,nop,TS val 404300964 ecr 404300954], length 0 E..4..@.@............u.....o...:...A.(..... ..$...$. 21:50:14.696927 IP 127.0.0.1.imap > 127.0.0.1.46709: Flags [.], ack 94, win 516, options [nop,nop,TS val 404300964 ecr 404300964], length 0 E..4.5@.@.c............u...:...p.....(..... ..$...$. What version of Dovecot is this? The "]" character is forbidden to be sent using the atom syntax as per RFC 3501, so it seems that the bug is in Dovecot in this case. Oops, I got confused because of the ATOM-CHAR = <any CHAR except atom-specials> rule. The "]" character is explicitly allowed in an "astring" via the resp-specials production. Patch under review at https://git.reviewboard.kde.org/r/117105/ . dovecot version: 2.2.9 Nice to see a patch show up so fast. Thx. Tried the fix proposed and it works. Git commit 8c1a01e97e82f0e3db221c05cc4ae5c1e4cc2dc8 by Jan Kundrát. Committed on 26/03/2014 at 23:12. Pushed by jkt into branch 'master'. IMAP: allow ']' when parsing an astring The IMAP code would by mistake reject tokens that contain a resp-special character ']' when asked for parsing astrings. This was because the of the rule: ATOM-CHAR = <any CHAR except atom-specials> rule ...which confused me enough so that I ignored an explicit allowance for the resp-specials earlier in the ASTRING-CHAR rule. Thanks to Miguel <migtavares@gmail.com> (DeviantPeer on IRC) for reporting this. Sorry for the trouble. REVIEW: 117105 M +26 -3 src/Imap/Parser/LowLevelParser.cpp M +1 -0 src/Imap/Parser/LowLevelParser.h M +21 -0 tests/Imap/test_Imap_LowLevelParser.cpp http://commits.kde.org/trojita/8c1a01e97e82f0e3db221c05cc4ae5c1e4cc2dc8 |