[Zope] oddity in MailHost queue processor thread

Tres Seaver tseaver at palladion.com
Fri Apr 30 08:58:58 EDT 2010

Hash: SHA1

Maric Michaud wrote:
> Hi all,
> I was surprised by the behavior of asynchronous mailing in zope 2.11.3 
> MailHost product. It creates a thread by instance of MailHost by the 
> mean of using self.absolute_url(1) as key for the queue_threads dictionnary.
> It seems obviously wrong, IMO, if several instances share the same queue 
>   directory, mesages actually get sent more than once.
> Following is the monkey patch which works fine for me, but the idea is 
> straightforward, it's to use the realpath of the smtp_queue_directory as 
> the identifier of the thread, ensuring that MailHosts that share the 
> same queue directory will also share the same thread for processing mails.

It looks like a bug to me:  could you please report it to the tracker at:


Also, if you could convert your monkeypatch into a real diff against the
source, that would help expedite.  The basic procedure is outlined at:


E.g., get a read-only checkout of the 2.11 branch:

  $ cd /tmp
  $ svn co svn://svn.zope.org/repos/main/Zope/branches/2.11 Zope-2.11

build it and make an instance:

  $ cd /tmp/Zope-2.11
  $ ./configure --with-python=/path/to/python2.4 && make inplace
  $ bin/mkzopeinstance /tmp/test_mailhost

apply your changes in that tree, test them, and then create a diff using

  $ cd /tmp/Zope-2.11
  $ svn diff -u > /tmp/mailhost_thread_fix.patch

and attach that file to your bugreport.  Bonus points (i.e., a faster
resolution) if you can generate a unit test which fails without your
changes, but passes with them.

- --
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the Zope mailing list