Menu

#22 email message generates error in pop3proxy.py

closed
pop3proxy (138)
5
2003-03-06
2003-02-26
David Shaw
No

Hi all,
A friend of mine had a cache file in his "unknown" folder that caused the "review" web page in pop3proxy.py to generate the following traceback:

Traceback (most recent call last):

File "spambayes/Dibbler.py", line 398, in found_terminator
getattr(plugin, name)(**params)

File "pop3proxy.py", line 929, in onReview
judgement = judgement.split(';')[0].strip()

File "pop3proxy.py", line 815, in _makeMessageInfo
print type(text)

AttributeError: 'list' object has no attribute 'replace'

He sent me the offending message, and I replicated the problem:

msg = open("/Users/dshaw/Desktop/crash_spam.txt", "r")
message = mbox.get_message(msg)
part = typed_subpart_iterator(message, 'text', 'plain').next()
text = part.get_payload()
>>> text
[<email.Message.Message instance at 0x275ff0>]

So, instead of text, the payload is a list containing a single email message instance. Here are the objects' respective payloads:

>>> message._payload
[<email.Message.Message instance at 0x279290>, <email.Message.Message instance at 0x279160>, <email.Message.Message instance at 0x279e00>, <email.Message.Message instance at 0x280b10>, <email.Message.Message instance at 0x281340>, <email.Message.Message instance at 0x2828d0>, <email.Message.Message instance at 0x283300>, <email.Message.Message instance at 0x2b60a0>, <email.Message.Message instance at 0x27f4d0>, <email.Message.Message instance at 0x2b7c70>, <email.Message.Message instance at 0x2b9ac0>, <email.Message.Message instance at 0x2b8c30>, <email.Message.Message instance at 0x2bb770>, <email.Message.Message instance at 0x2bc180>]

Discussion

  • David Shaw

    David Shaw - 2003-02-26

    crash spam

     
  • Mark Hammond

    Mark Hammond - 2003-02-26
    • labels: --> pop3proxy
     
  • Tim Stone

    Tim Stone - 2003-02-26
    • assigned_to: nobody --> timstone4
     
  • Tim Stone

    Tim Stone - 2003-02-28

    Logged In: YES
    user_id=645698

    I just checked in a fix for this problem. I have no ability to actually test it,
    though. Please try your test case again and let me know the outcome.

     
  • David Shaw

    David Shaw - 2003-02-28

    Logged In: YES
    user_id=244639

    Seems to be fixed! Thanks.

     
  • Tim Stone

    Tim Stone - 2003-02-28
    • status: open --> closed
     
  • Tim Stone

    Tim Stone - 2003-03-05

    Logged In: YES
    user_id=645698

    I just checked in a fix for this problem. I have no ability to actually test it,
    though. Please try your test case again and let me know the outcome.

     
  • Tim Stone

    Tim Stone - 2003-03-05
    • status: closed --> open
     
  • Tim Stone

    Tim Stone - 2003-03-06
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB