Commit 092dee5d authored by Andreas Jung's avatar Andreas Jung

some cleanup

parent 96c76ebc
...@@ -18,6 +18,7 @@ $Id$ ...@@ -18,6 +18,7 @@ $Id$
import mimetools import mimetools
import rfc822 import rfc822
import time import time
import logging
from cStringIO import StringIO from cStringIO import StringIO
import Acquisition import Acquisition
...@@ -37,7 +38,9 @@ from zope.sendmail.delivery import DirectMailDelivery, QueuedMailDelivery, \ ...@@ -37,7 +38,9 @@ from zope.sendmail.delivery import DirectMailDelivery, QueuedMailDelivery, \
from interfaces import IMailHost from interfaces import IMailHost
queue_threads = {} queue_threads = {} # maps MailHost path -> queue processor threada
LOG = logging.getLogger('MailHost')
class MailHostError(Exception): class MailHostError(Exception):
pass pass
...@@ -199,9 +202,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager): ...@@ -199,9 +202,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
""" Start thread for processing the mail queue """ """ Start thread for processing the mail queue """
path = self.absolute_url(1) path = self.absolute_url(1)
if not queue_threads.has_key(path): if not queue_threads.has_key(path):
thread = QueueProcessorThread() thread = QueueProcessorThread()
thread.setMailer(self._makeMailer()) thread.setMailer(self._makeMailer())
thread.setQueuePath(self.smtp_queue_directory) thread.setQueuePath(self.smtp_queue_directory)
...@@ -214,10 +215,8 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager): ...@@ -214,10 +215,8 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
""" Send the message """ """ Send the message """
if self.smtp_queue: if self.smtp_queue:
# Start queue processor thread, if necessary # Start queue processor thread, if necessary
self._startQueueProcessorThread() self._startQueueProcessorThread()
delivery = QueuedMailDelivery(self.smtp_queue_directory) delivery = QueuedMailDelivery(self.smtp_queue_directory)
else: else:
delivery = DirectMailDelivery(self._makeMailer()) delivery = DirectMailDelivery(self._makeMailer())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment