For example, when I debug, I see that sending a mail to a fake
recipient raises a SMTPRecipientsRefused exception but I cannot catch
it since it is not raised by the same thread where
turbomail.enqueue(message) is called.
Thanks.
Traceback (most recent call last):
File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
self.run()
File "/usr/lib/python2.4/threading.py", line 422, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.4/site-packages/turbomail/pool.py", line 132,
in wrapper
self.worker()
File "/usr/lib/python2.4/site-packages/turbomail/pool.py", line 187,
in worker
dispatch(unit)
File "/usr/lib/python2.4/site-packages/turbomail/dispatch.py", line
169, in __call__
self.connection.sendmail(pack['smtpfrom'], pack['recipients'],
pack['message'])
File "/usr/lib/python2.4/smtplib.py", line 695, in sendmail
raise SMTPRecipientsRefused(senderrs)
SMTPRecipientsRefused: {u'na...@example.com': (550, 'No such
recipient')}
I didn't try that myself - but you might get lucky using the
turbomail.dispatch.Dispatch
class yourself, initializing it with the parameters from the config and
then calling it with the message. That should rid you from the threading.
Diez