My pgsql database was set to use UTF8.
dbmail: 2.1.3

When tried to move a message in Outlook Express from one mailbox(non-dbmail)
into dbmail, through dbmail-IMAP, I got database error when it tries to
insert the body into dbmail_messageblks:

ERROR: invalid UTF-8 byte sequence detected near byte 0xfe

This absolutely becase the data fed to database was not valid UTF8 sequence.
By checking the email header content-type, it appears to use iso-8859-9:

MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=iso-8859-9; FORMAT=flowed
Content-Transfer-Encoding: 8BIT
Content-ID: <[EMAIL PROTECTED]>

So my guess about how IMAPd working is it took whatever encoding it saw when
startup and never change it. Is it true? And if so, is it true to other
daemons?

I think the daemons should be able to detect what kind of encoding the
source is and set it accordingly.

The same sql statement failed when I run from psql with default encoding. By
switching encoding to LATIN1, I was able to insret the data into the
database.

Do you think this a bug?

Thanks,
Kevin

Reply via email to