[zopeorg-checkins] CVS: Products/ZWiki - ZWikiPage.py:1.71
Ken Manheimer
klm at zope.com
Tue Jan 15 14:19:57 EST 2002
Update of /cvs-zopeorg/Products/ZWiki
In directory cvs.zope.org:/tmp/cvs-serv27674
Modified Files:
ZWikiPage.py
Log Message:
Some MTAs apparently don't accept email with the empty "<>" To header
address - probably for anti-spam purposes. Anway, we're now setting
the To address to that of the sender - my testing shows this is
overridden by the explicit mailhost recipients argument, so this
should cause no harm...
=== Products/ZWiki/ZWikiPage.py 1.70 => 1.71 ===
NOTIFICATION_TEMPLATE = \
"""From: "Wikis on %(wiki_host)s for %(who)s" <%(from_email)s>
-Sender: %(sender_email)s
-To: Wiki notification recipients <>
+Sender: <%(sender_email)s>
+To: "Wiki %(id)s subscribers" <%(sender_email)s>
Subject: Wiki: %(who)s %(qualifier)s %(id)s
X-Wiki-URL: %(url)s
List-Unsubscribe: %(subscribe_url)s
-List-Subscribe: %(subscribe_url)s
+List-Subscribe: %(subscribe_url)s%(optional_headers)s
Wiki page %(qualifier)s by %(who)s:
%(url)s
@@ -1433,11 +1433,15 @@
wiki_host = REQUEST.BASE0
if wiki_host[:7] == 'http://':
wiki_host = wiki_host[7:]
- sender_email = "<wikis@" + string.split(wiki_host, ':')[0] + ">"
+ sender_email = "wikis@" + string.split(wiki_host, ':')[0]
from_email = (self.notificationFromAddr()
or sender_email)
subscribe_url = self.absolute_url() + "/subscribeform"
+ # optional_headers must start with a newline!
+ optional_headers = ("\nX-Wiki-Notifications-Debug: %s"
+ % recipients)
+
userobj = getSecurityManager().getUser()
userid = str(userobj)
if (userobj is None) or (userid == str(self.acl_users._nobody)):
@@ -1458,6 +1462,8 @@
'delim': SECTION_DELIM,
'text': mailouttext,
'who': who,
+ 'optional_headers':
+ optional_headers,
}
self.MailHost.send(msg, mto=recipients)
return None
More information about the zopeorg-checkins
mailing list