Broken message encoding is converted in header, but not in $struct
|Reported by:||bugger||Owned by:|
|Severity:||normal||Keywords:||subject, mime, utf-8, postgres, utf8|
How to reproduce: Send yourself an email that uses non-ASCII, non-MIME encoded special characters in the Subject line. German umlauts in latin1 encoding for example.
You will get errors like these in your postgres logfile:
ERROR: invalid byte sequence for encoding "UTF8": 0xe4f6fc
These are caused in the function:
function add_message_cache($key, $index, $headers, $struct=null)
in the INSERT query (and possibly others). The reason is that while the subject line will go through decode_header (which will strip/replace non-utf8 sequences), serialize($struct) will still carry, for example, latin1 encoded characters.
If I'm not mistaken, this should break caching for messages with subject lines like these.
Version affected: 0.1~rc2-6ubuntu0.1 - maybe this hasn't been fixed in the meantime.
Workaround: Disable caching.