Hi,

I have the following router:

srs_forward:
  debug_print = "R: srs_forward for $local_part@$domain"
  no_verify
  senders = ! : ! *@+local_domains
  address_data = ${readsocket{/tmp/srsd}\
                {FORWARD $sender_address_local_part@$sender_address_domain 
$primary_hostname\n}\
                                        {5s}{\n}{:defer: SRS daemon failure}}
  errors_to = 
${quote_local_part:${local_part:$address_data}}@${domain:$address_data}
  headers_add = "X-SRS: Sender address rewritten from <$sender_address> to 
<${quote_local_part:${local_part:$address_data}}@${domain:$address_data}> by 
$primary_hostname."
  driver = redirect
  repeat_use = false
  allow_defer
  data = ${quote_local_part:$local_part}@$domain

... where /tmp/srsd relates to srsd from Ubuntu's srs package.

I find that Return-path rewrite does not work. The added X-SRS header contains 
the expression

        
<${quote_local_part:${local_part:$address_data}}@${domain:$address_data}>

which, in actual email, expands to: <""@>

This is since I upgraded to Ubuntu 24.04. The problem did not occur with Ubuntu 
22.04.


One reason this can happen is when $address_data does not contain the expected 
address (tested here using CLI string expansion, where I expect this variable 
to be empty):

Debian-exim@mail:~$ exim4 -be
${quote_local_part:${local_part:$address_data}}@${domain:$address_data}
""@

As the result is not a valid address, errors_to presumably has no effect.

So I suspected the that the socket lookup is not working, but actually is does:

Debian-exim@mail:~$ exim4 -be
${readsocket{/tmp/srsd}{FORWARD [email protected] 
$primary_hostname\n}{5s}{\n}{:defer: SRS daemon failure}}
[email protected]

Feeding this back into the other expansion test, the result is as expected:

Debian-exim@mail:~$ exim4 -be
${quote_local_part:${local_part:[email protected]}}@${domain:[email protected]}
[email protected]

So, the question is: why does $address_data appear to be not filled?

(The socket lookup returns an extra newline, which I suspected to be at fault. 
However, if I add newlines manually in the last expansion test, they don't 
hurt. I also tried replacing them with spaces via the 4th argument of 
readsocket{}, but that made no difference.)

Thanks for any help!

Best,
Peter

PS: I know that srs_encode is now available, 
https://www.exim.org/exim-html-current/doc/html/spec_html/ch-dkim_spf_srs_and_dmarc.html#SECTSRS.
 But I'd still like to understand what's wrong with my config / why it stopped 
working.

--
## subscription configuration (requires account):
##   https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
##   [email protected]
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to