3

I am using ruby 1.9.3 for validating the email credentials using "net/imap" library. If I try to use the following code in rails console it works :-

imap = Net::IMAP.new('imap.aol.com')
imap.authenticate('LOGIN', "username@aol.com".split("@").first, "password")

But when I use it in Rails application it gives me an error :-

Specified SASL mechanism not supported.

This happens only in case of AOL, yahoo is working in both console and rails app.

Does anyone have in insight what it could be.

Thanks

Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39
  • AOL doesn't support SASL Login. How about using just plain LOGIN (not SASL). – Max Dec 10 '13 at 16:06
  • AOL's capability string: `* CAPABILITY IMAP4rev1 UIDPLUS ID NAMESPACE LOGIN-REFERRALS IDLE STARTTLS AUTH=XAOL-UAS-MB AUTH=OAUTH2 STARTTLS` – Max Dec 10 '13 at 16:07

1 Answers1

6

I used imap.login in place of imap.authenticate. It worked like a charm.

imap.login('user', 'passwd')
Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39