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

Unable to start Caddy on bootup with Mailout #17

Open
rojakcoder opened this issue Jan 17, 2019 · 2 comments
Open

Unable to start Caddy on bootup with Mailout #17

rojakcoder opened this issue Jan 17, 2019 · 2 comments
Labels

Comments

@rojakcoder
Copy link
Contributor

I "installed" Caddy as a service on systemd (Ubuntu 18.04).

I'm able to start the service manually like so: sudo systemctl start caddy.service

I then tried making the service start upon system boot up: sudo systemctl enable caddy.service

It does not work.

I'm using a Gmail account to send out emails. However, Google is blocking access when the service is being started during boot up - says "Unusual sign-in attempt prevented".

It works fine if I start the service manually.

I can see from the logs below (sudo journalctl --boot -u caddy.service) that Google is requiring me to re-authenticate if starting the service upon bootup. Of course I am unable to do so if the service is being start during bootup.

Jan 16 23:19:36 localhost caddy[687]: 2019/01/16 23:19:36 534 5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsdt4
Jan 16 23:19:36 localhost caddy[687]: 5.7.14 KMifBMHp57kD9RRt1qDo8iaOrx9MFzJ0SLXVy854ySa6MjdptNhnAj_e6c4TXEVWV0iuk1
Jan 16 23:19:36 localhost caddy[687]: 5.7.14 53P-GCWyuGJ1ybfcoqIu4khdjVH92N_7EBlec7u3peHNL6ODOeEaWIbOupMd_c3lEWEfAI
Jan 16 23:19:36 localhost caddy[687]: 5.7.14 rzk7HwR-F0d7g8wv0ijgCY-x3uevjbMAFbPcysmoDBG5sy48guJefty5g_fulA3oUkVryS
Jan 16 23:19:36 localhost caddy[687]: 5.7.14 TSb-0mMSD-SBNJjhC0B09YTo5HwZltEJrwQZS6NTncHVNsdmkF> Please log in via
Jan 16 23:19:36 localhost caddy[687]: 5.7.14 your web browser and then try again.
Jan 16 23:19:36 localhost caddy[687]: 5.7.14  Learn more at
Jan 16 23:19:36 localhost caddy[687]: 5.7.14  https://support.google.com/mail/answer/78754 c7sm14904972pfh.18 - gsmtp
Jan 16 23:19:36 localhost systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 23:19:36 localhost systemd[1]: caddy.service: Failed with result 'exit-code'.

I was wondering if anyone has any experience in getting Mailout to work with Gmail for auto-start Caddy service on systemd.

@SchumacherFM
Copy link
Owner

It does work but you must configure your google account that less secure apps can access your google account. If i remember correctly you can use app specific passwords when you have 2FA enabled.

@rojakcoder
Copy link
Contributor Author

The setting is turned on (screen cap 1).

As mentioned, Google seems to require re-authentication when Caddy boots up. I believe when I couldn't do so, Google flags it as a suspicious sign-in attempt (screen cap 2).

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

No branches or pull requests

2 participants