Skip to content

Commit e02f9cb

Browse files
authored
🔀 Merge pull request #748 from OskarEichler/codex/empty-status-imap
Parse STATUS responses with empty attribute lists
2 parents d3d2a3f + 7126996 commit e02f9cb

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/net/imap/response_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ def thread_nested
16761676
def mailbox_data__status
16771677
resp_name = label("STATUS"); SP!
16781678
mbox_name = mailbox; SP!
1679-
lpar; attr = status_att_list; rpar
1679+
lpar; attr = peek_rpar? ? {} : status_att_list; rpar
16801680
UntaggedResponse.new(resp_name, StatusData.new(mbox_name, attr), @str)
16811681
end
16821682

test/net/imap/fixtures/response_parser/status_responses.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
UIDVALIDITY: 1234
2626
raw_data: "* STATUS INBOX (UIDNEXT 1 UIDVALIDITY 1234)\r\n"
2727

28+
test_status_response_empty_attribute_list:
29+
:response: "* STATUS INBOX ()\r\n"
30+
:expected: !ruby/struct:Net::IMAP::UntaggedResponse
31+
name: STATUS
32+
data: !ruby/struct:Net::IMAP::StatusData
33+
mailbox: INBOX
34+
attr: {}
35+
raw_data: "* STATUS INBOX ()\r\n"
36+
2837
test_invalid_status_response_trailing_space:
2938
:comments: |
3039
[Bug #13649]

0 commit comments

Comments
 (0)