Skip to content

Commit

Permalink
✅ Document and test workaround for #228
Browse files Browse the repository at this point in the history
The workaround for #241 (PR #246) also applies to #228.

The upstream issue (greenmail-mail-test/greenmail#633) was fixed
promptly (thanks!).  Also, greenmail is a testing fake server and I
haven't seen any evidence of any "real" servers with this exact error
yet.  So I don't feel that it's critical to be compatible with it...
But we _do_ need this workaround for #241.  So it makes sense to at
least document this issue in our test fixtures, for posterity.
  • Loading branch information
nevans committed Dec 12, 2023
1 parent 4036509 commit d3c40cd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/net/imap/response_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1929,6 +1929,8 @@ def flag_perm__list
end
end

# This allows illegal "]" in flag names (Gmail),
# or "\*" in a FLAGS response (greenmail).
def quirky__flag_list(name)
match_re(Patterns::QUIRKY_FLAGS_LIST, "quirks mode #{name}")[1]
.scan(Patterns::QUIRKY_FLAG)
Expand Down
18 changes: 18 additions & 0 deletions test/net/imap/fixtures/response_parser/quirky_behaviors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,21 @@
$Junk $MailFlagBit0 $MailFlagBit2 $NotJunk $NotPhishing $Phishing Forwarded
JunkRecorded NotJunk OIB-Seen-INBOX OIB-Seen-Unsubscribe OIB-Seen-[Google
Mail]/Alle Nachrichten)\r\n"

"greenmail sent \"\\*\" in a FLAGS response":
comment: |
Greenmail did fix theit bug very quickly after it was reported. :)
Upstream issue: https://github.com/greenmail-mail-test/greenmail/issues/633
net-imap issue: https://github.com/ruby/net-imap/issues/228
:response: "* FLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen \\*)\r\n"
expect_rescued_error: true
:expected: !ruby/struct:Net::IMAP::UntaggedResponse
name: FLAGS
data:
- :Answered
- :Deleted
- :Draft
- :Flagged
- :Seen
- :*
raw_data: "* FLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen \\*)\r\n"

0 comments on commit d3c40cd

Please sign in to comment.