Seems there is a typo in a rule inside /etc/exim4/exim4.conf.template default HestiaCP for Debian (no idea others) that avoids to run the rule correctly, without giving errors when starting/restarting/reloading exim4.
The rule is this one:
drop !authenticated = *
message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid
condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}}
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
delay = 45s
The problem is this code
}}\}
in this line:
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
that should be removed and then it runs as expected.
So the correct line seems to be this one:
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}}{$sender_helo_name}{no}{yes}}
Same possible typo appears in these install files:
It’s not a typo, just a “feature” That condition is intentionally using the wrong format, basically to disable the condition. I checked it, and the correct rule was causing several issues almost six years ago:
So the change was reverted:
We should take a look at that, but that rule shouldn’t, in any way, cause Exim to crash when starting, restarting or reloading. What error did you get?
No error at all when starting/restarting/reloading it.
I was just adding another custom rule at same position and then I have detected this possible typo and I have checked it, but as you said, if it is on purpose, nothing to fix then.