[Pymilter] Malformed attachment problem

Stuart D. Gathman stuart at bmsi.com
Tue Nov 9 18:04:22 EST 2004


On Tue, 9 Nov 2004, Stuart D. Gathman wrote:

> Here is my attempt to postphone parsing of rfc822 attachments until needed:

Here is the additional test case in testmime.py (sorry, reversed diff):

6d6
< from email import Errors
34,44d33
<     msg = mime.MimeMessage(open('test/missingboundary',"r"))
<     # should get no exception as long as we don't try to parse
<     # message attachments
<     mime.defang(msg,scan_rfc822=False)
<     msg.dump(open('test/missingboundary.out','w'))
<     msg = mime.MimeMessage(open('test/missingboundary',"r"))
<     try:
<       mime.defang(msg)
<       self.fail('should get boundary error parsing bad rfc822 attachment')
<     except Errors.BoundaryError:
<       pass

-- 
	      Stuart D. Gathman <stuart at bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.




More information about the Pymilter mailing list