I would find it much easier to work with if net/imap.rb were split into several files. Would a patch like that be welcome and accepted? Just let me know, and I'll submit a PR right away (and if it's accepted, I'll rebase all existing PRs on it).
e.g:
net/imap/response_parser.rb for Net::IMAP::ResponseParser
net/imap/response_data.rb for the response data Structs (e.g. TaggedResponse, FetchData, MailboxList, etc)
net/imap/command_data.rb for all of the #send_data/#validate classes (like Atom, Literal, QuotedString, etc)
net/imap/authenticators.rb
net/imap/authenticators/{cram_md5,login,plain} etc