[Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.18,1.19
Barry A. Warsaw
bwarsaw at users.sourceforge.net
Mon Jan 12 09:19:30 EST 2004
Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv15976
Modified Files:
sb_imapfilter.py
Log Message:
get_substance(): Catch and ignore MessageParseErrors when parsing the
data['RFC822'] text.
Index: sb_imapfilter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** sb_imapfilter.py 12 Jan 2004 08:36:15 -0000 1.18
--- sb_imapfilter.py 12 Jan 2004 14:19:28 -0000 1.19
***************
*** 368,372 ****
# we go through the hoops of creating a new message, and then
# copying over all its internals.
! new_msg = email.Parser.Parser().parsestr(data["RFC822"])
self._headers = new_msg._headers
self._unixfrom = new_msg._unixfrom
--- 368,376 ----
# we go through the hoops of creating a new message, and then
# copying over all its internals.
! try:
! new_msg = email.Parser.Parser().parsestr(data["RFC822"])
! except email.Errors.MessageParseError, e:
! print 'Skipping unparseable message: %s' % e
! return
self._headers = new_msg._headers
self._unixfrom = new_msg._unixfrom
More information about the Spambayes-checkins
mailing list