Re: [exim] Exim and MySQL with UTF-8 encoding

Pàgina inicial
Delete this message
Reply to this message
Autor: Yves Goergen
Data:  
A: Exim-users list
Assumpte: Re: [exim] Exim and MySQL with UTF-8 encoding
That looks promising, but doesn't have any effect yet.

I've added the file /etc/mysql/conf.d/exim-utf8.cnf, as included from
/etc/mysql/my.cnf, with the following content:

[exim]
character_set_client=utf8

Then I restarted Exim. The autoresponder e-mail still doesn't contain
UTF-8 encoded characters.

My MySQL server connection doesn't use any special options, so no config
group name here. The default should just apply.

What else can I do?


Yves Goergen
http://unclassified.software

________________________________________
Von: Phil Pennock
Gesendet: Do, 2017-11-09 00:21 +0100
On 2017-11-08 at 22:15 +0100, Yves Goergen wrote:
> How can I tell Exim to talk to the MySQL server with UTF-8 encoding?


If "[exim]" is not already in my.cnf then perhaps:

    # printf '[exim]\ncharacter_set_client=utf8\n' >> /etc/my.cnf


Exim specifies an option group to the MySQL client library. The default
value given is "exim", so in `/etc/my.cnf` you can have a section
starting `[exim]` and put whatever options you want in there.

(MySQL searches a range of places, my last blog-post where I touched
this, I noted that Ubuntu required /etc/mysql/my.cnf so ... figure out
which ones actually work on your distribution; I'm going to write
/etc/my.cnf here)

If that's not specific enough and you want other clients, then the Exim
configuration option `mysql_servers` or the server-spec at the start of
the query has an expanded syntax, as described in "Special MySQL
features" in The Exim Specification:

    host:port(socket)[group]


The `[group]` part there is the name of the group parsed from
`/etc/my.cnf`. So `mysql_servers = maildb.example.com[exim-utf8]`
should work just fine.

My MySQL is incredibly rusty, but I think something like:

/etc/my.cnf :

    [exim]
    host=maildb.example.com
    ssl
    ssl-capath=/etc/ssl/certs/
    character_set_client=utf8


-Phil