Hi duzins.
I'm trying to download raw mails including attachments with a ruby service through plain IMAP (or mail API if i can't) with oauth authentication. Is important to note I need the raw mails for custom processing.
For example with gmail, I can download raw mails trough IMAP and Oauth authentication like this.
imap = Net::IMAP.new('imap.gmail.com', 993, usessl = true, certs = nil, verify = false)
imap.authenticate('XOAUTH', MAIL_ADDRESS', :consumer_key => 'CONSUMER_KEY',
:consumer_secret => 'CONSUMER_KEY', :token => 'TOKEN', :token_secret => 'TOKEN_SECRET'
)
messages_count = imap.status('INBOX', ['MESSAGES'])['MESSAGES']
puts "Seeing #{messages_count} messages in INBOX"
But this type of IMAP authentication is custom to gmail, and I don't know if apply to yahoo service (if yahoo IMAP provide Oauth support).
Of course I could check mails with common IMAP with user/pass like this and it works.
conn = Net::IMAP.new('imap.gmail.com', 993, true, nil, false)
conn.login("MAIL_ADDRESS", "MAIL_PASSWORD")
messages_count = conn.status('INBOX', ['MESSAGES'])['MESSAGES']
puts "Seeing #{messages_count} messages in INBOX"
But as I say, I need to use Oauth.
If yahoo IMAP doesn't provide this type of authentication I would use mail service API, but I don't found a way to download full raw mails with attachments.
Thanks in advance!