[Exim] Denying localparts containing backslashes

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Hans-Peter Zahno
Datum:  
To: exim-users
Betreff: [Exim] Denying localparts containing backslashes
Dear all,

I'm running Exim 4.20 on Solaris 9.
I'm having troubles with addresses with a leading backslash, like
<\xyz@???>. Exim seems to ignore the backslash and correctly routing the
message to our Exchange-Server. But this one doesn't recongize this address
and forwards it to our MX, which is Exim, leading to a mail loop.

I wanted to modify the Default ACL
  deny    local_parts   = ^.*[@%!/|] : ^\\.
by adding the backslash in the character class, like
  deny    local_parts   = ^.*[\\@%!/|] : ^\\.
or
  deny    local_parts   = ^.*[\\134@%!/|] : ^\\.


but without success.

I did then some tests with exim in debug mode and got the following output:
...
rcpt to: <\xyz@???>
10:42:56 19749 SMTP<< rcpt to: <\xyz@???>
10:42:56 19749 ---0 Get 757448    16        parse.c  615
10:42:56 19749 ---0 Get 757464    16       string.c  387
10:42:56 19749 ---0 Get 757480     8      deliver.c 3847
10:42:56 19749 ---0 Get 757488     8       string.c  387
10:42:56 19749 ---0 Get 757496    24       string.c  349
10:42:56 19749 using ACL "acl_check_rcpt"
10:42:56 19749 processing "deny"
10:42:56 19749 check local_parts = ^.*[\134@%!/|] : ^\\.
10:42:56 19749 ---0 Get 757520     8       string.c  387
10:42:56 19749 ---0 Get 757528   104       string.c  817
10:42:56 19749 ---0 Rst 757546    **       expand.c 3917 24600
10:42:56 19749 expanding: ^.*[\134@%!/|] : ^\\.
10:42:56 19749    result: ^.*[\@%!/|] : ^\.
10:42:56 19749 ---0 Get 757552    32       string.c  349
10:42:56 19749 ---0 Get 757584    72         exim.c   32
10:42:56 19749 ---0 Get 757656    40         exim.c   32
10:42:56 19749 xyz in "^.*[\@%!/|] : ^\."? no (end of list)
10:42:56 19749 deny: condition test failed
...
After the debug output it seems, that exim passes the search string
(localpart) without the backslash to the pattern matching function.


Another test, with the backslash at another place gave the same result:
...
rcpt to: <x\yz@???>
10:58:51 21000 SMTP<< rcpt to: <x\yz@???>
10:58:51 21000 ---0 Get 757448    16        parse.c  615
10:58:51 21000 ---0 Get 757464    16       string.c  387
10:58:51 21000 ---0 Get 757480     8      deliver.c 3847
10:58:51 21000 ---0 Get 757488     8       string.c  387
10:58:51 21000 ---0 Get 757496    24       string.c  349
10:58:51 21000 using ACL "acl_check_rcpt"
10:58:51 21000 processing "deny"
10:58:51 21000 check local_parts = ^.*[\\134@%!/|] : ^\\.
10:58:51 21000 ---0 Get 757520     8       string.c  387
10:58:51 21000 ---0 Get 757528   104       string.c  817
10:58:51 21000 ---0 Rst 757549    **       expand.c 3917 24600
10:58:51 21000 expanding: ^.*[\\134@%!/|] : ^\\.
10:58:51 21000    result: ^.*[\134@%!/|] : ^\.
10:58:51 21000 ---0 Get 757552    32       string.c  349
10:58:51 21000 ---0 Get 757584    72         exim.c   32
10:58:51 21000 ---0 Get 757656    40         exim.c   32
10:58:51 21000 xyz in "^.*[\134@%!/|] : ^\."? no (end of list)
10:58:51 21000 deny: condition test failed
...


So, to make it short:
how can I prevent exim to accept localparts containing a backslash character?

Thanks for any help!
Regards
Hans-Peter