summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e2b84cd)
raw | patch | inline | side by side (parent: e2b84cd)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 16 Jan 2002 07:20:54 +0000 (07:20 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 16 Jan 2002 07:20:54 +0000 (07:20 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@556 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/mailgw.py | patch | blob | history |
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 66f91cad054abfd8649b2e21b1e51abcb0907008..9c1bac412ee8e6f2c14df615edb7e935a5ce15e6 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.52 2002-01-15 00:12:40 richard Exp $
+$Id: mailgw.py,v 1.53 2002-01-16 07:20:54 richard Exp $
'''
class MailUsageError(ValueError):
pass
+class MailUsageHelp(Exception):
+ pass
+
class UnAuthorized(Exception):
""" Access denied """
if sendto:
try:
return self.handle_message(message)
+ except MailUsageHelp:
+ # bounce the message back to the sender with the usage message
+ fulldoc = '\n'.join(string.split(__doc__, '\n')[2:])
+ sendto = [sendto[0][1]]
+ m = ['']
+ m.append('\n\nMail Gateway Help\n=================')
+ m.append(fulldoc)
+ m = self.bounce_message(message, sendto, m,
+ subject="Mail Gateway Help")
except MailUsageError, value:
# bounce the message back to the sender with the usage message
fulldoc = '\n'.join(string.split(__doc__, '\n')[2:])
# attach the original message to the returned message
part = writer.nextpart()
part.addheader('Content-Disposition','attachment')
- part.addheader('Content-Description','Message that caused the error')
+ part.addheader('Content-Description','Message you sent')
part.addheader('Content-Transfer-Encoding', '7bit')
body = part.startbody('message/rfc822')
body.write(m.getvalue())
'''
# handle the subject line
subject = message.getheader('subject', '')
+
+ if subject.strip() == 'help':
+ raise MailUsageHelp
+
m = subject_re.match(subject)
if not m:
raise MailUsageError, '''
#
# $Log: not supported by cvs2svn $
+# Revision 1.52 2002/01/15 00:12:40 richard
+# #503340 ] creating issue with [asignedto=p.ohly]
+#
# Revision 1.51 2002/01/14 02:20:15 richard
# . changed all config accesses so they access either the instance or the
# config attriubute on the db. This means that all config is obtained from