-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please find attached a patch to make SSL mode work on *BSD (inc. MacOS).

I've very briefly tested this in SSL, TLS, and plain-text modes under
NetBSD 3.1. I haven't confirmed it still works under Linux, but I'm
pretty sure it will; I'll test it more extensively soon.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF8QPThk3bo0lNTrURAp/hAKDFkQg+KpV3yPNavmuRxUknJq+KmwCgk20t
JmaYE8W9oTDm+cc1T63Meek=
=O7Jk
-----END PGP SIGNATURE-----
Index: bin/tmda-ofmipd
===================================================================
--- bin/tmda-ofmipd     (revision 2171)
+++ bin/tmda-ofmipd     (working copy)
@@ -666,16 +666,24 @@
 
 # Classes
 
-class SMTPSession(asynchat.async_chat):
+class SMTPSessionSignon(asynchat.async_chat):
+    def __init__(self, conn):
+        asynchat.async_chat.__init__(self, conn)
+
+    def handle_connect(self):
+        self.push('220 %s ESMTP tmda-ofmipd' % FQDN)
+        self.set_terminator('\r\n')
+
+class SMTPSession(SMTPSessionSignon):
     COMMAND = 0
     DATA = 1
     AUTH = 2
 
     ac_in_buffer_size = 16384
-    
+
     def __init__(self, conn, process_msg_func):
         if opts.ssl or opts.tls:
-            TMDATLSAsyncDispatcherMixIn.__init__(self, conn, 
asynchat.async_chat)
+            TMDATLSAsyncDispatcherMixIn.__init__(self, conn, SMTPSessionSignon)
             self.tlsConnection.ignoreAbruptClose = True
 
         if opts.ssl:
@@ -683,7 +691,7 @@
             self.setServerHandshakeOp(certChain=opts.ssl_cert_value,
                                       privateKey=opts.ssl_key_value)
 
-        asynchat.async_chat.__init__(self, conn)
+        SMTPSessionSignon.__init__(self, conn)
 
         self.__process_msg_func = process_msg_func
 
@@ -737,7 +745,8 @@
         self.__conn = conn
 
         self.reinit()
-        self.signon()
+        if not opts.ssl:
+            self.handle_connect()
 
     def reinit(self):
         # SMTP AUTH
@@ -761,10 +770,6 @@
         self.__data = ''
         self.__fqdn = FQDN
 
-    def signon(self):
-        self.push('220 %s ESMTP tmda-ofmipd' % (self.__fqdn))
-        self.set_terminator('\r\n')
-
     # Overrides base class for convenience
     def push(self, msg):
         asynchat.async_chat.push(self, msg + '\r\n')
@@ -1165,10 +1170,7 @@
 
         self.reinit()
 
-    def handle_connect(self):
-        print ">>> handle_connect called!"
 
-
 if opts.ssl or opts.tls:
     SMTPSession.__bases__ = (TMDATLSAsyncDispatcherMixIn,) + 
SMTPSession.__bases__
 
_________________________________________________
tmda-workers mailing list ([email protected])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to