ix-ai / smtp

This is a SMTP docker container for sending emails. You can also relay emails to gmail and amazon SES.
MIT License
92 stars 14 forks source link

Allow underscores in EHLO #6

Closed jan-thoma closed 2 years ago

jan-thoma commented 2 years ago

The container doesn't accept underscores in hostnames in his default config. Underscores are added to the hostnames when using this container with docker-compose.

Error Message:

viiv-podcast-smtp_1   |   281 LOG: MAIN REJECT
viiv-podcast-smtp_1   |   281   rejected EHLO from viiv-podcast_viiv-podcast-craft_1.viiv-podcast_internal [172.31.58.4]: syntactically invalid argument(s): 

Solution: https://logs.paulooi.com/exim-rejected-ehlo-syntactically-invalid-argument.php

tlex commented 2 years ago

I'll look into it. Probably will implement it with an external variable (switch maybe - or the ability to customize helo_allow_chars), since underscores in the hostname is against RFC-1123 (which actually relaxes RFC-952.

ASSUMPTIONS

   1. A "name" (Net, Host, Gateway, or Domain name) is a text string up
   to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus
   sign (-), and period (.).  Note that periods are only allowed when
   they serve to delimit components of "domain style names". (See
   RFC-921, "Domain Name System Implementation Schedule", for
   background).  No blank or space characters are permitted as part of a
   name. No distinction is made between upper and lower case.  The first
   character must be an alpha character.  The last character must not be
   a minus sign or period.
tlex commented 2 years ago

Looking at the code, you have the possibility to mount a separate file that supports adding options for main.

So, you can add to a file:

helo_allow_chars = _

Then mount the file under /etc/exim4/_docker_additional_macros and restart the container.

Please let me know if this works for you.

Edit: It's in the code in entrypoint.sh#L78

jan-thoma commented 2 years ago

Works like a charm. Thanks

tlex commented 2 years ago

In this case, I'll close the issue.

Thanks for the feedback.