summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eaede6d)
raw | patch | inline | side by side (parent: eaede6d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 9 Jul 2002 01:21:24 +0000 (01:21 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 9 Jul 2002 01:21:24 +0000 (01:21 +0000) |
that exceptions are reported earlier (and hence make sense).
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@838 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@838 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/mailgw.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 53dc401d20dea4d9c4ba0613aa34621586ec9f67..ad9c10594e1aabf76365c9cf31997bc9d1c860a0 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.
an exception, the original message is bounced back to the sender with the
explanatory message given in the exception.
-$Id: mailgw.py,v 1.74 2002-05-29 01:16:17 richard Exp $
+$Id: mailgw.py,v 1.75 2002-07-09 01:21:24 richard Exp $
'''
'''
self.instance = instance
self.db = db
self.instance = instance
self.db = db
+ # should we trap exceptions (normal usage) or pass them through
+ # (for testing)
+ self.trapExceptions = 1
+
def main(self, fp):
''' fp - the file from which to read the Message.
'''
def main(self, fp):
''' fp - the file from which to read the Message.
'''
# its way into here... try to handle it gracefully
sendto = message.getaddrlist('from')
if sendto:
# its way into here... try to handle it gracefully
sendto = message.getaddrlist('from')
if sendto:
+ if not self.trapExceptions:
+ return self.handle_message(message)
try:
return self.handle_message(message)
except MailUsageHelp:
try:
return self.handle_message(message)
except MailUsageHelp:
#
# $Log: not supported by cvs2svn $
#
# $Log: not supported by cvs2svn $
+# Revision 1.74 2002/05/29 01:16:17 richard
+# Sorry about this huge checkin! It's fixing a lot of related stuff in one go
+# though.
+#
+# . #541941 ] changing multilink properties by mail
+# . #526730 ] search for messages capability
+# . #505180 ] split MailGW.handle_Message
+# - also changed cgi client since it was duplicating the functionality
+# . build htmlbase if tests are run using CVS checkout (removed note from
+# installation.txt)
+# . don't create an empty message on email issue creation if the email is empty
+#
# Revision 1.73 2002/05/22 04:12:05 richard
# . applied patch #558876 ] cgi client customization
# ... with significant additions and modifications ;)
# Revision 1.73 2002/05/22 04:12:05 richard
# . applied patch #558876 ] cgi client customization
# ... with significant additions and modifications ;)
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index 622f965422c1893e6fd239fc089976c0d33b4cce..e7cd0b1e138e1af2d8b77ef4d66de084c9c27bd5 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.21 2002-06-18 03:59:59 dman13 Exp $
+# $Id: test_mailgw.py,v 1.22 2002-07-09 01:21:24 richard Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
nodeid = handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
nodeid = handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
nodeid = handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
nodeid = handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
''')
userlist = self.db.user.list()
handler = self.instance.MailGW(self.instance, self.db)
''')
userlist = self.db.user.list()
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
handler.main(message)
if os.path.exists(os.environ['SENDMAILDEBUG']):
error = open(os.environ['SENDMAILDEBUG']).read()
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a test submission of a new issue.
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
# TODO: fix the damn config - this is apalling
self.db.config.MESSAGES_TO_AUTHOR = 'yes'
handler.main(message)
# TODO: fix the damn config - this is apalling
self.db.config.MESSAGES_TO_AUTHOR = 'yes'
handler.main(message)
This is a second followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a second followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@your.tracker.email.domain.example
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@your.tracker.email.domain.example
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
l = self.db.issue.get('1', 'nosy')
l.sort()
handler.main(message)
l = self.db.issue.get('1', 'nosy')
l.sort()
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
This is a followup
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
''')
handler = self.instance.MailGW(self.instance, self.db)
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
l = self.db.issue.get('1', 'nosy')
l.sort()
handler.main(message)
l = self.db.issue.get('1', 'nosy')
l.sort()
''')
handler = self.instance.MailGW(self.instance, self.db)
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@your.tracker.email.domain.example
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@your.tracker.email.domain.example
''')
handler = self.instance.MailGW(self.instance, self.db)
''')
handler = self.instance.MailGW(self.instance, self.db)
+ handler.trapExceptions = 0
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@your.tracker.email.domain.example
handler.main(message)
self.compareStrings(open(os.environ['SENDMAILDEBUG']).read(),
'''FROM: roundup-admin@your.tracker.email.domain.example
#
# $Log: not supported by cvs2svn $
#
# $Log: not supported by cvs2svn $
+# Revision 1.21 2002/06/18 03:59:59 dman13
+# Updated message strings to match the RFC822 address quoting performed
+# by the 'email' and 'rfc822' modules. The verification really should
+# use a RFC2822 message parser rather than literal string comparisions
+# to allow for legal variations in messages.
+#
# Revision 1.20 2002/05/29 01:16:17 richard
# Sorry about this huge checkin! It's fixing a lot of related stuff in one go
# though.
# Revision 1.20 2002/05/29 01:16:17 richard
# Sorry about this huge checkin! It's fixing a lot of related stuff in one go
# though.