-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add XOAuth2 support for GMail #42
Conversation
This was mighty fast pull request. I'm impressed. :) I've gone through the code and don't see any issues. I would, however, suggest to try to create some tests for the new code, if possible:
On a side note -- I see that |
f9bd04c
to
81dad60
Compare
Hi @bokysan, just had the work done :D. I've updated the PR to add
|
e3e4ec1
to
638d2e8
Compare
Hi again, I added a new commit to modify the I didn't figured out an easy way to get access to the docker container logs, particularly postfix logs that are the ones I need to parse for XOAuth2 tests. Requirements to run the XOAuth2 tests:
To test an XOAuth2 error, just provide a fake
Just separated the commits to facilitate the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the commit.
I've left you some review notes. As soon as we resolved them I'll be merging the commit.
integration-tests.sh
Outdated
@@ -11,9 +49,52 @@ run_test() { | |||
( | |||
cd "$1" | |||
set +e | |||
docker-compose up --build --abort-on-container-exit --exit-code-from tests | |||
exit_code="$?" | |||
# Build and create the containers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to run this code myself. There must be a simpler way of doing this. Maybe leave it to run the tests and then analyze the log file as explained in #35, without capturing the docker output?
(This can be resolved later on though, I will not block the commit because of this.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following #35 (comment) gave me the clues to send logs to a shared volume.
RELAYHOST: "[smtp.gmail.com]:587" | ||
RELAYHOST_USERNAME: "${RELAYHOST_USERNAME}" | ||
RELAYHOST_TLS_LEVEL: "encrypt" | ||
XOAUTH2_CLIENT_ID: "${XOAUTH2_CLIENT_ID}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: I might create a "testing" gmail account and add its credentials to build secrets, as the tests are now failing at GitHub.
638d2e8
to
6233296
Compare
I'm gonna go ahead an merge this into master and see if I can set up the tests to use the GitHub secrets. Thanks for the great work! |
This PR, uses https://github.com/tarickb/sasl-xoauth2 to add support for the XOAuth2 authentication method that is usually required / recommend for some providers like GMail. Currently this library it is specifically designed for GMail, but seems that there is a discussion to provide support for other providers like Office365 (there is an active PR).
More precisely, this PR does:
RELAYHOST_TLS_LEVEL
,XOAUTH2_CLIENT_ID
,XOAUTH2_SECRET
,XOAUTH2_INITIAL_ACCESS_TOKEN
,XOAUTH2_INITIAL_REFRESH_TOKEN
environment variables to configure the XOAuth2 authentication.RELAYHOST
andRELAYHOST_USERNAME
too.Related to #41