summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e811029)
raw | patch | inline | side by side (parent: e811029)
author | jlgijsbers <jlgijsbers@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 5 Sep 2003 20:56:39 +0000 (20:56 +0000) | ||
committer | jlgijsbers <jlgijsbers@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 5 Sep 2003 20:56:39 +0000 (20:56 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1855 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/mailgw.py | patch | blob | history |
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index f71e63fbbc049d28d2a53e8fb8d3e5503cebd8ad..11cbf7432c4aec0f27359ef92c478808c7a34aa7 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-'''
+"""
An e-mail gateway for Roundup.
Incoming messages are examined for multiple parts:
an exception, the original message is bounced back to the sender with the
explanatory message given in the exception.
-$Id: mailgw.py,v 1.126 2003-06-25 08:02:51 neaj Exp $
-'''
+$Id: mailgw.py,v 1.127 2003-09-05 20:56:39 jlgijsbers Exp $
+"""
import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
import time, random, sys
pass
class MailLoop(Exception):
- ''' We've seen this message before... '''
+ """ We've seen this message before... """
pass
class Unauthorized(Exception):
self.trapExceptions = 1
def do_pipe(self):
- ''' Read a message from standard input and pass it to the mail handler.
+ """ Read a message from standard input and pass it to the mail handler.
Read into an internal structure that we can seek on (in case
there's an error).
XXX: we may want to read this into a temporary file instead...
- '''
+ """
s = cStringIO.StringIO()
s.write(sys.stdin.read())
s.seek(0)
return 0
def do_mailbox(self, filename):
- ''' Read a series of messages from the specified unix mailbox file and
+ """ Read a series of messages from the specified unix mailbox file and
pass each to the mail handler.
- '''
+ """
# open the spool file and lock it
import fcntl
# FCNTL is deprecated in py2.3 and fcntl takes over all the symbols
return self.handle_Message(Message(fp))
def handle_Message(self, message):
- '''Handle an RFC822 Message
+ """Handle an RFC822 Message
Handle the Message object by calling handle_message() and then cope
with any errors raised by handle_message.
This method's job is to make that call and handle any
errors in a sane manner. It should be replaced if you wish to
handle errors in a different manner.
- '''
+ """
# in some rare cases, a particularly stuffed-up e-mail will make
# its way into here... try to handle it gracefully
sendto = message.getaddrlist('from')
m = None
if not m:
- raise MailUsageError, '''
+ raise MailUsageError, """
The message you sent to roundup did not contain a properly formed subject
line. The subject must contain a class name or designator to indicate the
-"topic" of the message. For example:
+'topic' of the message. For example:
Subject: [issue] This is a new issue
- - this will create a new issue in the tracker with the title "This is
- a new issue".
+ - this will create a new issue in the tracker with the title 'This is
+ a new issue'.
Subject: [issue1234] This is a followup to issue 1234
- this will append the message's contents to the existing issue 1234
in the tracker.
-Subject was: "%s"
-'''%subject
+Subject was: '%s'
+"""%subject
# get the class
try: