On 13/09/2016 18:08, Viktor Dukhovni wrote:
Make sure your shell or terminal emulator is not mangling utf-8
input or command-line arguments.
* Post your map.cf file content, perhaps that map file restricts
which lookup keys are passed on to the underlying database.
* Place the lookup key in a file.
* Ensure that the file's content is correctly utf-8 encoded.
* Run:
postmap -v -q - mysql:... < input-file
Repeat with various values of LANG. Note that Postfix applies
MySQL string quoting to input arguments, and the MySQL client
confgiration must somehow decide to use UTF-8 encoding for the
query string.
The map.cf file content is the following :
user = modoboa
password = password
dbname = modoboa
hosts = 127.0.0.1
query = SELECT name FROM admin_domain WHERE name='%s' AND type='domain' AND
enabled=1
I've tried the different steps you proposed and unfortunately, it is not
better:
$ echo raté.com > test
$ file test
test: UTF-8 Unicode text
$ postmap -v -q - mysql:/etc/postfix/sql-domains.cf < test
postmap: name_mask: ipv4
postmap: inet_addr_local: configured 3 IPv4 addresses
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: user = modoboa
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: password = modoboa
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: dbname = modoboa
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: result_format = %s
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: option_file = <NULL>
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: option_group = <NULL>
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: tls_key_file = <NULL>
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: tls_cert_file = <NULL>
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: tls_CAfile = <NULL>
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: tls_CApath = <NULL>
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: tls_ciphers = <NULL>
postmap: cfg_get_bool: /etc/postfix/sql-domains.cf: tls_verify_cert = on
postmap: cfg_get_int: /etc/postfix/sql-domains.cf: expansion_limit = 0
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: query = SELECT name FROM
admin_domain WHERE name='%s' AND type='domain' AND enabled=1
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: domain =
postmap: cfg_get_str: /etc/postfix/sql-domains.cf: hosts = 127.0.0.1
postmap: dict_open: mysql:/etc/postfix/sql-domains.cf
postmap: dict_mysql_get_active: attempting to connect to host 127.0.0.1
postmap: dict_mysql: successful connection to host 127.0.0.1
postmap: dict_mysql: successful query from host 127.0.0.1
postmap: dict_mysql_lookup: retrieved 0 rows
The result is always the same even if I change LANG (tried C and
en_US.UTF-8).
Antoine