Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMAP API is unable to connect to Office365's IMAP server #10

Closed
nisanthchunduru opened this issue May 2, 2020 · 2 comments
Closed

IMAP API is unable to connect to Office365's IMAP server #10

nisanthchunduru opened this issue May 2, 2020 · 2 comments

Comments

@nisanthchunduru
Copy link
Contributor

Hi @andris9,

IMAP API is unable to connect to Office365's IMAP server.

When I add a outlook.com email address to IMAP API

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'localhost:13000/v1/accounts',
  'headers': {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({"account":"nisanth074@outlook.com","name":"nisanth074@outlook.com","imap":{"host":"outlook.office365.com","port":993,"secure":true,"useAuthServer":true},"smtp":{"host":"smtp.office365.com","port":587,"secure":true,"useAuthServer":true}})

};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body);
});

IMAP API was unable to authenticate because it couldn't find a supported authentication mechanism

2020-05-02 at 2 12 PM

Outlook's IMAP server only has the AUTH=PLAIN and the AUTH=XOAUTH2 capabilities

require "net/imap"
imap = Net::IMAP.new('outlook.office365.com', 993, usessl = true, certs = nil, verify = false)
imap.capability

I opened a pull request that adds support for the XOAUTH2 authentication mechanism to imapflow
postalsys/imapflow#17

Would you like to merge my change?

Thanks for your time.

@andris9
Copy link
Collaborator

andris9 commented May 2, 2020

I bumped imapflow version so this should be fixed 13f42f2

@nisanthchunduru
Copy link
Contributor Author

@andris9 Thanks! There's more to this though. outlook's OAuth access tokens are lengthy. 512 characters are insufficient. I've opened a pull to increase the accessToken's length #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants