Skip to content

Amavis + psql for en_US #488

@JReming85

Description

@JReming85

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions