A NOTE has been added to this issue. 
====================================================================== 
http://dbmail.org/mantis/view.php?id=960 
====================================================================== 
Reported By:                RandomBits
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   960
Category:                   IMAP daemon
Reproducibility:            sometimes
Severity:                   major
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             22-Feb-12 22:58 CET
Last Modified:              23-Feb-12 11:49 CET
====================================================================== 
Summary:                    Multipart MIME messages are not reconstructed
properly
Description: 
When dbmail reconstructs some Multi-part messages, it reconstructs the MIME
parts like this:

--Separator Begin
data part
--Separator Begin
--Separator End--
data part

More complicated messages have different errors as desscribed in the
"Additional Information" section.

This occurs in the 3.0.0-1 release as well as the latest git from
2012-02-21 referenced above.  It does not happen on all MIME multi-part
messages.  In my mail flow it affects about 1/20 messages and I haven't
discerned a pattern.

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

---------------------------------------------------------------------- 
 (0003409) paul (administrator) - 23-Feb-12 01:01
 http://dbmail.org/mantis/view.php?id=960#c3409 
---------------------------------------------------------------------- 
apparently the test-cases need to be expanded for more complex mime
structures.

the code is in:

- retrieval/reconstruction
src/dbmail-message.c, _mime_retrieve()

- test messages
test/check_dbmail.h

- unit-tests 
test/check_dbmail_message.c, test_dbmail_message_store 

---------------------------------------------------------------------- 
 (0003410) RandomBits (reporter) - 23-Feb-12 03:39
 http://dbmail.org/mantis/view.php?id=960#c3410 
---------------------------------------------------------------------- 
Thanks for the code pointers.  I did a little investigating and found that
the database contents seem correct.  Here is the diagnostic query I used:

SELECT l.part_key,l.part_depth,l.part_order,l.is_header, mp.data
                        FROM dbmail_mimeparts p 
                        JOIN dbmail_partlists l ON p.id = l.part_id 
                        JOIN dbmail_mimeparts mp ON mp.id = l.part_id 
                        JOIN dbmail_physmessage ph ON ph.id =
l.physmessage_id
                        WHERE l.physmessage_id = ***PHYSMESSAGEID*** ORDER
BY l.part_key,l.part_order ASC

I'm going to take a stab at the code and see if I can follow the logic
enough to get it working.  Here is what I expect to see once the message
has been rebuilt:

[Message headers]
Content-Type: multipart/related;
    boundary="----=_Part_228805_1858578061.1329804655776"


------=_Part_228805_1858578061.1329804655776
Content-Type: multipart/alternative;
    boundary="----=_Part_228806_1971825612.1329804655776"


------=_Part_228806_1971825612.1329804655776
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

[plain-text content]
------=_Part_228806_1971825612.1329804655776
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit


[HTML content]
------=_Part_228805_1858578061.1329804655776-- [this ends the
multipart-alternative text/HTML content]

------=_Part_228805_1858578061.1329804655776
Content-Type: image/png; name=logo.png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=logo.png
Content-ID: <logo.png>
Content-Description: /logo.png

[PNG CONTENT]
------=_Part_228805_1858578061.1329804655776
Content-Type: image/png; name=error.png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=error.png
Content-ID: <error.png>
Content-Description: /error.png

[PNG CONTENT]
------=_Part_228805_1858578061.1329804655776
Content-Type: image/png; name=icon1.png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=icon1.png
Content-ID: <icon1.png>
Content-Description: /icon1.png

[PNG CONTENT]
------=_Part_228805_1858578061.1329804655776
Content-Type: image/png; name=icon2.png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=icon2.png
Content-ID: <icon2.png>
Content-Description: /icon2.png

[PNG CONTENT]
------=_Part_228805_1858578061.1329804655776
Content-Type: image/png; name=button.png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=button.png
Content-ID: <button.png>
Content-Description: /button.png

[PNG CONTENT]
------=_Part_228805_1858578061.1329804655776
Content-Type: image/png; name=icon3.png
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename=icon3.png
Content-ID: <icon3.png>
Content-Description: /icon3.png

[PNG CONTENT]
------=_Part_228805_1858578061.1329804655776-- 

---------------------------------------------------------------------- 
 (0003411) RandomBits (reporter) - 23-Feb-12 04:26
 http://dbmail.org/mantis/view.php?id=960#c3411 
---------------------------------------------------------------------- 
No luck.  I wasn't able to wrap my brain around the reconstitution logic. 

---------------------------------------------------------------------- 
 (0003412) paul (administrator) - 23-Feb-12 11:49
 http://dbmail.org/mantis/view.php?id=960#c3412 
---------------------------------------------------------------------- 
The separator ending the multipart/alternative in your penultimate note is
incorrect. With the corrected separator it passes the tests. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
22-Feb-12 22:58  RandomBits     New Issue                                    
22-Feb-12 22:59  RandomBits     Issue Monitored: RandomBits                    
23-Feb-12 01:01  paul           Note Added: 0003409                          
23-Feb-12 03:39  RandomBits     Note Added: 0003410                          
23-Feb-12 04:26  RandomBits     Note Added: 0003411                          
23-Feb-12 11:49  paul           Note Added: 0003412                          
======================================================================

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

Reply via email to