Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
zopyx committed Aug 19, 2007
1 parent 31633ce commit f4c1f3b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions MailHost.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import mimetools
import rfc822
import time
import logging
from cStringIO import StringIO

import Acquisition
Expand All @@ -37,7 +38,9 @@

from interfaces import IMailHost

queue_threads = {}
queue_threads = {} # maps MailHost path -> queue processor threada

LOG = logging.getLogger('MailHost')

class MailHostError(Exception):
pass
Expand Down Expand Up @@ -199,9 +202,7 @@ def _startQueueProcessorThread(self):
""" Start thread for processing the mail queue """

path = self.absolute_url(1)

if not queue_threads.has_key(path):

thread = QueueProcessorThread()
thread.setMailer(self._makeMailer())
thread.setQueuePath(self.smtp_queue_directory)
Expand All @@ -214,10 +215,8 @@ def _send(self, mfrom, mto, messageText):
""" Send the message """

if self.smtp_queue:

# Start queue processor thread, if necessary
self._startQueueProcessorThread()

delivery = QueuedMailDelivery(self.smtp_queue_directory)
else:
delivery = DirectMailDelivery(self._makeMailer())
Expand Down

0 comments on commit f4c1f3b

Please sign in to comment.