Check Yahoo Mail with IMAP and Oauth

Good morning,

I manage to connect to Yahoo mail using pure IMAP (user/pass) but I would like to know if it's possible to check Yahoo mails with IMAP and Oauth (like Gmail allows). I I read some threads and is not clear to me if I can.

Anyone knows?

Thanks in advance!

14 Replies
  • By the way, I need to get the full raw mail messages from my inbox.

  • Hi, nobody will answer You because nobody from even Yahoo is looking here. I wrote in last week post and they had deleted it. This is crap support.
  • What a pitty, I don't know where to ask then.

    Thanks anyway Szymon!!!
  • Nicolas,

    Can you explain what you are trying to do in more detail?  I am not sure if you are merely trying to retrieve your email via an email client or if you are wanting to work the Mail API.  Thanks,
  • 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!
  • By the way, this is the right code for connecting to common yahoo imap (user/pass)
    conn = Net::IMAP.new('imap.mail.yahoo.com', 143, false)
    conn.authenticate('LOGIN', "MAIL_ADDRESS", "MAIL_PASSWORD" )
    messages_count = conn.status('INBOX', ['MESSAGES'])['MESSAGES']
    puts "Seeing #{messages_count} messages in INBOX"

  • Hi,

    I had exactly the same question than Nicolas : yes Yahoo! implements OAUTH, yes Yahoo! implements a web services/REST API to access mailboxes, but does Yahoo! implement a SASL mechanism to be used with OAUTH in order to integrate OAUTH in IMAP & SMTP ?

    So, I tried to connect to the IMAP/SSL server at Yahoo! and tried a command like "C01 AUTHENTICATE OAUTH [...RANDOM_CREDENTIALS...]" : I have had an error message about the credentials, not about an incorrect command name ! That means that IMAP servers at Yahoo are OAUTH capable (even if it is not included in the capability string answered by the IMAP servers).

    So, the question is now : what sort of variant of IMAP/SASL + OAUTH have you implemented at Yahoo!, guys ?
    You could have implemented XOAUTH : OAUTH1.0 + SASL, or one of the many draft RFCs about AUTH2.0 + SASL, so please explain and give us the URL string needed to be signed in order to convert an OAUTH access token and a Yahoo! email / login to the credential string in "AUTHENTICATE OAUTH" commands.

    In order to implement a client, we need to know those details. Today, with the current documentation, we are obliged to make requests though your Web Services / REST mail API... Please, be open.

    Many many thanks,
  • Hi Alexandre. Thanks for your feedback.

    I didn't do that test and is good to know that there is some kind of oauth support. But well, we should wait for the documentation to appear!

    By now, I was force to use web services calls, and as I need the raw mails I had to make them from scratch with different calls to ListFolders, GetMessageHader, DownloadAttachment, etc. All of that could have been voided if the IMAP documentation had been available hehe

  • We don't support IMAP over OAUTH. You need to use our Webservice APIs. Thanks.

  • Are there plans to support OAUTH for IMAP?

  • Now even Outlook support OAuth for IMAP http://blogs.office.com/b/microsoft-outlook/archive/2013/09/12/outlook-com-now-with-imap.aspx. Gmail has been already supporting this for a while. When does yahoo plans to support OAuth over IMAP?

  • Any update on this? Forcing a user to put their email/password rather than clicking one button to use Oauth is a significant barrier to entry for a lot of users. We are looking to bring Yahoo mail support to our app


    However exchange is going to be next on the list until Yahoo allows utilizing Imap via Oauth.

  • Joe: Much has happened between 2012 when this thread opened and 2014 that you responded. Not only does yahoo support OAuth, it is the recommended method for their API: https://developer.yahoo.com/mail/docs/user_guide/

  • Yahoo does support OAuth but for their web api. Could not find a way to do this with IMAP. I also need it!

  • Hi,

    I am trying to get the user profile using rest api specified in the following site.https://developer.yahoo.com/oauth/guide/oauth-make-request.html but i am getting the {"error":{"@lang":"en-US","@uri":"http://yahoo.com","description":"Please provide valid credentials. OAuth oauth_problem=\"OST_OAUTH_SIGNATURE_INVALID_ERROR\", realm=\"yahooapis.com\"","detail":"Please provide valid credentials. OAuth oauth_problem=\"OST_OAUTH_SIGNATURE_INVALID_ERROR\", realm=\"yahooapis.com\""}} error. why it's giving this error?


Recent Posts

in Yahoo! Mail Web Services API