Docker app won't start due to whitespace in .env gmail settings

Version ie <v5.10.30>

v5.11.6

Environment <Docker/Shared Hosting/Zip/Other>

Docker

Checklist

Describe the bug

My .env example

Mail options

MAIL_MAILER=log
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=1234 1234 1234 1234
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=‘[email protected]
MAIL_FROM_NAME=‘Self Hosted User’

I use my Gmail two-factor app code, which has a space every 4 characters.
When I run the docker-compose up -d app, the container will not start with the error whitespace on Gmail password line.
I can remove the spaces from the password and run it again, and it starts fine; however, email doesn’t work.
I also tried putting quotes around the password, the app starts but still no email function.

Hi,

You should be able to configure the SMTP credentials in the app on Settings > Email Settings.

The .env file should also work, I suggest asking in a discussion on GitHub.