modoboa-installer icon indicating copy to clipboard operation
modoboa-installer copied to clipboard

Amavis + psql for en_US

Open JReming85 opened this issue 2 years ago • 2 comments

Impacted versions

  • Distribution: Debian / Ubuntu / Centos
  • Codename: Jessie / Trusty / Centos 7 / ...
  • Arch: 32 Bits / 64 Bits
  • Database: PostgreSQL

Steps to reproduce

Install on a system with en_US set as locale

When amavis trys to write msgs to psql its default encoding will be set to latin1 and cause errors trying to convert utf8 to latin1 for some emails.

from Mail.err amavis[4079539]: (4079539-09) (!!)ERROR sql_storage: too many retries on storing final, info not saved

From Mail.log amavis[3188766]: (3188766-05) (!)WARN save_info_final: sql exec: err=7, 22P05, DBD::Pg::st execute failed: ERROR: character with byte sequence 0xe2 0x9a 0xa1 in encoding "UTF8" has no equivalent in encoding "LATIN1" at (eval 109) line 173.

Expected behavior

Psql default encoding should be hardcoded to utf8 either by seeing it per user or via the /etc/postgresql/12/main/postgresql.conf file

client_encoding = 'UTF8'

Without that being set, the default is set to auto, which will = latin1 Will update with better info once i am back at my laptop

JReming85 avatar Mar 09 '23 14:03 JReming85

Hi,

wouldn't be easier to edit createdb command and adding -E UTF8 ?

Spitfireap avatar Mar 10 '23 15:03 Spitfireap

Sounds like that would be easier, as long as it honored it and only wrote in UTF8

JReming85 avatar Mar 10 '23 16:03 JReming85