[Zope3-checkins] CVS: Zope3/src/zope/app/wiki - wikipage.py:1.9
Eckart Hertzler
eckart at hertzler.de
Mon May 10 09:32:14 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/wiki
In directory cvs.zope.org:/tmp/cvs-serv6578/src/zope/app/wiki
Modified Files:
wikipage.py
Log Message:
changed the sending of change mails from direct use of smtplib to
use of a queued mail delivery.
Note, that this code breaks during a transaction commit. So if there are subscriptions to a message, editing of the message results in an AttributeError.
=== Zope3/src/zope/app/wiki/wikipage.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/wiki/wikipage.py:1.8 Mon Mar 15 08:10:54 2004
+++ Zope3/src/zope/app/wiki/wikipage.py Mon May 10 09:32:13 2004
@@ -28,6 +28,7 @@
from zope.app.event.interfaces import ISubscriber, IObjectModifiedEvent
from zope.app.container.interfaces import \
IObjectAddedEvent, IObjectRemovedEvent, IObjectMovedEvent
+from zope.app.mail.interfaces import IMailDelivery
from zope.app.wiki.interfaces import IWiki, IWikiPage, IComment
from zope.app.wiki.interfaces import IWikiContained, IWikiPageContained
@@ -259,10 +260,10 @@
if not emails:
return
msg = 'Subject: %s\n\n\n%s' %(subject, body)
- server = smtplib.SMTP(self.host, self.port)
- server.set_debuglevel(0)
- server.sendmail('wiki at zope3.org', emails, msg)
- server.quit()
+ mail_delivery = zapi.getUtility(None,
+ IMailDelivery,
+ 'wiki-delivery')
+ mail_delivery.send('wiki at zope3.org' , emails, msg)
# Create a global mailer object.
mailer = WikiMailer()
More information about the Zope3-Checkins
mailing list