zope.sendmail has this nasty habit of starting a background thread
during ZCML conguration, if your ZCML contains a <queuedDelivery>
directive.  This is Very Bad(TM) if you use things like debugzope, since
you end up with two processes watching your mail queue, which can easily
result in duplicate emails getting sent.

Fabio Tranchitella recently released zope.sendmail 3.8.0 which fixes the
problem in the following way:

  * you edit <queuedDelivery> and set processorThread="false" to
    suppress that thread

  * you edit your init.d scripts and start a new daemon (zope-sendmail)
    to watch the queue

I recently came up with a different and perhaps a bit simpler solution:

  * make zope.sendmail not start the thread during ZCML processing,
    instead make it listen for ProcessStarting events and start the
    thread then.

It would have the following advantages:

  * it would make the _default_ configuration of zope.sendmail (which
    is processorThread=true for BBB reasons) not quite as broken as it
    is now

  * simpler administration: no need to figure out what new daemon you
    need to start and how to do that.

  * it could be backported to older zope.sendmail bugfix releases (e.g.

and the following disadvantages:

  * it's a kinda redundant solution for the same problem

  * ProcessStarting is not necessarily emitted on Zope startup, e.g. I
    think it's not used if you deploy a Zope-3-based WSGI app

What do other people think?

Marius Gedminas
http://pov.lt/ -- Zope 3 consulting and development

Attachment: signature.asc
Description: Digital signature

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to