No invitation mail sent when creating new user #4535

Closed
opened 2026-02-05 09:04:17 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @GuillaumeV-cemea on GitHub (Mar 27, 2024).

Describe the Bug

When I create a new user and choose to send a mail invitation, nothing is sent.
Mail parameters are most likely correctly set : the test email in settings works fine.

I've tried activating APP_DEBUG=true and APP_ENV=development to get additional info, but nothing in laravel.log or in apache error's log.

I've also tried just allowing registration (& email confirmation), and creating an account via /register, but it's the same : no confirmation mail sent.

Steps to Reproduce

Either creation from the admin interface :

  1. Go to settings > users
  2. Create a new user with a valid mail
  3. Check the case "Send invitation mail"
  4. Create the user

-> No mail is received, but I can see the user in the user list
Or registering :

  1. Go to login page
  2. Click on "No account ?"
  3. Create an account

-> No mail is received, but I can see the user in the user list

Expected Behaviour

The user receive a mail

Screenshots or Additional Context

I'm using solidnerd's docker image. To make sure this is not an issue with the docker image (e.g error messages not beeing correctly forwarded to docker or w/e), I've made sure that I can see error_log message (I used the LOG_FAILED_LOGIN_MESSAGE option), and that laravel.log can be written (I forced a PHP error, and it was appearing in the log).

My .env is relatively standard, here's a diff (redacted for secrets, obviously) with .env.example.complete :

--- .env.example.complete	2024-03-27 16:58:49.907858890 +0000
+++ .env	2024-03-27 16:59:27.331209812 +0000
@@ -1,3 +1,13 @@
+## MYSQL parameters
+MYSQL_ROOT_PASSWORD=XX
+MYSQL_DATABASE=XX
+MYSQL_USER=XX
+MYSQL_PASSWORD=XX
+## Docker image tags
+BOOKSTACK_IMAGE_TAG=solidnerd/bookstack:24.2.2
+BOOKSTACK_MARIADB_IMAGE_TAG=mysql:8.2
+
+## Bookstack .env
 # Full list of environment variables that can be used with BookStack.
 # Selectively copy these to your '.env' file as required.
 # Each option is shown with it's default value.
@@ -9,27 +19,27 @@
 
 # Application environment
 # Can be 'production', 'development', 'testing' or 'demo'
-APP_ENV=production
+APP_ENV=development
 
 # Enable debug mode
 # Shows advanced debug information and errors.
 # CAN EXPOSE OTHER VARIABLES, LEAVE DISABLED
-APP_DEBUG=false
+APP_DEBUG=true
 
 # Application key
 # Used for encryption where needed.
 # Run `php artisan key:generate` to generate a valid key.
-APP_KEY=SomeRandomString
+APP_KEY=XXX
 
 # Application URL
 # This must be the root URL that you want to host BookStack on.
 # All URL's in BookStack will be generated using this value.
-APP_URL=https://example.com
+APP_URL=https://bibliotech.cemea.org
 
 # Application default language
 # The default language choice to show.
 # May be overridden by user-preference or visitor browser settings.
-APP_LANG=en
+APP_LANG=fr
 
 # Auto-detect language for public visitors.
 # Uses browser-sent headers to infer a language.
@@ -39,7 +49,7 @@
 # Application timezone
 # Used where dates are displayed such as on exported content.
 # Valid timezone values can be found here: https://www.php.net/manual/en/timezones.php
-APP_TIMEZONE=UTC
+APP_TIMEZONE=Europe/PAris
 
 # Application theme
 # Used to specific a themes/<APP_THEME> folder where BookStack UI
@@ -56,30 +66,30 @@
 
 # Database details
 # Host can contain a port (localhost:3306) or a separate DB_PORT option can be used.
-DB_HOST=localhost
+DB_HOST=db
 DB_PORT=3306
-DB_DATABASE=database_database
-DB_USERNAME=database_username
-DB_PASSWORD=database_user_password
+DB_DATABASE=${MYSQL_DATABASE}
+DB_USERNAME=${MYSQL_USER}
+DB_PASSWORD=${MYSQL_PASSWORD}
 
 # MySQL specific connection options
 # Path to Certificate Authority (CA) certificate file for your MySQL instance.
 # When this option is used host name identity verification will be performed
 # which checks the hostname, used by the client, against names within the
 # certificate itself (Common Name or Subject Alternative Name).
-MYSQL_ATTR_SSL_CA="/path/to/ca.pem"
+#MYSQL_ATTR_SSL_CA="/path/to/ca.pem"
 
 # Mail configuration
 # Refer to https://www.bookstackapp.com/docs/admin/email-webhooks/#email-configuration
 MAIL_DRIVER=smtp
-MAIL_FROM=bookstack@example.com
-MAIL_FROM_NAME=BookStack
+MAIL_FROM=ne-pas-repondre@cemea.asso.fr
+MAIL_FROM_NAME=Bibliotech Ceméa
 
-MAIL_HOST=localhost
-MAIL_PORT=587
-MAIL_USERNAME=null
-MAIL_PASSWORD=null
-MAIL_ENCRYPTION=null
+MAIL_HOST=smtp.eu.mailgun.org
+MAIL_PORT=465
+MAIL_USERNAME=XXX
+MAIL_PASSWORD=XXX
+MAIL_ENCRYPTION=tls
 MAIL_VERIFY_SSL=true
 
 MAIL_SENDMAIL_COMMAND="/usr/sbin/sendmail -bs"
@@ -112,7 +122,7 @@
 
 # Queue driver to use
 # Can be 'sync', 'database' or 'redis'
-QUEUE_CONNECTION=sync
+QUEUE_CONNECTION=database
 
 # Storage system to use
 # Can be 'local', 'local_secure' or 's3'
@@ -277,7 +287,7 @@
 
 # Disable default third-party services such as Gravatar and Draw.IO
 # Service-specific options will override this option
-DISABLE_EXTERNAL_SERVICES=false
+DISABLE_EXTERNAL_SERVICES=true
 
 # Use custom avatar service, Sets fetch URL
 # Possible placeholders: ${hash} ${size} ${email}
@@ -339,7 +349,7 @@
 # Can be 'true', 'false' or 'null'.
 # The behaviour of the default 'null' option will depend on the 'app-public' admin setting.
 # Contents of the robots.txt file can be overridden, making this option obsolete.
-ALLOW_ROBOTS=null
+ALLOW_ROBOTS=false
 
 # Allow server-side fetches to be performed to potentially unknown
 # and user-provided locations. Primarily used in exports when loading
@@ -358,7 +368,7 @@
 # Can be set to a lone "*" to allow all sources for iframe content (Not advised).
 # Defaults to a set of common services.
 # Current host and source for the "DRAWIO" setting will be auto-appended to the sources configured.
-ALLOWED_IFRAME_SOURCES="https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com"
+ALLOWED_IFRAME_SOURCES="https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com https://*.cemea.org https://*.cemea.asso.fr"
 
 # A list of the sources/hostnames that can be reached by application SSR calls.
 # This is used wherever users can provide URLs/hosts in-platform, like for webhooks.
@@ -381,7 +391,7 @@
 # results in messages being output to the webserver error logs.
 # The message can contain a %u parameter which will be replaced with the login
 # user identifier (Username or email).
-LOG_FAILED_LOGIN_MESSAGE=false
+LOG_FAILED_LOGIN_MESSAGE="Failed login for %u"
 LOG_FAILED_LOGIN_CHANNEL=errorlog_plain_webserver
 
 # Alter the precision of IP addresses stored by BookStack.

Browser Details

Firefox 124.0.1 on Linux mint

Exact BookStack Version

24.2.2

