summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 34fa54d)
raw | patch | inline | side by side (parent: 34fa54d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 27 Apr 2003 02:16:48 +0000 (02:16 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 27 Apr 2003 02:16:48 +0000 (02:16 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1687 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/mailgw.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 1d294f6a2e7bfc0f3530aa70ad1309813dd981a7..ef60af1d2484af3c40bf82326ca529900d2ec245 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- added creation to index columns (sf bug 708247)
- fixed missing (pre-commit) journal entries in *dbm backends (sf bug 679217)
- URL cited in roundup email confusing dumb Email clients (sf bug 716585)
+- set title on issues even when the email body is empty (sf bug 727430)
2003-??-?? 0.5.7
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 3e6cb8ef17a002838a5f62b41f23636c07351e16..ca9ed5a41aafd5db8af55116dbb737369ef9933e 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.120 2003-04-24 20:30:37 kedder Exp $
+$Id: mailgw.py,v 1.121 2003-04-27 02:16:46 richard Exp $
'''
import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
Subject was: "%s"
'''%(nodeid, subject)
-
# Handle the arguments specified by the email gateway command line.
# We do this by looping over the list of self.arguments looking for
# a -C to tell us what class then the -S setting string.
if recipient:
recipients.append(recipient)
- #
- # XXX extract the args NOT USED WHY -- rouilj
- #
- subject_args = m.group('args')
-
#
# handle the subject argument list
#
Subject was: "%s"
'''%(errors, subject)
+
+ # set the issue title to the subject
+ if properties.has_key('title') and not issue_props.has_key('title'):
+ issue_props['title'] = title.strip()
+
#
# handle message-id and in-reply-to
#
# pre-load the messages list
props['messages'] = [message_id]
- # set the title to the subject
- if properties.has_key('title') and not props.has_key('title'):
- props['title'] = title
-
#
# perform the node change / create
#
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index 138059bafc64a083a9285da2ba8c7c9a83b9b69d..d524b787f73e3875eaa39b3879fdc399f0f6e646 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.
#
-# $Id: test_mailgw.py,v 1.44 2003-04-17 06:51:44 richard Exp $
+# $Id: test_mailgw.py,v 1.45 2003-04-27 02:16:47 richard Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
import rfc822
except OSError, error:
if error.errno not in (errno.ENOENT, errno.ESRCH): raise
+ def testEmptyMessage(self):
+ message = cStringIO.StringIO('''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: [issue] Testing...
+
+''')
+ 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()
+ self.assertEqual('no error', error)
+ self.assertEqual(self.db.issue.get(nodeid, 'title'), 'Testing...')
+
def doNewIssue(self):
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"