summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bad0de7)
raw | patch | inline | side by side (parent: bad0de7)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 12 Jan 2003 00:41:27 +0000 (00:41 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 12 Jan 2003 00:41:27 +0000 (00:41 +0000) |
cc addresses, different from address and different nosy list property)
(thanks John Rouillard)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1436 57a73879-2fb5-44c3-a270-3262357dd7e2
(thanks John Rouillard)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1436 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index c27eb53bd3698a6752d0644cca84492a8fc73ea7..b8e070b2d086dcb9b5cee9fe6473801f52aaeda1 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- better hyperlinking in web message texts
- support setting of properties on message and file through web and
email interface (thanks John Rouillard)
+- allow additional control over the roundupdb email sending (explicit
+ cc addresses, different from address and different nosy list property)
+ (thanks John Rouillard)
2003-01-10 0.5.4
diff --git a/doc/customizing.txt b/doc/customizing.txt
index 1251db9518f589a4aa12f1875b70b45026b922a3..3ff2f48f3affc45ba2578289d1d376701d850942 100644 (file)
--- a/doc/customizing.txt
+++ b/doc/customizing.txt
Customising Roundup
===================
-:Version: $Revision: 1.68 $
+:Version: $Revision: 1.69 $
.. This document borrows from the ZopeBook section on ZPT. The original is at:
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
The email address that e-mail sent to roundup should go to. Think of it as the
tracker's personal e-mail address.
-**TRACKER_WEB** - ``'http://your.tracker.url.example/'``
+**TRACKER_WEB** - ``'http://tracker.example/cgi-bin/roundup.cgi/bugs/'``
The web address that the tracker is viewable at. This will be included in
- information sent to users of the tracker. The URL must include the cgi-bin
- part or anything else that is required to get to the home page of the
- tracker. You must include a trailing '/' in the URL.
+ information sent to users of the tracker. The URL **must** include the
+ cgi-bin part or anything else that is required to get to the home page of
+ the tracker. You **must** include a trailing '/' in the URL.
**ADMIN_EMAIL** - ``'roundup-admin@%s'%MAIL_DOMAIN``
The email address that roundup will complain to if it runs into trouble.
+**EMAIL_FROM_TAG** - ``''``
+ Additional text to include in the "name" part of the ``From:`` address used
+ in nosy messages. If the sending user is "Foo Bar", the ``From:`` line is
+ usually::
+ "Foo Bar" <issue_tracker@tracker.example>
+
+ the EMAIL_FROM_TAG goes inside the "Foo Bar" quotes like so::
+
+ "Foo Bar EMAIL_FROM_TAG" <issue_tracker@tracker.example>
+
**MESSAGES_TO_AUTHOR** - ``'yes'`` or``'no'``
Send nosy messages to the author of the message.
# The email address that mail to roundup should go to
TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
- # The web address that the tracker is viewable at
- TRACKER_WEB = 'http://your.tracker.url.example/'
+ # The web address that the tracker is viewable at. This will be included in
+ # information sent to users of the tracker. The URL MUST include the cgi-bin
+ # part or anything else that is required to get to the home page of the
+ # tracker. You MUST include a trailing '/' in the URL.
+ TRACKER_WEB = 'http://tracker.example/cgi-bin/roundup.cgi/bugs/'
# The email address that roundup will complain to if it runs into trouble
ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
+ # Additional text to include in the "name" part of the From: address used
+ # in nosy messages. If the sending user is "Foo Bar", the From: line is
+ # usually: "Foo Bar" <issue_tracker@tracker.example>
+ # the EMAIL_FROM_TAG goes inside the "Foo Bar" quotes like so:
+ # "Foo Bar EMAIL_FROM_TAG" <issue_tracker@tracker.example>
+ EMAIL_FROM_TAG = ""
+
# Send nosy messages to the author of the message
MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no'
MAIL_DEFAULT_CLASS = 'issue' # use "issue" class by default
#MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out)
+ #
+ # SECURITY DEFINITIONS
+ #
+ # define the Roles that a user gets when they register with the tracker
+ # these are a comma-separated string of role names (e.g. 'Admin,User')
+ NEW_WEB_USER_ROLES = 'User'
+ NEW_EMAIL_USER_ROLES = 'User'
+
Tracker Schema
==============
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 18505d99c25de389ae3df95da3f10d097ac15138..7723174c01e5d3379ca9e54c0981bdb16a2c0921 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.75 2002-12-11 01:52:20 richard Exp $
+# $Id: roundupdb.py,v 1.76 2003-01-12 00:41:26 richard Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
appended to the "messages" field of the specified issue.
"""
- def nosymessage(self, nodeid, msgid, oldvalues):
+ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
+ from_address=[], cc=[], bcc=[]):
"""Send a message to the members of an issue's nosy list.
The message is sent only to users on the nosy list who are not
sendto.append(authid)
r[authid] = 1
+ # now deal with cc people.
+ for cc_userid in cc :
+ if r.has_key(cc_userid):
+ continue
+ # send it to them
+ sendto.append(cc_userid)
+ recipients.append(cc_userid)
+
# now figure the nosy people who weren't recipients
- nosy = self.get(nodeid, 'nosy')
+ nosy = self.get(nodeid, whichnosy)
for nosyid in nosy:
# Don't send nosy mail to the anonymous user (that user
# shouldn't appear in the nosy list, but just in case they
messages.set(msgid, recipients=recipients)
# send the message
- self.send_message(nodeid, msgid, note, sendto)
+ self.send_message(nodeid, msgid, note, sendto, from_address)
# backwards compatibility - don't remove
sendmessage = nosymessage
- def send_message(self, nodeid, msgid, note, sendto):
+ def send_message(self, nodeid, msgid, note, sendto, from_address=None):
'''Actually send the nominated message from this node to the sendto
recipients, with the note appended.
'''
# make sure the To line is always the same (for testing mostly)
sendto.sort()
+ # make sure we have a from address
+ if from_address is None:
+ from_address = self.db.config.TRACKER_EMAIL
+
+ # additional bit for after the From: "name"
+ from_tag = getattr(self.db.config, 'EMAIL_FROM_TAG', '')
+ if from_tag:
+ from_tag = ' ' + from_tag
+
# create the message
message = cStringIO.StringIO()
writer = MimeWriter.MimeWriter(message)
writer.addheader('Subject', '[%s%s] %s'%(cn, nodeid, title))
writer.addheader('To', ', '.join(sendto))
- writer.addheader('From', straddr(
- (authname, self.db.config.TRACKER_EMAIL) ) )
- writer.addheader('Reply-To', straddr(
- (self.db.config.TRACKER_NAME,
- self.db.config.TRACKER_EMAIL) ) )
+ writer.addheader('From', straddr((authname + from_tag, from_address)))
+ writer.addheader('Reply-To', straddr((self.db.config.TRACKER_NAME,
+ from_address)))
writer.addheader('Date', time.strftime("%a, %d %b %Y %H:%M:%S +0000",
time.gmtime()))
writer.addheader('MIME-Version', '1.0')
# now try to send the message
if SENDMAILDEBUG:
- open(SENDMAILDEBUG, 'w').write('FROM: %s\nTO: %s\n%s\n'%(
+ open(SENDMAILDEBUG, 'a').write('FROM: %s\nTO: %s\n%s\n'%(
self.db.config.ADMIN_EMAIL,
', '.join(sendto),message.getvalue()))
else:
index 9e9545e0c0bb1a7177b05b0931841f3e5454857b..ceb6235e54405589ec1eb854b972d56fa4ad9057 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: config.py,v 1.6 2002-12-13 22:20:10 richard Exp $
+# $Id: config.py,v 1.7 2003-01-12 00:41:27 richard Exp $
import os
# The email address that roundup will complain to if it runs into trouble
ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
-#
-# SECURITY DEFINITIONS
-#
-# define the Roles that a user gets when they register with the tracker
-# these are a comma-separated string of role names (e.g. 'Admin,User')
-NEW_WEB_USER_ROLES = 'User'
-NEW_EMAIL_USER_ROLES = 'User'
+# Additional text to include in the "name" part of the From: address used
+# in nosy messages. If the sending user is "Foo Bar", the From: line is
+# usually:
+# "Foo Bar" <issue_tracker@tracker.example>
+# the EMAIL_FROM_TAG goes inside the "Foo Bar" quotes like so:
+# "Foo Bar EMAIL_FROM_TAG" <issue_tracker@tracker.example>
+EMAIL_FROM_TAG = ""
# Send nosy messages to the author of the message
MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no'
MAIL_DEFAULT_CLASS = 'issue' # use "issue" class by default
#MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out)
+#
+# SECURITY DEFINITIONS
+#
+# define the Roles that a user gets when they register with the tracker
+# these are a comma-separated string of role names (e.g. 'Admin,User')
+NEW_WEB_USER_ROLES = 'User'
+NEW_EMAIL_USER_ROLES = 'User'
+
# vim: set filetype=python ts=4 sw=4 et si
index 9bebe1166eb838054603853393b2b7baca6bd920..f047fa17062e05e56ee6c71a68c9bb09a67152f3 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: config.py,v 1.4 2002-12-13 22:20:10 richard Exp $
+# $Id: config.py,v 1.5 2003-01-12 00:41:27 richard Exp $
import os
# The email address that roundup will complain to if it runs into trouble
ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
+# Additional text to include in the "name" part of the From: address used
+# in nosy messages. If the sending user is "Foo Bar", the From: line is
+# usually: "Foo Bar" <issue_tracker@tracker.example>
+# the EMAIL_FROM_TAG goes inside the "Foo Bar" quotes like so:
+# "Foo Bar EMAIL_FROM_TAG" <issue_tracker@tracker.example>
+EMAIL_FROM_TAG = ""
+
#
# SECURITY DEFINITIONS
#