Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7566/scripts

Modified Files:
        sb_server.py 
Log Message:
Handle message not having a proper separator in insert_exception_header.

Change sb_server to use the centralised insert_exception_header code.

Index: sb_server.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** sb_server.py        29 Nov 2004 00:11:46 -0000      1.30
--- sb_server.py        29 Nov 2004 00:17:58 -0000      1.31
***************
*** 549,569 ****
              # This is one case where an unqualified 'except' is OK, 'cos
              # anything's better than destroying people's email...
!             stream = cStringIO.StringIO()
!             traceback.print_exc(None, stream)
!             details = stream.getvalue()
! 
!             # Build the header.  This will strip leading whitespace from
!             # the lines, so we add a leading dot to maintain indentation.
!             detailLines = details.strip().split('\n')
!             dottedDetails = '\n.'.join(detailLines)
!             headerName = 'X-Spambayes-Exception'
!             header = Header(dottedDetails, header_name=headerName)
! 
!             # Insert the header, converting email.Header's '\n' line
!             # breaks to POP3's '\r\n'.
!             headers, body = re.split(r'\n\r?\n', messageText, 1)
!             header = re.sub(r'\r?\n', '\r\n', str(header))
!             headers += "\n%s: %s\r\n\r\n" % (headerName, header)
!             messageText = headers + body
  
              # Print the exception and a traceback.
--- 549,554 ----
              # This is one case where an unqualified 'except' is OK, 'cos
              # anything's better than destroying people's email...
!             messageText, details = spambayes.message.\
!                                    insert_exception_header(messageText)
  
              # Print the exception and a traceback.

_______________________________________________
Spambayes-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/spambayes-checkins

Reply via email to