E-mail sending broken in 0.31.4 #2070

Closed
opened 2026-02-05 02:47:46 +03:00 by OVERLORD · 14 comments
Owner

Originally created by @GameBurrow on GitHub (Feb 1, 2021).

Describe the bug
I have tried 3 different sets of SMTP login credentials, none are working in version 0.31.4, I get authentication failure. I have confirmed all of them working elsewhere. One of them even used to work in same installation on older versions.

One set is working at this moment on another server on, with Bookstack 0.30.5, tried setting up Send a Test Email, worked. Copied e-mail config from that server to this one, not working.

With all of them I get this error when I try Send a Test Email:

Error thrown when sending a test email: Failed to authenticate on SMTP server with username "xxxx@xxxxx" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: authentication failure ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: authentication failure ".

  • Yes, I confirm that conf changes, because when I change email domains, I saw that as result in error message.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Set up bookstack using linuxserver/bookstack:v0.31.4-ls121 docker image
  2. Configure the client to use smtp e-mail
  3. Try sending a test e-mail

Expected behavior
E-mail goes out

Screenshots

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): linuxserver/bookstack:v0.31.4-ls121
  • PHP Version: Whatever it ships with
  • Hosting Method (Nginx/Apache/Docker): Docker

Additional context
N/A

Originally created by @GameBurrow on GitHub (Feb 1, 2021). **Describe the bug** I have tried 3 different sets of SMTP login credentials, none are working in version 0.31.4, I get authentication failure. I have confirmed all of them working elsewhere. One of them even used to work in same installation on older versions. One set is working at this moment on another server on, with Bookstack 0.30.5, tried setting up Send a Test Email, worked. Copied e-mail config from that server to this one, not working. With all of them I get this error when I try Send a Test Email: > Error thrown when sending a test email: Failed to authenticate on SMTP server with username "xxxx@xxxxx" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: authentication failure ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: authentication failure ". - Yes, I confirm that conf changes, because when I change email domains, I saw that as result in error message. **Steps To Reproduce** Steps to reproduce the behavior: 1. Set up bookstack using `linuxserver/bookstack:v0.31.4-ls121` docker image 2. Configure the client to use smtp e-mail 3. Try sending a test e-mail **Expected behavior** E-mail goes out **Screenshots** - **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): `linuxserver/bookstack:v0.31.4-ls121` - PHP Version: Whatever it ships with - Hosting Method (Nginx/Apache/Docker): Docker **Additional context** N/A
OVERLORD added the 🐕 Support label 2026-02-05 02:47:46 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 4, 2021):

Hi @GameBurrow,
Double checked things on one of my v0.31.5 instances and all working there.

How are you setting the options? In the .env file or are you passing them as environment variables to the container?
Just wondering if the settings are being picked up at all, You could try setting the MAIL_HOST option as something completely non-existent to see if the error changes or remains the same.

@ssddanbrown commented on GitHub (Feb 4, 2021): Hi @GameBurrow, Double checked things on one of my v0.31.5 instances and all working there. How are you setting the options? In the `.env` file or are you passing them as environment variables to the container? Just wondering if the settings are being picked up at all, You could try setting the `MAIL_HOST` option as something completely non-existent to see if the error changes or remains the same.
Author
Owner

@GameBurrow commented on GitHub (Feb 4, 2021):

Just incase tried updating to 0.31.5. No difference.

We are setting the values in .env file, we are mounting the .env file into the container in docker-compose. File changes are loaded as I said in the original report, when I tried changing MAIL_HOST && MAIL_USERNAME I saw differences in error message.

Here is example of our sendgrid credentials that used to work in the same installation:

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

# Mail sending options
MAIL_FROM=emailomitted
MAIL_FROM_NAME="ommited BookStack"

# SMTP mail options
MAIL_HOST=smtp.sendgrid.com
MAIL_PORT=587
MAIL_USERNAME=usernameommited
MAIL_PASSWORD=passwordommited
MAIL_ENCRYPTION=null

Another example of the configs I tried, that work different bookstack installation (version 0.30.5):

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

# Mail sending options
MAIL_FROM=omitted
MAIL_FROM_NAME='omitted'

# SMTP mail options
MAIL_HOST=privatemailersverommited
MAIL_PORT=587
MAIL_USERNAME=omitted
MAIL_PASSWORD=omitted
MAIL_ENCRYPTION=tls
@GameBurrow commented on GitHub (Feb 4, 2021): Just incase tried updating to 0.31.5. No difference. We are setting the values in .env file, we are mounting the .env file into the container in docker-compose. File changes are loaded as I said in the original report, when I tried changing MAIL_HOST && MAIL_USERNAME I saw differences in error message. Here is example of our sendgrid credentials that used to work in the same installation: ``` #Mail system to use # Can be 'smtp', 'mail' or 'sendmail' MAIL_DRIVER=smtp # Mail sending options MAIL_FROM=emailomitted MAIL_FROM_NAME="ommited BookStack" # SMTP mail options MAIL_HOST=smtp.sendgrid.com MAIL_PORT=587 MAIL_USERNAME=usernameommited MAIL_PASSWORD=passwordommited MAIL_ENCRYPTION=null ``` Another example of the configs I tried, that work different bookstack installation (version 0.30.5): ``` # Mail system to use # Can be 'smtp', 'mail' or 'sendmail' MAIL_DRIVER=smtp # Mail sending options MAIL_FROM=omitted MAIL_FROM_NAME='omitted' # SMTP mail options MAIL_HOST=privatemailersverommited MAIL_PORT=587 MAIL_USERNAME=omitted MAIL_PASSWORD=omitted MAIL_ENCRYPTION=tls ```
Author
Owner

@ssddanbrown commented on GitHub (Feb 5, 2021):

Hi @GameBurrow, I'm using sendgrid on the instance I tested too.

Have you tried with MAIL_ENCRYPTION=tls and MAIL_USERNAME being the exact value of apikey and using a MAIL_HOST of smtp.sendgrid.net as per SendGrid's instructions?

MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=<SENDGRID_API_KEY>
MAIL_ENCRYPTION=tls
@ssddanbrown commented on GitHub (Feb 5, 2021): Hi @GameBurrow, I'm using sendgrid on the instance I tested too. Have you tried with `MAIL_ENCRYPTION=tls` and `MAIL_USERNAME` being the exact value of `apikey` and using a `MAIL_HOST` of `smtp.sendgrid.net` as per SendGrid's instructions? ``` MAIL_HOST=smtp.sendgrid.net MAIL_PORT=587 MAIL_USERNAME=apikey MAIL_PASSWORD=<SENDGRID_API_KEY> MAIL_ENCRYPTION=tls ```
Author
Owner

@GameBurrow commented on GitHub (Feb 5, 2021):

Yes, I tried. And as I said already several times, I tried 2 different
extra set of credentials also that that work elsewhere with exactly the
same settings I tried here. Both other credentials use TLS.

Just incase I'll try again tomorrow morning to be sure.

@GameBurrow commented on GitHub (Feb 5, 2021): Yes, I tried. And as I said already several times, I tried 2 different extra set of credentials also that that work elsewhere with exactly the same settings I tried here. Both other credentials use TLS. Just incase I'll try again tomorrow morning to be sure.
Author
Owner

@ssddanbrown commented on GitHub (Feb 5, 2021):

@GameBurrow Okay, Just wanted to check as some of the posted sendgrid details were different to what I'd expect.

I've done another test on my side, this time using the v0.31.5 linuxserver.io image to replicate your instance the best I can, but I could still send without issue using some fastmail SMTP details I had to hand.

@ssddanbrown commented on GitHub (Feb 5, 2021): @GameBurrow Okay, Just wanted to check as some of the posted sendgrid details were different to what I'd expect. I've done another test on my side, this time using the v0.31.5 linuxserver.io image to replicate your instance the best I can, but I could still send without issue using some fastmail SMTP details I had to hand.
Author
Owner

@maggie44 commented on GitHub (Feb 13, 2021):

I'm having a similar issue. Also on linuxserver image, also using SendGrid.

Screenshot 2021-02-12 at 12 43 23

I have tried with surround " and without. I have also tried encoding the username and password to base64 as per the instructions: https://sendgrid.com/docs/for-developers/sending-email/getting-started-smtp/#-Sending-a-test-SMTP-email-with-Telnet

