The following issue has been RESOLVED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=338 
====================================================================== 
Reported By:                ryo
Assigned To:                paul
====================================================================== 
Project:                    DBMail
Issue ID:                   338
Category:                   General
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     resolved
target:                      
Resolution:                 fixed
Fixed in Version:           2.1.8
====================================================================== 
Date Submitted:             02-May-06 07:20 CEST
Last Modified:              03-Sep-06 14:10 CEST
====================================================================== 
Summary:                    The header indication is broken in some MUA.
some MUA.
Description: 
If the headervalue length is over 255 bytes, the data up to 255 bytes 
is stored to the variable and the rest of the data is cut off by
_header_cache() 
function in dbmail-message.c.

I think that is because the dbmail_headervalue.headervalue type in mysql
is VARCHAR(255).

But, sometimes the end of encoded mime header (used well in mutli-byte
mail) such as '?=' is lost. So, the header indication is broken in 
some MUA.

In PostgreSQL, it is not necessary to cut off the part of data which
exceeds 255 bytes because dbmail_headervalue.headervalue field type 
is TEXT.

For that reaseon, I made the patch only for PostgreSQL (please see 
the attached file).

Do you have any plan to change the dbmail_headervalue.headervalue type
from VARCHAR(255) to TEXT or MEDIUMTEXT in the future?

====================================================================== 

---------------------------------------------------------------------- 
 paul - 02-May-06 23:06  
---------------------------------------------------------------------- 
Your right. This needs fixing. I'll change the column type for headervalue
in the mysql create_tables file, and include an update/migration script.
Only the index will be truncated, not the actual column for the reason you
specified. The patch will be applied. 

---------------------------------------------------------------------- 
 sayler - 03-May-06 19:21  
---------------------------------------------------------------------- 
Does this mean that queries to return a specific header (as opposed to the
whole header section) will be truncated at 255chars on mysql? 

---------------------------------------------------------------------- 
 paul - 05-May-06 20:31  
---------------------------------------------------------------------- 
Truncation of headers in dbmail_headervalue during insertion has been
removed from the code, and a script was added in sql/mysql/ to fix the
table. Only mysql users need to run the alter table commands. 

---------------------------------------------------------------------- 
 ryo - 26-Jul-06 05:04  
---------------------------------------------------------------------- 
I think that this problem reoccur.
Please see the following patch.

--- dbmail-message.c.orig       2006-07-26 11:01:22.000000000 +0900
+++ dbmail-message.c    2006-07-26 11:03:02.000000000 +0900
@@ -939,7 +939,7 @@
        for (i=0; i<values->len;i++) {
                value = g_tuples_index(values,i,1);
  
-               safe_value = dm_strnesc(value,CACHE_WIDTH_VALUE);
+               safe_value = dm_stresc(value);
                g_string_printf(q,"INSERT INTO %sheadervalue
(headername_id, physmessage_id, headervalue) "
                                "VALUES (%llu,%llu,'%s')", DBPFX, id,
self->physid, safe_value);
                g_free(safe_value); 

---------------------------------------------------------------------- 
 paul - 03-Sep-06 14:10  
---------------------------------------------------------------------- 
You're correct Ryo. This was a regression. Fixed now. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-May-06 07:20 ryo            New Issue                                    
02-May-06 07:20 ryo            File Added: dbmail-headervalue-noclean.patch     
              
02-May-06 23:06 paul           Note Added: 0001150                          
02-May-06 23:06 paul           Assigned To               => paul            
02-May-06 23:06 paul           Status                   new => assigned     
02-May-06 23:06 paul           Projection               none => tweak       
02-May-06 23:06 paul           ETA                      none => < 1 day     
03-May-06 19:21 sayler         Note Added: 0001151                          
05-May-06 20:31 paul           Note Added: 0001154                          
05-May-06 20:31 paul           Status                   assigned => resolved
05-May-06 20:31 paul           Resolution               open => fixed       
05-May-06 20:31 paul           Fixed in Version          => 2.1.6           
26-Jul-06 05:04 ryo            Status                   resolved => feedback
26-Jul-06 05:04 ryo            Resolution               fixed => reopened   
26-Jul-06 05:04 ryo            Note Added: 0001313                          
03-Sep-06 14:10 paul           Note Added: 0001387                          
03-Sep-06 14:10 paul           Status                   feedback => resolved
03-Sep-06 14:10 paul           Resolution               reopened => fixed   
03-Sep-06 14:10 paul           Fixed in Version         2.1.6 => 2.1.8      
======================================================================

Reply via email to