Bug #1496: Net::IMAP#fetch incorrectly quotes message data item names
http://redmine.ruby-lang.org/issues/show/1496

Author: Eric Hodel
Status: Open, Priority: Normal
ruby -v: ruby 1.9.2dev (2009-05-20 trunk 23493) [i386-darwin9.7.0]

The following code:

imap.fetch uids, ['BODY.PEEK[HEADER.FIELDS (SUBJECT MESSAGE-ID)]', 'FLAGS']

incorrectly quotes the BODY.PEEK section, resulting in an error:

C: RUBY0005 FETCH 1 ("BODY.PEEK[HEADER.FIELDS (SUBJECT MESSAGE-ID)]" FLAGS)
S: RUBY0005 BAD Error in IMAP command FETCH: FETCH list contains non-atoms.

The attached patches fix this:

C: RUBY0005 FETCH 1 (BODY.PEEK[HEADER.FIELDS (SUBJECT MESSAGE-ID)] FLAGS)
S: * 1 FETCH (FLAGS (\Seen IMAP_TO_RSS) BODY[HEADER.FIELDS (SUBJECT MESSAGE-ID)] {137}
S: Message-ID: <message_id / mail.example.com>
S: Subject: Subject goes here
S: 
S: )

Patches attached for trunk and ruby_1_8 branches

If you'd like, I can apply these myself.


----------------------------------------
http://redmine.ruby-lang.org