Originally created by @GuillaumeV-cemea on GitHub (Mar 27, 2024). ### Describe the Bug When I create a new user and choose to send a mail invitation, nothing is sent. Mail parameters are most likely correctly set : the test email in settings works fine. I've tried activating `APP_DEBUG=true` and `APP_ENV=development` to get additional info, but nothing in `laravel.log` or in apache error's log. I've also tried just allowing registration (& email confirmation), and creating an account via /register, but it's the same : no confirmation mail sent. ### Steps to Reproduce Either creation from the admin interface : 1. Go to settings > users 2. Create a new user with a valid mail 3. Check the case "Send invitation mail" 4. Create the user -> No mail is received, but I can see the user in the user list Or registering : 1. Go to login page 2. Click on "No account ?" 3. Create an account -> No mail is received, but I can see the user in the user list ### Expected Behaviour The user receive a mail ### Screenshots or Additional Context I'm using solidnerd's docker image. To make sure this is not an issue with the docker image (e.g error messages not beeing correctly forwarded to docker or w/e), I've made sure that I can see error_log message (I used the `LOG_FAILED_LOGIN_MESSAGE` option), and that laravel.log can be written (I forced a PHP error, and it was appearing in the log). My .env is relatively standard, here's a diff (redacted for secrets, obviously) with .env.example.complete : ```diff --- .env.example.complete 2024-03-27 16:58:49.907858890 +0000 +++ .env 2024-03-27 16:59:27.331209812 +0000 @@ -1,3 +1,13 @@ +## MYSQL parameters +MYSQL_ROOT_PASSWORD=XX +MYSQL_DATABASE=XX +MYSQL_USER=XX +MYSQL_PASSWORD=XX +## Docker image tags +BOOKSTACK_IMAGE_TAG=solidnerd/bookstack:24.2.2 +BOOKSTACK_MARIADB_IMAGE_TAG=mysql:8.2 + +## Bookstack .env # Full list of environment variables that can be used with BookStack. # Selectively copy these to your '.env' file as required. # Each option is shown with it's default value. @@ -9,27 +19,27 @@ # Application environment # Can be 'production', 'development', 'testing' or 'demo' -APP_ENV=production +APP_ENV=development # Enable debug mode # Shows advanced debug information and errors. # CAN EXPOSE OTHER VARIABLES, LEAVE DISABLED -APP_DEBUG=false +APP_DEBUG=true # Application key # Used for encryption where needed. # Run `php artisan key:generate` to generate a valid key. -APP_KEY=SomeRandomString +APP_KEY=XXX # Application URL # This must be the root URL that you want to host BookStack on. # All URL's in BookStack will be generated using this value. -APP_URL=https://example.com +APP_URL=https://bibliotech.cemea.org # Application default language # The default language choice to show. # May be overridden by user-preference or visitor browser settings. -APP_LANG=en +APP_LANG=fr # Auto-detect language for public visitors. # Uses browser-sent headers to infer a language. @@ -39,7 +49,7 @@ # Application timezone # Used where dates are displayed such as on exported content. # Valid timezone values can be found here: https://www.php.net/manual/en/timezones.php -APP_TIMEZONE=UTC +APP_TIMEZONE=Europe/PAris # Application theme # Used to specific a themes/<APP_THEME> folder where BookStack UI @@ -56,30 +66,30 @@ # Database details # Host can contain a port (localhost:3306) or a separate DB_PORT option can be used. -DB_HOST=localhost +DB_HOST=db DB_PORT=3306 -DB_DATABASE=database_database -DB_USERNAME=database_username -DB_PASSWORD=database_user_password +DB_DATABASE=${MYSQL_DATABASE} +DB_USERNAME=${MYSQL_USER} +DB_PASSWORD=${MYSQL_PASSWORD} # MySQL specific connection options # Path to Certificate Authority (CA) certificate file for your MySQL instance. # When this option is used host name identity verification will be performed # which checks the hostname, used by the client, against names within the # certificate itself (Common Name or Subject Alternative Name). -MYSQL_ATTR_SSL_CA="/path/to/ca.pem" +#MYSQL_ATTR_SSL_CA="/path/to/ca.pem" # Mail configuration # Refer to https://www.bookstackapp.com/docs/admin/email-webhooks/#email-configuration MAIL_DRIVER=smtp -MAIL_FROM=bookstack@example.com -MAIL_FROM_NAME=BookStack +MAIL_FROM=ne-pas-repondre@cemea.asso.fr +MAIL_FROM_NAME=Bibliotech Ceméa -MAIL_HOST=localhost -MAIL_PORT=587 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null +MAIL_HOST=smtp.eu.mailgun.org +MAIL_PORT=465 +MAIL_USERNAME=XXX +MAIL_PASSWORD=XXX +MAIL_ENCRYPTION=tls MAIL_VERIFY_SSL=true MAIL_SENDMAIL_COMMAND="/usr/sbin/sendmail -bs" @@ -112,7 +122,7 @@ # Queue driver to use # Can be 'sync', 'database' or 'redis' -QUEUE_CONNECTION=sync +QUEUE_CONNECTION=database # Storage system to use # Can be 'local', 'local_secure' or 's3' @@ -277,7 +287,7 @@ # Disable default third-party services such as Gravatar and Draw.IO # Service-specific options will override this option -DISABLE_EXTERNAL_SERVICES=false +DISABLE_EXTERNAL_SERVICES=true # Use custom avatar service, Sets fetch URL # Possible placeholders: ${hash} ${size} ${email} @@ -339,7 +349,7 @@ # Can be 'true', 'false' or 'null'. # The behaviour of the default 'null' option will depend on the 'app-public' admin setting. # Contents of the robots.txt file can be overridden, making this option obsolete. -ALLOW_ROBOTS=null +ALLOW_ROBOTS=false # Allow server-side fetches to be performed to potentially unknown # and user-provided locations. Primarily used in exports when loading @@ -358,7 +368,7 @@ # Can be set to a lone "*" to allow all sources for iframe content (Not advised). # Defaults to a set of common services. # Current host and source for the "DRAWIO" setting will be auto-appended to the sources configured. -ALLOWED_IFRAME_SOURCES="https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com" +ALLOWED_IFRAME_SOURCES="https://*.draw.io https://*.youtube.com https://*.youtube-nocookie.com https://*.vimeo.com https://*.cemea.org https://*.cemea.asso.fr" # A list of the sources/hostnames that can be reached by application SSR calls. # This is used wherever users can provide URLs/hosts in-platform, like for webhooks. @@ -381,7 +391,7 @@ # results in messages being output to the webserver error logs. # The message can contain a %u parameter which will be replaced with the login # user identifier (Username or email). -LOG_FAILED_LOGIN_MESSAGE=false +LOG_FAILED_LOGIN_MESSAGE="Failed login for %u" LOG_FAILED_LOGIN_CHANNEL=errorlog_plain_webserver # Alter the precision of IP addresses stored by BookStack. ``` ### Browser Details Firefox 124.0.1 on Linux mint ### Exact BookStack Version 24.2.2
OVERLORD added the 🐛 Bug label 2026-02-05 09:04:17 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4535