The following issue has been RESOLVED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=816 
====================================================================== 
Reported By:                namailsj
Assigned To:                paul
====================================================================== 
Project:                    DBMail
Issue ID:                   816
Category:                   Database layer
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
target:                      
Resolution:                 fixed
Fixed in Version:           2.2.14
====================================================================== 
Date Submitted:             07-Nov-09 03:23 CET
Last Modified:              22-Jan-10 14:25 CET
====================================================================== 
Summary:                    DEF_QUERYSIZE is currently 1024, causing sieve
generated autoresponders to fail
Description: 
This issue somehow seems to be related to a previously closed bug -
0000390

If a slightly large message is used for auto-responder using sieve, it
fails with MySQL error while performing SELECT QUERY, because the end of
the query gets truncated.

See the query that fails in lines 5091 - 5095 in db.c in dbmail-2.2.12:

   5091         snprintf(query, DEF_QUERYSIZE,
   5092                         "SELECT lastseen FROM %sreplycache "
   5093                         "WHERE to_addr = '%s' AND from_addr = '%s'
"
   5094                         "AND handle = '%s' AND lastseen > (%s)",
   5095                         DBPFX, escaped_to, escaped_from,
escaped_handle, tmp->str);

increasing the value of DEF_QUERYSIZE to 4096 seems to be a work around,
but would like have something in dbmail.conf to control the size of an
auto-responder instead of modifying DEF_QUERYSIZE in the code.
====================================================================== 

---------------------------------------------------------------------- 
 (0002941) paul (administrator) - 09-Nov-09 15:54
 http://www.dbmail.org/mantis/view.php?id=816#c2941 
---------------------------------------------------------------------- 
I would like to see the actual query being generated here. 

Sounds like the whole reply message is inserted where escaped_handle
should be used. Someone else reported something like that, and if true, it
would definitely imply a bug - though not in the code you mention.

The handle *should* be a md5 hash of the reply-subject and message
combined. 
So show me some logs please, and if possible the sieve script as well. 

---------------------------------------------------------------------- 
 (0002942) namailsj (reporter) - 09-Nov-09 18:09
 http://www.dbmail.org/mantis/view.php?id=816#c2942 
---------------------------------------------------------------------- 
Here is the error message from the logs

Nov  9 08:48:42 testbox dbmail/lmtpd[25734]: Error:[sql]
dbmysql.c,db_query(+290): [You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax
to use near '' at line 1] [SELECT lastseen FROM dbmail_replycache WHERE
to_addr = 'testmess...@test.com' AND from_addr =
'xxxxxxxxxxxxx...@xxxxxxxxxxx.com' AND handle =
'Question:xxxxxxxxxxxxx...@xxxxxxxxxxx.com:Dear Valued Customer,\n\nAdded
useless characters to test the message
length\n01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101


Here is the my test sieve script:

[r...@testbox dbmail-2.2.12]# dbmail-sievecmd -c -u
xxxx...@xxxxxx.xxxxxxxx.com
require "vacation"; if not header :contains "Precedence" ["bulk","list"]
{vacation :from "xxxxxxxxxxxxx...@xxxxxxxxxxx.com" :subject "Question"
"Dear Valued Customer,

Added useless characters to test the message length
01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101

Thank you.

"; }

Also, yet another "Minor" issue, let me know if you would like me to file
it under another bug: if a sieve message has a "/" (slash) character in the
first few words of the auto-responder body then that gets included in the 
"X-DBMail-Vacation:" header, some remote email servers then bounce that
message saying invalid message or mime-type.

Let me know if I could provide you with any other information or testing
to further troubleshoot these issue.

Note: Also uploaded log output as a text file. 
File Name dbmail-issue_0000816_log_01.txt

Thanks.

 

---------------------------------------------------------------------- 
 (0002943) paul (administrator) - 10-Nov-09 12:03
 http://www.dbmail.org/mantis/view.php?id=816#c2943 
---------------------------------------------------------------------- 
Thank you for providing additional information. Looks like we have a bug in
the md5 code.

Please file a separate bug report for the x-dbmail-vacation header issue. 

---------------------------------------------------------------------- 
 (0002990) paul (administrator) - 22-Jan-10 14:25
 http://www.dbmail.org/mantis/view.php?id=816#c2990 
---------------------------------------------------------------------- 
fixed by replacing the md5 implementation 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
07-Nov-09 03:23  namailsj       New Issue                                    
09-Nov-09 15:54  paul           Note Added: 0002941                          
09-Nov-09 18:05  namailsj       Note Added: 0002942                          
09-Nov-09 18:08  namailsj       File Added: dbmail-issue_0000816_log_01.txt     
              
09-Nov-09 18:09  namailsj       Note Edited: 0002942                         
10-Nov-09 12:03  paul           Note Added: 0002943                          
22-Jan-10 14:25  paul           Note Added: 0002990                          
22-Jan-10 14:25  paul           Assigned To               => paul            
22-Jan-10 14:25  paul           Status                   new => resolved     
22-Jan-10 14:25  paul           Resolution               open => fixed       
22-Jan-10 14:25  paul           Fixed in Version          => 2.2.14          
22-Jan-10 14:25  paul           Description Updated                          
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to