[exim] Exim and MySQL with UTF-8 encoding

Top Page
Delete this message
Reply to this message
Author: Yves Goergen
Date:  
To: Exim-users list
Subject: [exim] Exim and MySQL with UTF-8 encoding
Hello,

How can I tell Exim to talk to the MySQL server with UTF-8 encoding?

I've stored sieve autoresponder texts in the database and Exim fetches
them together with other information about virtual mailboxes. The text
is stored as UTF-8 data and Exim expects it to be UTF-8, and the correct
header is placed in the reply messages.

But the problem is that Exim doesn't talk to the MySQL server with UTF-8
so it prevents using all that stuff. Instead, it uses some 8-bit
encoding. I can see this in the reply message: It contains parts like
=FC for "ü" where it should be at least two bytes.

I know that MySQL can be configured to do that, but it requires the
client to properly setup the connection by issuing the command

SET NAMES utf8;

prior to requesting the data. I don't know of any method to tell Exim to
issue such a command once for each MySQL connection. What's the solution
to this?

If this can't be fixed properly, I'd also accept a one-shot solution by
letting MySQL (not Exim, that's too late) explicitly convert the
returned sieve filter data to UTF-8 upon request. Again, I don't know
any method for doing that. (I've tried adding CONVERT(filter USING utf8)
and CONVERT(CAST(filter AS BINARY) USING utf8)) to my SQL query but that
doesn't change anything.)


Yves Goergen
http://unclassified.software