Sending email via Google Workspace account #3915

Closed
opened 2026-02-05 07:51:38 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Ender22 on GitHub (Jul 13, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I'm trying to set up the sending of emails. My organization uses google workspace. I've looked at the instructions here: https://www.bookstackapp.com/docs/admin/email-webhooks/#email-configuration

However, I seem to only be able to find instructions of setting up smtp email sending for normal gmail accounts, not google workspace gmail accounts. (i.e. seems no app-specific passwords can be set up for google workspace accounts)

If I try to set up the credentials as if my account is a normal gmail account i.e.

# Mail system to use
# Can be 'smtp' or 'sendmail'
MAIL_DRIVER=smtp

MAIL_FROM_NAME="My Wiki"
MAIL_FROM=mygmail@myorg.com
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=mygmail@myorg.com
MAIL_PASSWORD=mygmailaccountpassword
MAIL_ENCRYPTION=tls

Then I get:

Error thrown when sending a test email: Failed to authenticate on SMTP server with username "mygmail@myorg.com" using the following authenticators: "LOGIN", "PLAIN", "XOAUTH2". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials y2-20020a1709029b8200b001b86f1b5797sm4740062plp.302 - gsmtp".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials y2-20020a1709029b8200b001b86f1b5797sm4740062plp.302 - gsmtp".". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "334", with message "334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==".".

Any experience doing this with google workspace accounts? Is there anything obvious that I'm doing wrong?

Exact BookStack Version

BookStack v23.06.2

Log Content

No response

PHP Version

No response

Hosting Environment

Ubuntu 22 (freshly installed today)

Originally created by @Ender22 on GitHub (Jul 13, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I'm trying to set up the sending of emails. My organization uses google workspace. I've looked at the instructions here: https://www.bookstackapp.com/docs/admin/email-webhooks/#email-configuration However, I seem to only be able to find instructions of setting up smtp email sending for normal gmail accounts, not google workspace gmail accounts. (i.e. seems no app-specific passwords can be set up for google workspace accounts) If I try to set up the credentials as if my account is a normal gmail account i.e. ``` # Mail system to use # Can be 'smtp' or 'sendmail' MAIL_DRIVER=smtp MAIL_FROM_NAME="My Wiki" MAIL_FROM=mygmail@myorg.com MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=mygmail@myorg.com MAIL_PASSWORD=mygmailaccountpassword MAIL_ENCRYPTION=tls ``` Then I get: `Error thrown when sending a test email: Failed to authenticate on SMTP server with username "mygmail@myorg.com" using the following authenticators: "LOGIN", "PLAIN", "XOAUTH2". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials y2-20020a1709029b8200b001b86f1b5797sm4740062plp.302 - gsmtp".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials y2-20020a1709029b8200b001b86f1b5797sm4740062plp.302 - gsmtp".". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "334", with message "334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==".".` Any experience doing this with google workspace accounts? Is there anything obvious that I'm doing wrong? ### Exact BookStack Version BookStack v23.06.2 ### Log Content _No response_ ### PHP Version _No response_ ### Hosting Environment Ubuntu 22 (freshly installed today)
OVERLORD added the 🐕 Support label 2026-02-05 07:51:38 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 13, 2023):

Hi @Ender22,
Unfortunately I don't have a workspace account to hand to test things on.

I couldn't find certain information on app password availability in workspace.
I get the impression that 2FA has to be enabled for the user, and that there might also be admin/group level controls for making app passwords available.
Do you have 2FA enabled on the account?

I get the impression that app passwords do exist in the workspace setting, since pages like this refer to being able to list/view user app passwords.

@ssddanbrown commented on GitHub (Jul 13, 2023): Hi @Ender22, Unfortunately I don't have a workspace account to hand to test things on. I couldn't find certain information on app password availability in workspace. I get the impression that 2FA has to be enabled for the user, and that there might also be admin/group level controls for making app passwords available. Do you have 2FA enabled on the account? I get the impression that app passwords do exist in the workspace setting, since [pages like this](https://support.google.com/a/answer/2537800?hl=en#zippy=%2Cview-and-revoke-application-specific-passwords) refer to being able to list/view user app passwords.
Author
Owner

@ssddanbrown commented on GitHub (Jul 23, 2023):

Since there's been no follow-up I'm going to close this. If you need further help just respond to my previous comment.

@ssddanbrown commented on GitHub (Jul 23, 2023): Since there's been no follow-up I'm going to close this. If you need further help just respond to my previous comment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3915