summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 49ab3a1)
raw | patch | inline | side by side (parent: 49ab3a1)
author | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 23 Apr 2002 15:46:49 +0000 (15:46 +0000) | ||
committer | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 23 Apr 2002 15:46:49 +0000 (15:46 +0000) |
the config variables EMAIL_KEEP_QUOTED_TEST and
EMAIL_LEAVE_BODY_UNCHANGED.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@708 57a73879-2fb5-44c3-a270-3262357dd7e2
EMAIL_LEAVE_BODY_UNCHANGED.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@708 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index 10a2368a2f3a2adab8127ab09b5e18035b8c16bb..1650c3991563fac20f09405b3bb33708be2bfdcf 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
<br>View: <display call="link('superseder', showid=1)">
</property>
</td>
+ . stripping of the email message body can now be controlled through the
+ config variables EMAIL_KEEP_QUOTED_TEXT and EMAIL_LEAVE_BODY_UNCHANGED.
Fixed:
. stop sending blank (whitespace-only) notes
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 3dbf229ab3294a828e4e87c2f2e7781bfc1db127..c4967728f26bad8bdc267ae0234b68232194b970 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
an exception, the original message is bounced back to the sender with the
explanatory message given in the exception.
-$Id: mailgw.py,v 1.66 2002-03-14 23:59:24 richard Exp $
+$Id: mailgw.py,v 1.67 2002-04-23 15:46:49 rochecompaan Exp $
'''
else:
content = self.get_part_data_decoded(message)
- summary, content = parseContent(content)
+ keep_citations = self.instance.EMAIL_KEEP_QUOTED_TEXT == 'yes'
+ keep_body = self.instance.EMAIL_LEAVE_BODY_UNCHANGED == 'yes'
+ summary, content = parseContent(content, keep_citations,
+ keep_body)
#
# handle the attachments
# commit the new node(s) to the DB
self.db.commit()
-def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
- eol=re.compile(r'[\r\n]+'), signature=re.compile(r'^[>|\s]*[-_]+\s*$')):
+def parseContent(content, keep_citations, keep_body,
+ blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
+ eol=re.compile(r'[\r\n]+'),
+ signature=re.compile(r'^[>|\s]*[-_]+\s*$')):
''' The message body is divided into sections by blank lines.
Sections where the second and all subsequent lines begin with a ">" or "|"
character are considered "quoting sections". The first line of the first
if line[0] not in '>|':
break
else:
- # TODO: people who want to keep quoted bits will want the
- # next line...
- # l.append(section)
+ # we keep quoted bits if specified in the config
+ if keep_citations:
+ l.append(section)
continue
# keep this section - it has reponse stuff in it
if not summary:
# and add the section to the output
l.append(section)
- return summary, '\n\n'.join(l)
+ # we only set content for those who want to delete cruft from the
+ # message body, otherwise the body is left untouched.
+ if not keep_body:
+ content = '\n\n'.join(l)
+ return summary, content
#
# $Log: not supported by cvs2svn $
+# Revision 1.66 2002/03/14 23:59:24 richard
+# . #517734 ] web header customisation is obscure
+#
# Revision 1.65 2002/02/15 00:13:38 richard
# . #503204 ] mailgw needs a default class
# - partially done - the setting of additional properties can wait for a
diff --git a/roundup/templates/classic/instance_config.py b/roundup/templates/classic/instance_config.py
index d6e76221cd0a66a83b5eb7b65567673d883b40c0..cc57d2aca0565e2740e790261086d7bc865aa349 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: instance_config.py,v 1.13 2002-03-14 23:59:24 richard Exp $
+# $Id: instance_config.py,v 1.14 2002-04-23 15:46:49 rochecompaan Exp $
MAIL_DOMAIN=MAILHOST=HTTP_HOST=None
HTTP_PORT=0
# Where to place the email signature
EMAIL_SIGNATURE_POSITION = 'bottom'
+# Keep email citations
+EMAIL_KEEP_QUOTED_TEXT = 'no'
+
+# Preserve the email body as is
+EMAIL_LEAVE_BODY_UNCHANGED = 'no'
+
# Default class to use in the mailgw if one isn't supplied in email
# subjects. To disable, comment out the variable below or leave it blank.
# Examples:
#
# $Log: not supported by cvs2svn $
+# Revision 1.13 2002/03/14 23:59:24 richard
+# . #517734 ] web header customisation is obscure
+#
# Revision 1.12 2002/02/15 00:13:38 richard
# . #503204 ] mailgw needs a default class
# - partially done - the setting of additional properties can wait for a
diff --git a/roundup/templates/extended/instance_config.py b/roundup/templates/extended/instance_config.py
index b737312cd17dc0b3a139d49934273308e821b9d5..e60c93097b966bc5ec6a727877c74c0142898e0b 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: instance_config.py,v 1.13 2002-03-14 23:59:24 richard Exp $
+# $Id: instance_config.py,v 1.14 2002-04-23 15:46:49 rochecompaan Exp $
MAIL_DOMAIN=MAILHOST=HTTP_HOST=None
HTTP_PORT=0
# Where to place the email signature
EMAIL_SIGNATURE_POSITION = 'bottom'
+# Keep email citations
+EMAIL_KEEP_QUOTED_TEXT = 'no'
+
+# Preserve the email body as is
+EMAIL_LEAVE_BODY_UNCHANGED = 'no'
+
# Default class to use in the mailgw if one isn't supplied in email
# subjects. To disable, comment out the variable below or leave it blank.
# Examples:
#
# $Log: not supported by cvs2svn $
+# Revision 1.13 2002/03/14 23:59:24 richard
+# . #517734 ] web header customisation is obscure
+#
# Revision 1.12 2002/02/15 00:13:38 richard
# . #503204 ] mailgw needs a default class
# - partially done - the setting of additional properties can wait for a