title: How can Yahoo Mail be accessed by IMAP using OAuth or OAuth2 authentication
body: <p>According to developer.yahoo.com/mail/ and IMAP responses:</p>
  
  <pre><code>* OK [CAPABILITY IMAP4rev1 ID MOVE NAMESPACE X-ID-ACLID UIDPLUS LITERAL+ CHILDREN XAPPLEPUSHSERVICE XYMHIGHESTMODSEQ AUTH=PLAIN AUTH=LOGIN AUTH=XOAUTH2 AUTH=XYMCOOKIE AUTH=XYMECOOKIE AUTH=XYMCOOKIEB64 AUTH=XYMPKI] IMAP4rev1 imapgate-1.8.1_01.20166 imap1009.mail.ne1.yahoo.com
  </code></pre>
  
  <p>Yahoo Mail can be accessed by IMAP using OAuth(2) authentication.</p>
  
  <p>I registered my app on <a href="https://developer.yahoo.com/apps/" rel="noreferrer">https://developer.yahoo.com/apps/</a> so I have got Client ID and Client Secret. I didn't find any scopes(API Permissions) related to Mail. Nevertheless I selected all API Permissions which were presented when I registered my app.</p>
  
  <p>I tried to implement both OAuth and OAuth2.</p>
  
  <p>OAuth2:
  I cannot get the authorization code for scope "mail-r". When I generate URL(<a href="https://api.login.yahoo.com/oauth2/request_auth?client_id=CLIENT_ID&amp;redirect_uri=oob&amp;scope=mail-r&amp;response_type=code" rel="noreferrer">https://api.login.yahoo.com/oauth2/request_auth?client_id=CLIENT_ID&amp;redirect_uri=oob&amp;scope=mail-r&amp;response_type=code</a>) and open it in browser, the page with text "Developers: Please request scope from registered scopes and submit again." is displayed. It works for other scopes. For example, I'm able to get the authorization code for "sdct-r"</p>
  
  <p>OAuth:
  I'm able to get an access token. But when I send it with AUTHENTICATE XOAUTH2 command, I get "NO [AUTHENTICATIONFAILED] (#AUTH007) Bad scope" response.</p>
  
  <p>So questions is what scope(s) should be set to access Yahoo Mail using IMAP and OAuth(2)?</p>