I have an email with the following message in my Gmail:
"400, value, value"
Here is the code I use to capture mail:
imap = Net::IMAP.new('imap.gmail.com', 993, true, nil, false) imap.login(LOGIN, PASSWORD) imap.select("INBOX") messages = imap.search(['ALL']).map do |message_id| msg =imap.fetch(message_id, "ENVELOPE")[0].attr["ENVELOPE"] result = {:mailbox => msg.from[0].mailbox, :host => msg.from[0].host, :subject => msg.subject, :created_at => msg.date} imap.store(message_id, "+FLAGS", [:Deleted]) result end imap.expunge() imap.logout
In msg.subject, I have the following value: "=? KOI8-R? B? MTAwLCDixc7ayc4sIDMwMDAgzMnU0s / X? ="
IMAP did not seem to decrypt it. Should I do this manually or the IMAP library for me?
source share