[Zope-dev] zope.sendmail and critical transaction errors.

Wichert Akkerman wichert at wiggy.net
Thu Jun 24 03:55:53 EDT 2010


On 6/24/10 09:46 , Jens Vagelpohl wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 6/24/10 09:30 , Chris Withers wrote:
>> Tres Seaver wrote:
>>> The misconfiguration of the mail host in transactional mode *does* cause
>>> the server to go into a "lockdown" mode (because errors are not supposed
>>> to be raised in 'tpc_finish').  There is *no* database corruption, but
>>> the transaction manager can't know that, and so it deliberately refuses
>>> to commit more transactions until the admin un-futzes the problem (in
>>> this case, by fixing the mailhost configuration) and restarts the server.
>>
>> Yeah, what he said...
>
> It's not as easy as that, though. Mailhost misconfiguration is just one
> reason why errors may be raised during the actual sending. The receiver
> address may be wrong, which is where I tend to see it. This is not a
> condition I could reasonably test for in my code before attempting to
> send though the MailHost.

What might be interesting is a MailHost for non-bulk mail sending which 
does the SMTP HELO/MAIL FROM/RCPT TO bits immediately and only delays 
the DATA command until transaction commit time. That will allow you to 
detect almost all SMTP configuration problems and address errors in your 
code while still getting transaction support.

Personally I've updated all my code to sending mail directly and not 
using zope.sendmail. Being able to catch and handle errors is much more 
useful to me than preventing extremely rare duplicate emails.

Wichert.


More information about the Zope-Dev mailing list