CVS: tmda/TMDA Pending.py,1.19,1.20
"Jason R. Mastaler" <[email protected]>
| Newsgroups | gmane.mail.spam.tmda.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv8752/TMDA
Modified Files:
Pending.py
Log Message:
Bugfix. If email.message_from_file() fails to parse the message
body, fall back to Util.msg_from_file() which only parses the headers.
This means apps like tmda-cgi which manipulate message body content
won't be able to with such messages, but this is the best we can do
given the broken formatting. This should only normally be the case
with spam messages anyway.
Index: Pending.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Pending.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Pending.py 29 Apr 2003 20:26:01 -0000 1.19
+++ Pending.py 19 May 2003 17:59:39 -0000 1.20
@@ -24,13 +24,13 @@
"""Pending messages functions."""
+from email.Utils import parseaddr
+import email
import glob
import os
import sys
import time
-from email import message_from_file
-from email.Utils import parseaddr
import Defaults
import Errors
import Util
@@ -418,7 +418,10 @@
self.msgfile = os.path.join(Defaults.DATADIR, 'pending', self.msgid)
if not os.path.exists(self.msgfile):
raise Errors.MessageError, '%s not found!' % self.msgid
- self.msgobj = message_from_file(open(self.msgfile, 'r'))
+ try:
+ self.msgobj = email.message_from_file(open(self.msgfile, 'r'))
+ except email.Errors.BoundaryError:
+ self.msgobj = Util.msg_from_file(open(self.msgfile, 'r'))
self.recipient = recipient
def initMessage(self, recipient = None):
_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs