P
P
pavlinux2013-09-05 17:28:41
linux
pavlinux, 2013-09-05 17:28:41

Dbmail: invalid byte sequence for encoding "UTF8"?

Sep  1 09:52:12 mail dbmail/lmtpd[25883]: Error:[sql] dbpgsql.c,db_query(+287): query failed [INSERT INTO dbmail_subjectfield (physmessage_id, subjectfield) VALUES (327605,'Хиты нед ели: Дет ский обу чающий п ланшет | Годовой запас пр езервати вов | Зеркало заднего виде + видеорег истратор | Турмалин овая маска д л<D1> ')] : [ERROR:  invalid byte sequence for encoding "UTF8": 0xd120#012HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".#012]

Config :
Debian 6.0.7 x86_64
PostgreSQL  8.4.17
libgmime  2.2.25-27 // (вся ветка 2.2.x косячная, собственно всё из-за неё ) 
DBMail version 2.2.11

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
ALyarskiy, 2014-03-18
@pavlinux

Starting from version 3.1.11 everything should work:
Fixed bug with UTF8 headers
Added UTF8 validation, invalid sequences are removed
Commit:
https://github.com/pjstevns/dbmail/commit/ada17afc...

P
pavlinux, 2013-09-05
@pavlinux

The only anomaly that I noticed is that the parameters in the Content-Type
field are written with a line break and the encoding is in quotation marks.

Content-Type: text/plain; 
              charset="windows-1251"

A
agmt, 2013-09-05
@agmt

0xd020 is really not possible in UTF-8. Maybe the problem is in the client?
PS It would be better to present the given quotes in codes, and not in text, tk. an important component is lost (and only people who are familiar with the bug will be able to answer).

P
pavlinux, 2013-09-06
@pavlinux

Pearl shows such a muck:

echo "?windows-1251?B?0eHw7vEg7+Dw7uv/IPP35fLt7ukg5+Dv6PHoIMzg6erw7vHu9PI=?=" | \
perl -MMIME::Base64 -ne 'print decode_base64($_)' | \
iconv -f cp1251 -t utf-8;
В)ЭЈ
    5ЫќAСброс пароля учетной записи Майкрософт

Where 0xd020 came from is unclear.
echo "?windows-1251?B?0eHw7vEg7+Dw7uv/IPP35fLt7ukg5+Dv6PHoIMzg6erw7vHu9PI=?=" | perl -MMIME::Base64 -ne 'print decode_base64($_)' | od -x 
0000000 29c2 a3dd 350b 9ddb d141 f0e1 f1ee ef20
0000020 f0e0 ebee 20ff f7f3 f2e5 eeed 20e9 e0e7
0000040 e8ef e8f1 cc20 e9e0 f0ea f1ee f4ee 00f2
0000057

P
pavlinux, 2013-09-07
@pavlinux

# vi /etc/postgresql/8.4/main/postgresql.conf

client_encoding = latin1

:wq

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question