@@ -73,7 +73,7 @@ class node. Any parts of other types are each stored in separate files
7373an exception, the original message is bounced back to the sender with the
7474explanatory message given in the exception.
7575
76- $Id: mailgw.py,v 1.48 2002-01-08 04:12:05 richard Exp $
76+ $Id: mailgw.py,v 1.49 2002-01-10 06:19:18 richard Exp $
7777'''
7878
7979
@@ -693,21 +693,42 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
693693 if not section :
694694 continue
695695 lines = eol .split (section )
696- if lines [0 ] and lines [0 ][0 ] in '>|' :
697- continue
698- if len (lines ) > 1 and lines [1 ] and lines [1 ][0 ] in '>|' :
699- continue
696+ if (lines [0 ] and lines [0 ][0 ] in '>|' ) or (len (lines ) > 1 and
697+ lines [1 ] and lines [1 ][0 ] in '>|' ):
698+ # see if there's a response somewhere inside this section (ie.
699+ # no blank line between quoted message and response)
700+ for line in lines [1 :]:
701+ if line [0 ] not in '>|' :
702+ break
703+ else :
704+ # TODO: people who want to keep quoted bits will want the
705+ # next line...
706+ # l.append(section)
707+ continue
708+ # keep this section - it has reponse stuff in it
709+ if not summary :
710+ # and while we're at it, use the first non-quoted bit as
711+ # our summary
712+ summary = line
713+ lines = lines [lines .index (line ):]
714+ section = '\n ' .join (lines )
715+
700716 if not summary :
717+ # if we don't have our summary yet use the first line of this
718+ # section
701719 summary = lines [0 ]
702- l .append (section )
703- continue
704- if signature .match (lines [0 ]):
720+ elif signature .match (lines [0 ]):
705721 break
722+
723+ # and add the section to the output
706724 l .append (section )
707725 return summary , '\n \n ' .join (l )
708726
709727#
710728# $Log: not supported by cvs2svn $
729+ # Revision 1.48 2002/01/08 04:12:05 richard
730+ # Changed message-id format to "<%s.%s.%s%s@%s>" so it complies with RFC822
731+ #
711732# Revision 1.47 2002/01/02 02:32:38 richard
712733# ANONYMOUS_ACCESS -> ANONYMOUS_REGISTER
713734#
0 commit comments