Skip to content

Commit 412883a

Browse files
author
Richard Jones
committed
Tweaking the signature deletion from mail messages.
Added nuking of the "-----Original Message-----" crap from Outlook.
1 parent bf5a5a9 commit 412883a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

roundup/mailgw.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class node. Any parts of other types are each stored in separate files
7373
an exception, the original message is bounced back to the sender with the
7474
explanatory message given in the exception.
7575
76-
$Id: mailgw.py,v 1.68 2002-05-02 07:56:34 richard Exp $
76+
$Id: mailgw.py,v 1.69 2002-05-06 23:37:21 richard Exp $
7777
'''
7878

7979

@@ -767,7 +767,8 @@ def updateNosy(self, props, author, recipients, current=None):
767767
def parseContent(content, keep_citations, keep_body,
768768
blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
769769
eol=re.compile(r'[\r\n]+'),
770-
signature=re.compile(r'^[>|\s]*[-_]+\s*$')):
770+
signature=re.compile(r'^[>|\s]*[-_]+\s*$'),
771+
original_message=re.compile(r'^-----Original Message-----$')):
771772
''' The message body is divided into sections by blank lines.
772773
Sections where the second and all subsequent lines begin with a ">" or "|"
773774
character are considered "quoting sections". The first line of the first
@@ -815,7 +816,11 @@ def parseContent(content, keep_citations, keep_body,
815816
# if we don't have our summary yet use the first line of this
816817
# section
817818
summary = lines[0]
818-
elif signature.match(lines[0]):
819+
elif signature.match(lines[0]) and 2 <= len(lines) <= 10:
820+
# lose any signature
821+
break
822+
elif original_message.match(lines[0]):
823+
# ditch the stupid Outlook quoting of the entire original message
819824
break
820825

821826
# and add the section to the output
@@ -828,6 +833,14 @@ def parseContent(content, keep_citations, keep_body,
828833

829834
#
830835
# $Log: not supported by cvs2svn $
836+
# Revision 1.68 2002/05/02 07:56:34 richard
837+
# . added option to automatically add the authors and recipients of messages
838+
# to the nosy lists with the options ADD_AUTHOR_TO_NOSY (default 'new') and
839+
# ADD_RECIPIENTS_TO_NOSY (default 'new'). These settings emulate the current
840+
# behaviour. Setting them to 'yes' will add the author/recipients to the nosy
841+
# on messages that create issues and followup messages.
842+
# . added missing documentation for a few of the config option values
843+
#
831844
# Revision 1.67 2002/04/23 15:46:49 rochecompaan
832845
# . stripping of the email message body can now be controlled through
833846
# the config variables EMAIL_KEEP_QUOTED_TEST and

0 commit comments

Comments
 (0)