@maggie44 commented on GitHub (Feb 13, 2021): I'm having a similar issue. Also on linuxserver image, also using SendGrid. <img width="269" alt="Screenshot 2021-02-12 at 12 43 23" src="https://user-images.githubusercontent.com/64841595/107824756-dc807600-6d36-11eb-8932-1e1a5bd73065.png"> I have tried with surround " and without. I have also tried encoding the username and password to base64 as per the instructions: https://sendgrid.com/docs/for-developers/sending-email/getting-started-smtp/#-Sending-a-test-SMTP-email-with-Telnet
Author
Owner

@ssddanbrown commented on GitHub (Feb 13, 2021):

Hmm, That's odd. No base64 should be needed.

The fact it's trying PLAIN almost feels like the MAIL_ENCRYPTION=tls or MAIL_PORT=587 options are not being used.
@maggie0002 Did you have both those options set when getting that error message?

@ssddanbrown commented on GitHub (Feb 13, 2021): Hmm, That's odd. No base64 should be needed. The fact it's trying `PLAIN` almost feels like the `MAIL_ENCRYPTION=tls` or `MAIL_PORT=587` options are not being used. @maggie0002 Did you have both those options set when getting that error message?
Author
Owner

@maggie44 commented on GitHub (Feb 13, 2021):

MAIL_DRIVER=smtp
MAIL_FROM_NAME=NameHere
MAIL_FROM=noreply@url.org
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=base64-apikey
MAIL_ENCRYPTION=tls

@maggie44 commented on GitHub (Feb 13, 2021): MAIL_DRIVER=smtp MAIL_FROM_NAME=NameHere MAIL_FROM=noreply@url.org MAIL_HOST=smtp.sendgrid.net MAIL_PORT=587 MAIL_USERNAME=apikey MAIL_PASSWORD=base64-apikey MAIL_ENCRYPTION=tls
Author
Owner

@ssddanbrown commented on GitHub (Feb 13, 2021):

@maggie0002 Do you set these options via environment variables on the container or by using the .env file?

@ssddanbrown commented on GitHub (Feb 13, 2021): @maggie0002 Do you set these options via environment variables on the container or by using the `.env` file?
Author
Owner

@maggie44 commented on GitHub (Feb 13, 2021):

.env file

I can see at least some of the fields being read, because when I change mail_username the username in the error message changes.

Testing on BookStack v0.31.3 and BookStack v0.31.6, same issue.

@maggie44 commented on GitHub (Feb 13, 2021): .env file I can see at least some of the fields being read, because when I change mail_username the username in the error message changes. Testing on BookStack v0.31.3 and BookStack v0.31.6, same issue.
Author
Owner

@maggie44 commented on GitHub (Feb 13, 2021):

Urgh, the person who was administrating the SendGrid account provided me a password that was already base64 encoded and didn't let me know. Looks like BookStack is doing the encoding though. So I passed it the username and password before encoding it, and now works fine. On the plus side, I can now confirm BookStack works with SendGrid.

@maggie44 commented on GitHub (Feb 13, 2021): Urgh, the person who was administrating the SendGrid account provided me a password that was already base64 encoded and didn't let me know. Looks like BookStack is doing the encoding though. So I passed it the username and password before encoding it, and now works fine. On the plus side, I can now confirm BookStack works with SendGrid.
Author
Owner

@ssddanbrown commented on GitHub (Feb 13, 2021):

Ah, Okay. Thanks for confirming @maggie0002

@ssddanbrown commented on GitHub (Feb 13, 2021): Ah, Okay. Thanks for confirming @maggie0002
Author
Owner

@GameBurrow commented on GitHub (Feb 17, 2021):

Got it solved on our side also.

@GameBurrow commented on GitHub (Feb 17, 2021): Got it solved on our side also.
Author
Owner

@ssddanbrown commented on GitHub (Feb 18, 2021):

@GameBurrow Cool, Thanks for confirming. Will therefore close this.

@ssddanbrown commented on GitHub (Feb 18, 2021): @GameBurrow Cool, Thanks for confirming. Will therefore close this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2070