[exim] How to filter single quotes out of rcpt-headers?

Pàgina inicial
Delete this message
Reply to this message
Autor: Exim User
Data:  
A: Exim User's Mailing List
Assumpte: [exim] How to filter single quotes out of rcpt-headers?
Dear list,

using Exim 4.5.1 with a MySQL-backend, I ran into a problem when the
recipients-header contained a single quote.

Single quote garbles my SQL-syntax for the recipients mailaddress-lookup in
the database.
Exim replies to the sender: "Temporary local problem - please try later",
while the logfile shows:

2005-11-04 11:25:31 H=(***.***.**) [**.***.***.***] F=<foo'foo@???>
temporarily rejected RCPT <account@???>: MYSQL: query failed: You
have an error in your SQL syntax. Check the manual that corresponds to your
MySQL server version for the right syntax to use near ' foo@???' rlike
sender' at line 1

So I tried to catch all special MySQL-characters in a system-filter, first
of all the single quote. Without success.

if $header_to:,$header_cc:,$header_bcc: matches "\\'"
then
fail text "Delivery failed- Illegal characters in mailaddress."
endif

if $header_to:,$header_cc:,$header_bcc: contains \047
then
fail text "Delivery failed- Illegal characters in mailaddress."
endif

and a lot of other variants.

Anybody out there could help me out with a filter or give me a clip of an
ACL that checks for the address-headers?

Thanks in advance
Sebastian