The following issue has been RESOLVED.
======================================================================
http://www.dbmail.org/mantis/view.php?id=326
======================================================================
Reported By: sayler
Assigned To: paul
======================================================================
Project: DBMail
Issue ID: 326
Category: PIPE delivery (dbmail-smtp)
Reproducibility: always
Severity: major
Priority: normal
Status: resolved
Resolution: fixed
Fixed in Version: SVN Trunk
======================================================================
Date Submitted: 17-Apr-06 23:14 CEST
Last Modified: 18-Apr-06 11:32 CEST
======================================================================
Summary: dbmail-smtp misparses simple message
Description:
I will attach a sample of a b0rken message. When this message is imported
with dbmail-smtp -d [EMAIL PROTECTED] it is misparsed. Specifically, some of
what is obviously body (comes after \n\n) is treated as a header, which is
then turned up as an X-Invalid-Header. The rest of the message is
preserved, after the bogus header line.
I'll look into this..
======================================================================
----------------------------------------------------------------------
sayler - 17-Apr-06 23:46
----------------------------------------------------------------------
Here's the problem, not sure what the solution is:
while ((t = g_mime_stream_buffer_gets(bstream,
buf, MESSAGE_MAX_LINE_SIZE))) {
if (strncmp(buf,"From ",5)==0)
g_mime_parser_set_scan_from(parser,TRUE);
if ((type==DBMAIL_STREAM_LMTP) &&
(strncmp(buf,".\r\n",3)==0))
break;
g_mime_stream_write_string(mstream, buf);
}
g_free(buf);
in dbmail-message.c (there's a similar call in dbmail-mailbox.c) we handle
>From line (e.g. mbox) handling. Unfortunately, this parsing happens even
if the From appears in the body!
Essentially, we need to be able to write
if (in_header && strncmp(buf,"From ",5)==0)
And expand the LMTP test below to look for the header boundry always..
Working it..
----------------------------------------------------------------------
sayler - 17-Apr-06 23:50
----------------------------------------------------------------------
Attaching a bog simple fix..
----------------------------------------------------------------------
paul - 18-Apr-06 11:32
----------------------------------------------------------------------
Matthew, I think svn-trunk fixes this. I used a fix similar to your own.
Issue History
Date Modified Username Field Change
======================================================================
17-Apr-06 23:14 sayler New Issue
17-Apr-06 23:14 sayler File Added: badmailtest.txt
17-Apr-06 23:15 sayler File Added: badmailtest.log5.txt
17-Apr-06 23:46 sayler Note Added: 0001084
17-Apr-06 23:50 sayler Note Added: 0001085
17-Apr-06 23:51 sayler File Added: patch-2069-fromline
18-Apr-06 11:32 paul Note Added: 0001087
18-Apr-06 11:32 paul Assigned To => paul
18-Apr-06 11:32 paul Status new => resolved
18-Apr-06 11:32 paul Resolution open => fixed
18-Apr-06 11:32 paul Fixed in Version => SVN Trunk
======================================================================