Failed to expand return path when forwarding emails

I recently set email forwarding for a few of the email accounts and in paniclog there are errors:

2024-06-10 13:14:02 1sGKyc-002iFr-Js == <> R=dnslookup T=remote_forwarded_smtp defer (-1): Failed to expand return path “${srs_encode {${readfile{/etc/exim4/srs.conf}}} {$return_path} {$original_domain}}”: empty address

Ubuntu 22.04

What is the content of:
/etc/exim4/srs.conf

kZ0aGTYHeiQ1XhnU

Hello friends, I currently have this problem too. What could be the cause? It seems to be related to bounce messages.

I know this is an old post - but I’ve noticed this in my log files too (paniclog). Multiple instances of:

2024-10-01 05:59:41 1rzuuz-00DFG1-Fj == [email protected] [email protected] R=dnslookup T=remote_forwarded_smtp defer (-1): Failed to expand return path “${if def:return_path {${srs_encode {${readfile{/etc/exim4/srs.conf}}} {$return_path} {$original_domain}}}}”: empty address

/etc/exim4/srs.conf has a value in it (looks like a random string?)

As an update. In exim4.template, I have:

return_path = ${if def:return_path {${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}}}

I’ve changed it to:

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

And I think that has sorted it!

Please create an Github issue for it…

Not sure its quite as simple - as it seems like we need to somehow reference the hostname - or a custom “noreply” email.

Thanks!!! The script described in url solved my problem! Thank You!