The following issue has been RESOLVED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=538 
====================================================================== 
Reported By:                maximP
Assigned To:                paul
====================================================================== 
Project:                    DBMail
Issue ID:                   538
Category:                   general delivery
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     resolved
target:                      
Resolution:                 fixed
Fixed in Version:           2.2.5
====================================================================== 
Date Submitted:             15-Mar-07 17:06 CET
Last Modified:              14-May-07 00:12 CEST
====================================================================== 
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).
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0000548 WISH: Better parsing 8bit header charac...
====================================================================== 

---------------------------------------------------------------------- 
 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                          
22-Mar-07 14:42 paul           Relationship added       related to 0000548  
14-May-07 00:12 paul           Assigned To               => paul            
14-May-07 00:12 paul           Status                   new => resolved     
14-May-07 00:12 paul           Resolution               open => fixed       
14-May-07 00:12 paul           Fixed in Version          => 2.2.5           
======================================================================

_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to