[Bug Report]: HELO not correctly configured when sending emails through SMTP #2494

Closed
opened 2026-02-05 04:20:14 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @RixzZ on GitHub (Nov 19, 2021).

Describe the Bug

Using a Docker container with Exim for mailing, rejects requests from BookStack as HELO is not correctly announced when opening the SMTP connection.

This was also reported a while ago on issue #2384, but was closed while waiting for more information.

The error the Exim container throws is:

445   rejected HELO from wiki-main-1.mailing [10.0.1.6]: syntactically invalid argument(s): _

I have this same setup working with other projects which didn't need any special configuration and sent a HELO correctly, allowing them to send email without problems.

Steps to Reproduce

  1. Setup ixdotai/smtp:latest docker image (the one I use).
  2. Setup BookStack on the same Docker network.
  3. Configure the .env file to connect to the SMTP container.
  4. Watch it fail when using the 'Sent test email' button from BookStack. The error is reported on the compose logs from the SMTP container.

Expected Behaviour

BookStack should start the SMTP with a good HELO (maybe the public domain name set on APP_URL could work). An IP is not an option either, since is not a valid HELO.

Screenshots or Additional Context

No response

Exact BookStack Version

v21.11

PHP Version

7.4

Hosting Environment

Ubuntu 20.04, but using docker:

I'll explain my setup:

  • To explain the part 'wiki-main-1.mailing' of the log:
    • My SMTP container (where Exim is) is on a Docker network called mailing and every container I want to communicate with it is added to this network. The container is called smtp which later is referenced on the .env from BookStack (since is a DNS resolvable name).
    • BookStack is on a Compose project called wiki and his container name is main.
  • The IP 10.0.1.6 is the one the BookStack container uses when connected to the 'mailing' network.

This SMTP container is local only so it doesn't have any authentication or SSL termination. This is the configuration set on Bookstack .env:

# Mail sender details
MAIL_FROM_NAME="Wiki"
MAIL_FROM=wiki@[REDACTED].[REDACTED]

# SMTP mail options
# These settings can be checked using the "Send a Test Email"
# feature found in the "Settings > Maintenance" area of the system.
MAIL_HOST=smtp
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Originally created by @RixzZ on GitHub (Nov 19, 2021). ### Describe the Bug Using a Docker container with Exim for mailing, rejects requests from BookStack as HELO is not correctly announced when opening the SMTP connection. This was also reported a while ago on issue #2384, but was closed while waiting for more information. The error the Exim container throws is: ``` 445 rejected HELO from wiki-main-1.mailing [10.0.1.6]: syntactically invalid argument(s): _ ``` I have this same setup working with other projects which didn't need any special configuration and sent a HELO correctly, allowing them to send email without problems. ### Steps to Reproduce 1. Setup `ixdotai/smtp:latest` docker image (the one I use). 2. Setup BookStack on the same Docker network. 3. Configure the `.env` file to connect to the SMTP container. 4. Watch it fail when using the 'Sent test email' button from BookStack. The error is reported on the compose logs from the SMTP container. ### Expected Behaviour BookStack should start the SMTP with a good HELO (maybe the public domain name set on APP_URL could work). An IP is not an option either, since is not a valid HELO. ### Screenshots or Additional Context _No response_ ### Exact BookStack Version v21.11 ### PHP Version 7.4 ### Hosting Environment Ubuntu 20.04, but using docker: I'll explain my setup: * To explain the part 'wiki-main-1.mailing' of the log: * My [SMTP container](https://hub.docker.com/r/ixdotai/smtp) (where Exim is) is on a Docker network called `mailing` and every container I want to communicate with it is added to this network. The container is called `smtp` which later is referenced on the `.env` from BookStack (since is a DNS resolvable name). * BookStack is on a Compose project called `wiki` and his container name is `main`. * The IP `10.0.1.6` is the one the BookStack container uses when connected to the 'mailing' network. This SMTP container is local only so it doesn't have any authentication or SSL termination. This is the configuration set on Bookstack `.env`: ```yaml # Mail sender details MAIL_FROM_NAME="Wiki" MAIL_FROM=wiki@[REDACTED].[REDACTED] # SMTP mail options # These settings can be checked using the "Send a Test Email" # feature found in the "Settings > Maintenance" area of the system. MAIL_HOST=smtp MAIL_PORT=25 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null ```
OVERLORD added the 🐛 Bug label 2026-02-05 04:20:14 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Nov 19, 2021):

Hi @RixzZ,

This can come down to how the webserver is configured within the system.
Are you using the linuxserver.io docker container? If so then the following would be relevant:
https://github.com/linuxserver/docker-bookstack/issues/68

@ssddanbrown commented on GitHub (Nov 19, 2021): Hi @RixzZ, This can come down to how the webserver is configured within the system. Are you using the linuxserver.io docker container? If so then the following would be relevant: https://github.com/linuxserver/docker-bookstack/issues/68
Author
Owner

@RixzZ commented on GitHub (Nov 19, 2021):

Hi @ssddanbrown,

Yeah, I'm using that container, so that might be the reason it's failing in this case, since the HELO that reaches Exim is _. I guess they need to fix it on the container then. Thank you.

Either way, shouldn't be possible to set it from the application when using SMTP? I think the PHP library used for it might have that ability and it could be a new optional setting on the .env.

@RixzZ commented on GitHub (Nov 19, 2021): Hi @ssddanbrown, Yeah, I'm using that container, so that might be the reason it's failing in this case, since the HELO that reaches Exim is `_`. I guess they need to fix it on the container then. Thank you. Either way, shouldn't be possible to set it from the application when using SMTP? I think the PHP library used for it might have that ability and it could be a new optional setting on the `.env`.
Author
Owner

@ssddanbrown commented on GitHub (Nov 19, 2021):

Either way, shouldn't be possible to set it from the application when using SMTP? I think the PHP library used for it might have that ability and it could be a new optional setting on the .env.

Yeah, It's likely possible, and we'd probably be able to use the existing APP_URL value, but it'd tie us down to the lower level library implementation while technical be a change in implementation for a much wider set of users, introducing potential risk to wider set of current configurations without spending time understanding or pre-empting how the change may apply. That's upon then maintaining this change for this specific case going forward. For the level of occurance, where this only pops up in container+exim usage, I'm not sure it's worth the change on the app side.

For the linuxserver.io container, pretty sure they expose the nginx config through the /config file you should have mounted via a volume.

@ssddanbrown commented on GitHub (Nov 19, 2021): > Either way, shouldn't be possible to set it from the application when using SMTP? I think the PHP library used for it might have that ability and it could be a new optional setting on the .env. Yeah, It's likely possible, and we'd probably be able to use the existing `APP_URL` value, but it'd tie us down to the lower level library implementation while technical be a change in implementation for a much wider set of users, introducing potential risk to wider set of current configurations without spending time understanding or pre-empting how the change may apply. That's upon then maintaining this change for this specific case going forward. For the level of occurance, where this only pops up in container+exim usage, I'm not sure it's worth the change on the app side. For the linuxserver.io container, pretty sure they expose the nginx config through the `/config` file you should have mounted via a volume.
Author
Owner

@RixzZ commented on GitHub (Nov 19, 2021):

Okay @ssddanbrown, thank you for considering it 👍🏼

@RixzZ commented on GitHub (Nov 19, 2021): Okay @ssddanbrown, thank you for considering it 👍🏼
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2494