-
I am using an oauth2 token to authenticate a user for a mail client that i am wokring on. I can successfully connect and authenticate an IMAPClient, however when i try to do the same for the SMTPClient, i am met with the exception S: 501-5.5.2 Cannot Decode response. Please visit When i check the protocol logger, i seems that the oauth token is not sent to the server, however i am new to all this so i might be wrong! :)
The reason i say i don't think the token isn't sent to the server is because in the first client response after EHLO, there isn't any base64 string or anything, which i have seen in other examples of logs... I attempt to connect to the SMTPClient in the following way:
Where the Credentials class is a static class containing the SaslMechanismOAuth2. I use pretty much the same method for the IMAPClient, which works out... I hope somebody can help me out, i am completely out of ideas. Thanks alot! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If Credentials.oauth2 is a SaslMechanismOAuth2, you need to reset it after authenticating before reuse. |
Beta Was this translation helpful? Give feedback.
If Credentials.oauth2 is a SaslMechanismOAuth2, you need to reset it after authenticating before reuse.