Exim4 srs.conf error

I’m using default configs, provided with Hestia installation. And I am shure, that Exim4 is misconfigurated on Ubuntu 22.04.

None of my Ubuntu 22.04 servers have working email. Several servers are in production and I am not able to reinstall OS back to 20.04

that is why you need to replace the default config by the older one, it solved the exact same issue for me

I did try this config and wrote about it in first message. It did not help at all. The mail log is full of errors that comming every second.

This seems to be a bug in Exim. There is a patch mentioned in the following thread that I have no idea if it should be already on the latest Hestia version or not:

https://www.mail-archive.com/[email protected]/msg57395.html

I think the problem presents when there is no original return path, which happens with bounce messages.

One way to solve it from configuration is editing the return path setting on /etc/exim4/exim4.conf.template from:

return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}

to:

return_path = ${srs_encode {SRS_SECRET} {${if def:return_path {$return_path} {[email protected]}}} {$original_domain}}

That way there is always a return path address. But Exim shouldn’t even try to use SRS if there is no return path present on the original email.

1 Like

Just to clarify. Hestia uses the Exim package provided by the distribution (Debian or Ubuntu) and the only supported version using Exim 4.96 (the SRS patch was included in 4.96-RC2) is Debian 12, other versions are using older releases so the patch shouldn’t be applied (it isn’t a security issue so I don’t think it was backported to older releases). Ubuntu 24.04 uses Exim 4.97 but it isn’t supported by Hestia yet.

Thanks for sharing it.

1 Like

I set up new VPS with Ubuntu 22.04 and HestiaCP quite often. And every time in the logs I see all the same error given in this thread a year ago.
Can anyone answer if this is a problem with HestiaCP or Exim4 itself?
The log /var/log/exim4/paniclog is full of thousands of entries.
None of the advice in this thread has helped. There is no solution.

It’s all written here:

Sorry, maybe I don’t fully understand this explanation as English is not my first language.

  1. Is it correct to say that HestiaCP creates wrong Exim4 configuration, so the mail server stops working?

  2. The latest available version of Exim4 in Ubuntu 22.04 is 4.95 and it supports SRS.

  3. How is it possible to fix an inoperable Exim4 server after installing HestiaCP?

Thank you very much for your answers!

this one here.

So, HestiaCP does not support Exim4 mail server in Ubuntu 22.04, since the latest available version is 4.95?

No, we support exim 4.95, exim does not support SRS with that version.

Why then does HestiaCP create a configuration with SRS?

Seems Ubuntu backported SRS support to exim4 4.95 so it should support SRS conf.

In /etc/exim4/exim4.conf.template, did you try to replace this?

return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}

by this?

return_path = ${srs_encode {SRS_SECRET} ${if def:return_path {$return_path} {noreply@${primary_hostname}}} {$original_domain}}

If you modify the exim4 conf, remember to restart exim4:

systemctl restart exim4

Yeah, I tried that. I get a different error as a result:


Found this thread with the same error, but SRS_SECRET = ${readfile{/etc/exim4/srs.conf}} is already in the config.

I want to make it clear again. Exim4 is installed and configured by HestaiCP on a clean Ubuntu 22.04. No manual changes have been made to the configs. And the mail server is not working.

Maybe there is a possibility to connect an external repository to update Exim4 to the latest actual version? As it is done by the panel with mariadb and nginx?

Maybe that would help to solve the problem?

I don’t know any other repo to install an updated Exim4 version.

Could you please show the output of these commands?

dpkg -l | grep exim4
grep -Ev '^$|^#' /etc/exim4/update-exim4.conf.conf
1 Like


I see no problem, all looks fine.

Yes, this is the default config that HestiaCP generates for Exim4, but it doesn’t work in Ubuntu 22.04.