summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cea4e65)
raw | patch | inline | side by side (parent: cea4e65)
author | dman13 <dman13@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 14 Jun 2002 03:54:21 +0000 (03:54 +0000) | ||
committer | dman13 <dman13@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 14 Jun 2002 03:54:21 +0000 (03:54 +0000) |
use the rfc822 module to ensure that every (oddball) email address and
real-name is properly quoted
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@782 57a73879-2fb5-44c3-a270-3262357dd7e2
real-name is properly quoted
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@782 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index cefb216d5f801b2726daddb1b2ac0ba488acce1c..ee69de26f944b2f39b1c488ad3462f38b9bf206d 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- also changed cgi client since it was duplicating the functionality
Fixed:
+ . #565992 ] if ISSUE_TRACKER_WEB doesn't have the trailing '/', add it
+ . use the rfc822 module to ensure that every (oddball) email address and
+ real-name is properly quoted
. #558867 ] ZRoundup redirect /instance requests to /instance/
. #562130 ] cookie path generated from ZRoundup was wrong in some situations
. stop sending blank (whitespace-only) notes
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index e4b947b4a2285fc9099127a9cb1b06ba7acb77cf..1c49b6fc3c1d7314f6302572b92308ab3d0d5718 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.55 2002-06-11 04:58:07 richard Exp $
+# $Id: roundupdb.py,v 1.56 2002-06-14 03:54:21 dman13 Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
import re, os, smtplib, socket, copy, time, random
import MimeWriter, cStringIO
import base64, quopri, mimetypes
+import rfc822
import hyperdb, date
authname = users.get(authid, 'username')
authaddr = users.get(authid, 'address')
if authaddr:
- authaddr = ' <%s>'%authaddr
+ authaddr = rfc822.dump_address_pair( ('',authaddr) )
else:
authaddr = ''
writer = MimeWriter.MimeWriter(message)
writer.addheader('Subject', '[%s%s] %s'%(cn, nodeid, title))
writer.addheader('To', ', '.join(sendto))
- writer.addheader('From', '%s <%s>'%(authname,
- self.db.config.ISSUE_TRACKER_EMAIL))
- writer.addheader('Reply-To', '%s <%s>'%(self.db.config.INSTANCE_NAME,
- self.db.config.ISSUE_TRACKER_EMAIL))
+ writer.addheader('From', rfc822.dump_address_pair(
+ (authname, self.db.config.ISSUE_TRACKER_EMAIL) ) )
+ writer.addheader('Reply-To', rfc822.dump_address_pair(
+ (self.db.config.INSTANCE_NAME,
+ self.db.config.ISSUE_TRACKER_EMAIL) ) )
writer.addheader('MIME-Version', '1.0')
if messageid:
writer.addheader('Message-Id', messageid)
def email_signature(self, nodeid, msgid):
''' Add a signature to the e-mail with some useful information
'''
- web = self.db.config.ISSUE_TRACKER_WEB + 'issue'+ nodeid
- email = '"%s" <%s>'%(self.db.config.INSTANCE_NAME,
- self.db.config.ISSUE_TRACKER_EMAIL)
+
+ # simplistic check to see if the url is valid,
+ # then append a trailing slash if it is missing
+ base = self.db.config.ISSUE_TRACKER_WEB
+ if not isinstance( base , "" ) or not base.startswith( "http://" ) :
+ base = "Configuration Error: ISSUE_TRACKER_WEB isn't a fully-qualified URL"
+ elif base[-1] != '/' :
+ base += '/'
+ web = base + 'issue'+ nodeid
+ #web = self.db.config.ISSUE_TRACKER_WEB + 'issue'+ nodeid
+
+ # ensure the email address is properly quoted
+ email = rfc822.dump_address_pair( self.db.config.INSTANCE_NAME ,
+ self.db.config.ISSUE_TRACKER_EMAIL )
+
line = '_' * max(len(web), len(email))
return '%s\n%s\n%s\n%s'%(line, email, web, line)
+
def generateCreateNote(self, nodeid):
"""Generate a create note that lists initial property values
"""
#
# $Log: not supported by cvs2svn $
+# Revision 1.55 2002/06/11 04:58:07 richard
+# detabbing
+#
# Revision 1.54 2002/05/29 01:16:17 richard
# Sorry about this huge checkin! It's fixing a lot of related stuff in one go
# though.
# . Login now takes you to the page you back to the were denied access to.
#
# Fixed:
-# . Lots of bugs, thanks Roché and others on the devel mailing list!
+# . Lots of bugs, thanks Roché and others on the devel mailing list!
#
# Revision 1.20 2001/11/25 10:11:14 jhermann
# Typo fix