[ 
https://issues.apache.org/jira/browse/CAMEL-18623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeff updated CAMEL-18623:
-------------------------
    Description: 
Camel mail component does not appear to work with OAuth2. This seems clear from 
the lack of documentation or unit tests regarding OAuth2, but having spent a 
few hours trying different approaches it seems like the reason it doesn't work 
is that it isn't supported. So maybe this is a new feature request if the mail 
component is indeed not intended to work with OAuth2. If it is intended to work 
with OAuth2, and there is some evidence of this, please be so kind as to direct 
me to it. I would be happy to update the docs if this is the case.

Here is the component for reference:

from('imaps://\{{app.email.exchange.host}}?' +
'mail.imap.auth.mechanisms=XOAUTH2&' +
'mail.imap.starttls.enable=true&' +
'mail.imap.auth.plain.disable=true&' +
'mail.imap.auth.ntlm.disable=true&' +
'mail.imap.auth.gssapi.disable=true&' +
'mail.imap.auth.xoauth2.disable=false&' +
'authenticator=#exchangeAuthenticator&' +
'debugMode=true&' +
'bridgeErrorHandler=true&' +
'delete=true')

 

And the debug output:

DEBUG: setDebug: Jakarta Mail version 1.6.7
DEBUG: getProvider() returning 
javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle]
DEBUG IMAPS: mail.imap.fetchsize: 16384
DEBUG IMAPS: mail.imap.ignorebodystructuresize: false
DEBUG IMAPS: mail.imap.statuscachetimeout: 1000
DEBUG IMAPS: mail.imap.appendbuffersize: -1
DEBUG IMAPS: mail.imap.minidletime: 10
DEBUG IMAPS: closeFoldersOnStoreFailure
DEBUG IMAPS: trying to connect to host "outlook.office365.com", port 993, isSSL 
true
* OK The Microsoft Exchange IMAP4 service is ready. ...
A0 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID 
UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
A0 OK CAPABILITY completed.

  was:Camel mail component does not appear to work with OAuth2. This seems 
clear from the lack of documentation or unit tests regarding OAuth2, but having 
spent a few hours trying different approaches it seems like the reason it 
doesn't work is that it isn't supported. So maybe this is a new feature request 
if the mail component is indeed not intended to work with OAuth2. If it is 
intended to work with OAuth2, and there is some evidence of this, please be so 
kind as to direct me to it. I would be happy to update the docs if this is the 
case.


> Camel Mail Component does not work with OAuth2
> ----------------------------------------------
>
>                 Key: CAMEL-18623
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18623
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mail
>    Affects Versions: 3.18.2
>            Reporter: Jeff
>            Priority: Minor
>
> Camel mail component does not appear to work with OAuth2. This seems clear 
> from the lack of documentation or unit tests regarding OAuth2, but having 
> spent a few hours trying different approaches it seems like the reason it 
> doesn't work is that it isn't supported. So maybe this is a new feature 
> request if the mail component is indeed not intended to work with OAuth2. If 
> it is intended to work with OAuth2, and there is some evidence of this, 
> please be so kind as to direct me to it. I would be happy to update the docs 
> if this is the case.
> Here is the component for reference:
> from('imaps://\{{app.email.exchange.host}}?' +
> 'mail.imap.auth.mechanisms=XOAUTH2&' +
> 'mail.imap.starttls.enable=true&' +
> 'mail.imap.auth.plain.disable=true&' +
> 'mail.imap.auth.ntlm.disable=true&' +
> 'mail.imap.auth.gssapi.disable=true&' +
> 'mail.imap.auth.xoauth2.disable=false&' +
> 'authenticator=#exchangeAuthenticator&' +
> 'debugMode=true&' +
> 'bridgeErrorHandler=true&' +
> 'delete=true')
>  
> And the debug output:
> DEBUG: setDebug: Jakarta Mail version 1.6.7
> DEBUG: getProvider() returning 
> javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle]
> DEBUG IMAPS: mail.imap.fetchsize: 16384
> DEBUG IMAPS: mail.imap.ignorebodystructuresize: false
> DEBUG IMAPS: mail.imap.statuscachetimeout: 1000
> DEBUG IMAPS: mail.imap.appendbuffersize: -1
> DEBUG IMAPS: mail.imap.minidletime: 10
> DEBUG IMAPS: closeFoldersOnStoreFailure
> DEBUG IMAPS: trying to connect to host "outlook.office365.com", port 993, 
> isSSL true
> * OK The Microsoft Exchange IMAP4 service is ready. ...
> A0 CAPABILITY
> * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID 
> UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
> A0 OK CAPABILITY completed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to