changeset 3173:f412ae175b4d maint-0.8

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Mon, 14 Feb 2005 05:56:00 +0000
parents 08dbdc4b3e6c
children 8fafdef88326
files CHANGES.txt doc/index.txt roundup/cgi/templating.py roundup/mailgw.py test/test_mailgw.py
diffstat 5 files changed, 27 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Mon Feb 14 05:51:14 2005 +0000
+++ b/CHANGES.txt	Mon Feb 14 05:56:00 2005 +0000
@@ -25,6 +25,7 @@
 - fixed class "help" listing paging (sf bug 1106329)
 - nicer error looking up values of None (response to sf bug 1108697)
 - fallback for (list) popups if javascript disabled (sf patch 1101626)
+- ignore AutoReply messages (sf patch 1085051)
 
 
 2005-01-13 0.8.0b2
--- a/doc/index.txt	Mon Feb 14 05:51:14 2005 +0000
+++ b/doc/index.txt	Mon Feb 14 05:56:00 2005 +0000
@@ -78,6 +78,7 @@
 Joe Cooper,
 Kelley Dagley,
 Paul F. Dubois,
+Andrew Eland,
 Jeff Epler,
 Tom Epperly,
 Tamer Fahmy,
--- a/roundup/cgi/templating.py	Mon Feb 14 05:51:14 2005 +0000
+++ b/roundup/cgi/templating.py	Mon Feb 14 05:56:00 2005 +0000
@@ -640,10 +640,13 @@
             property = '&amp;property=%s'%property
         if form:
             form = '&amp;form=%s'%form
-        return '<a class="classhelp" href="javascript:help_window(\'%s?'\
-           '@startwith=0&amp;@template=help&amp;properties=%s%s%s\', \'%s\', \
-            \'%s\')">%s</a>'%(self.classname, properties, property, form, width,
-            height, self._(label))
+        help_url = "%s?@startwith=0&amp;@template=help&amp;"\
+                   "properties=%s%s%s" % \
+                   (self.classname, properties, property, form)
+        onclick = "javascript:help_window('%s', '%s', '%s');return false;" % \
+                  (help_url, width, height)
+        return '<a class="classhelp" href="%s" onclick="%s">%s</a>' % \
+               (help_url, onclick, self._(label))
 
     def submit(self, label=''"Submit New Entry"):
         ''' Generate a submit button (and action hidden element)
--- a/roundup/mailgw.py	Mon Feb 14 05:51:14 2005 +0000
+++ b/roundup/mailgw.py	Mon Feb 14 05:56:00 2005 +0000
@@ -72,7 +72,7 @@
 an exception, the original message is bounced back to the sender with the
 explanatory message given in the exception.
 
-$Id: mailgw.py,v 1.159.2.2 2005-02-14 02:55:30 richard Exp $
+$Id: mailgw.py,v 1.159.2.3 2005-02-14 05:55:20 richard Exp $
 """
 __docformat__ = 'restructuredtext'
 
@@ -579,8 +579,9 @@
         if message.getheader('x-roundup-loop', ''):
             raise IgnoreLoop
 
-        # detect Precedence: Bulk
-        if (message.getheader('precedence', '') == 'bulk'):
+        # detect Precedence: Bulk, or Microsoft Outlook autoreplies
+        if (message.getheader('precedence', '') == 'bulk'
+            or message.getheader('subject', '').lower().find("autoreply") > 0):
             raise IgnoreBulk
 
         # config is used many times in this method.
--- a/test/test_mailgw.py	Mon Feb 14 05:51:14 2005 +0000
+++ b/test/test_mailgw.py	Mon Feb 14 05:56:00 2005 +0000
@@ -8,7 +8,7 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# $Id: test_mailgw.py,v 1.73 2004-10-24 10:01:58 a1s Exp $
+# $Id: test_mailgw.py,v 1.73.2.1 2005-02-14 05:55:20 richard Exp $
 
 # TODO: test bcc
 
@@ -979,7 +979,6 @@
         self.assertEqual(l, [self.richard_id, self.mary_id])
         return nodeid
 
-
     def testDejaVu(self):
         self.assertRaises(IgnoreLoop, self._handle_mail,
             '''Content-Type: text/plain;
@@ -1008,6 +1007,19 @@
 Hi, I'm on holidays, and this is a dumb auto-responder.
 ''')
 
+    def testAutoReplyEmailsAreIgnored(self):
+        self.assertRaises(IgnoreBulk, self._handle_mail,
+            '''Content-Type: text/plain;
+  charset="iso-8859-1"
+From: Chef <chef@bork.bork.bork>
+To: issue_tracker@your.tracker.email.domain.example
+Cc: richard@test
+Message-Id: <dummy_test_message_id>
+Subject: Re: [issue] Out of office AutoReply: Back next week
+
+Hi, I'm back in the office next week
+''')
+
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(MailgwTestCase))

Roundup Issue Tracker: http://roundup-tracker.org/