A NOTE has been added to this issue.
======================================================================
http://www.dbmail.org/mantis/view.php?id=538
======================================================================
Reported By: maximP
Assigned To:
======================================================================
Project: DBMail
Issue ID: 538
Category: general delivery
Reproducibility: sometimes
Severity: minor
Priority: normal
Status: new
target:
======================================================================
Date Submitted: 15-Mar-07 17:06 CET
Last Modified: 16-Mar-07 14:57 CET
======================================================================
Summary: incorrect field cache values for messages containing
8-bit headers
Description:
It's the supplement to Bug 499 resolving.
While processing wrong messages with not encoded (8-bit) headers, such
headers are obtained by gmime functions not capable to treat them
(g_mime_message_get_subject, etc.) and passed to gmime functions expecting
encoded or utf-8 headers (internet_address_parse_string,
g_mime_utils_header_decode_text, etc.), so abracadabra is inserted in
{subject,from}field DB tables. Proposed patch solves this by converting
headers to utf-8 and properly encoded strings for internal processing and
converting to DB encoding before inserting into DB, so field cache tables
could be used in IMAP message searching later (though such operation is
not yet usable for non-latin strings, since IMAP search arguments aren't
converted to DB encoding before comparing to DB field cache values).
======================================================================
----------------------------------------------------------------------
AntonZ - 15-Mar-07 19:59
----------------------------------------------------------------------
IMAP search required for webmail. Encode headers in you patch destroy this
future.
abracadabra inserted on incorrect detect charset of field (for example
koi8-r pass as windows-1251 before encode to utf8).
My patch decode header fields before insert to cache.
----------------------------------------------------------------------
maximP - 16-Mar-07 11:43
----------------------------------------------------------------------
You're right, headervalue DB table must contain decoded values for
searching (though search string isn't converted to DB encoding before
constructing SELECT statement, and SEARCH CHARSET argument isn't analyzed,
it should be in TODO list). But while answering to FETCH command, such
header values must be encoded to 7-bit, according to RFC 2060 (section
7.4.2. FETCH Response). My new patch dbmail.WrongHeadTry2.patch implement
this and fix the wrong logic of storing headers to {subject, from,
replyto}field tables (this wrong logic comes from gmime way to handle
non-UTF8 8-bit strings).
----------------------------------------------------------------------
paul - 16-Mar-07 11:54
----------------------------------------------------------------------
I've merged both patches. Please test.
----------------------------------------------------------------------
paul - 16-Mar-07 12:20
----------------------------------------------------------------------
I've also merged the last patch. Please use current svn for further updates
and patches.
----------------------------------------------------------------------
maximP - 16-Mar-07 12:28
----------------------------------------------------------------------
Oops, I sent the patch too late.
BTW, you forget to patch dbmail-message.c, I've attached the patch
dbmail-message.c.diff
----------------------------------------------------------------------
paul - 16-Mar-07 14:41
----------------------------------------------------------------------
Maxim,
Those last two patches were already part of the first series, right?
----------------------------------------------------------------------
maximP - 16-Mar-07 14:52
----------------------------------------------------------------------
dbmail-message.c.diff is for 2468 revision
dbmail.headervalue.patch is for 2467 revision
Two of them form dbmail.WrongHeadTry2.patch which is the correct fix of
the bug 538, imho.
dbmail.WrongHead.patch is wrong.
I use 2468 revision plus dbmail-message.c.diff in my DBMail installation
now.
----------------------------------------------------------------------
paul - 16-Mar-07 14:57
----------------------------------------------------------------------
ok, last patch also merged.
Issue History
Date Modified Username Field Change
======================================================================
15-Mar-07 17:06 maximP New Issue
15-Mar-07 17:06 maximP File Added: dbmail.WrongHead.patch
15-Mar-07 19:59 AntonZ File Added: decode_cache_fields.patch
15-Mar-07 19:59 AntonZ Note Added: 0001901
16-Mar-07 11:43 maximP Note Added: 0001902
16-Mar-07 11:44 maximP File Added: dbmail.WrongHeadTry2.patch
16-Mar-07 11:54 paul Note Added: 0001903
16-Mar-07 12:20 paul Note Added: 0001904
16-Mar-07 12:22 maximP File Added: dbmail.headervalue.patch
16-Mar-07 12:26 maximP File Added: dbmail-message.c.diff
16-Mar-07 12:28 maximP Note Added: 0001905
16-Mar-07 14:41 paul Note Added: 0001906
16-Mar-07 14:52 maximP Note Added: 0001907
16-Mar-07 14:57 paul Note Added: 0001908
======================================================================
_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev