Re: Bugs in tmda-ofmipd?
Stephen Warren <[email protected]>
| Newsgroups | gmane.mail.spam.tmda.user |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Todd A. Jacobs wrote: > On Fri, Nov 10, 2006 at 09:25:46PM -0700, Stephen Warren wrote: > >> Now, it seems that you've found a way to trigger that exception, and >> I'd certainly like to see what exception it is, so it can be trapped, >> and an SMTP error returned, rather than having tmda-ofmipd crash and >> close the connection. > > I'm currently running 1.1.8. For your purposes, do I need to test > against 1.1.9, or can I use 1.1.8? Either way, if you want to send me a > patch, I'll be glad to test it and see if I can trigger the failure > again. > > Also, if you want me to debug in any particlar way, let me know. > Otherwise, I'll just report the output of tmda-ofmipd and the output > from the client side. Jason, What I'd like to do is apply a patch to tmda-ofmipd that catches all exceptions in process_message and logs them to the debug log, then re-raises the exception to be handled in the existing fashion. With this patch, the behaviour of tmda-ofmipd should end up being the same - all exceptions are thrown through to whatever existing handler exists. However, if we then log all exceptions ourselves explicitly, we should be able to find those exceptions that are not being handled by the Python core SMTP module, and try to work out why these cause immediate sessions drops rather than SMTP error codes. See that attached proposed patch. I have tested this by attempting to send email to an unknown local user; in this case, for me, the exception is logged to tmda-ofmipd's STDERR (I have the -d flag enabled) and is also passed through to Thunderbird via an SMTP error message, and displayed on the client UI. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFV9N1hk3bo0lNTrURAqDaAKDDCkj82YpdJBS56zYbZaluq93ZrgCcCOYZ WtDQhDByfr3N/TLKMnTsYlY= =wNRn -----END PGP SIGNATURE-----
tmda-ofmipd-exception-log.patch
(text/plain, 1.4 KB)
Index: tmda-ofmipd
===================================================================
--- tmda-ofmipd (revision 2125)
+++ tmda-ofmipd (working copy)
@@ -778,11 +778,17 @@
if not opts.throttlescript or not os.system("%s %s" % (opts.throttlescript,
self.__auth_username)):
- status = self.__server.process_message(self.__peer,
- self.__mailfrom,
- self.__rcpttos,
- self.__data,
- self.__auth_username)
+ try:
+ status = self.__server.process_message(self.__peer,
+ self.__mailfrom,
+ self.__rcpttos,
+ self.__data,
+ self.__auth_username)
+ except:
+ print >>DEBUGSTREAM, "process_message raised an exception:"
+ import traceback
+ traceback.print_exc(DEBUGSTREAM)
+ raise
else:
status = self.push('450 Outgoing mail quota exceeded')