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

Gmail compatible settings (2022) #54

Closed
bigteejay opened this issue Oct 10, 2022 · 0 comments
Closed

Gmail compatible settings (2022) #54

bigteejay opened this issue Oct 10, 2022 · 0 comments

Comments

@bigteejay
Copy link

bigteejay commented Oct 10, 2022

I spent quite a bit of time trying to nail down the specific settings for sending programmatic emails through Gmail (using swaks to verify).

I figured I would document it here in case it helps anyone else.

Following this link (and enabling 2FA/two-factor-authentication), then create an app password to use for signing into the mail server.

Docker route (not required, other swaks Docker images exist, but this was the most useful)...

swaks.Dockerfile

FROM ubuntu:20.04
RUN apt update && echo y | apt install swaks vim

Build...

docker build -t swaks $PWD\swaks.Dockerfile

Run...

docker run -it --rm swaks sh

Finally, try test email...

swaks -4 --server smtp.gmail.com -tlsc --tls-protocol TLSv1_2 \
    --from [your full gmail account email that app password was setup for] --to user1@example.com,user2@example.com \
    --auth LOGIN --auth-user [same as from] --auth-password [your generated app password] -apt \
    --h-Subject 'Test email' --body 'Email system test.'

The -apt argument isn't required of course, it just helped with troubleshooting. Not using "smtp-relay..." for the server as what little Google documentation exists indicated, was necessary. Do not consider this a "secured" example, merely for testing purposes.

I'll try closing this "issue" if allowed so as to not create more work for admins.

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

1 participant