Properly send EHLO after TLS
authorChristoph Egger <christoph@christoph-egger.org>
Tue, 30 Aug 2016 11:42:36 +0000 (13:42 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Tue, 30 Aug 2016 11:43:34 +0000 (13:43 +0200)
check_dane_smtp

index d9c2732..c63cfed 100755 (executable)
@@ -24,6 +24,12 @@ def init_connection(sslcontext, args):
         connection = sslcontext.wrap_socket(socket(AF_INET),
                                             server_hostname=host)
         connection.connect((host, port))
+        answer = connection.recv(512)
+        logging.debug(answer)
+
+        connection.send(b"EHLO localhost\r\n")
+        answer = connection.recv(512)
+        logging.debug(answer)
 
     else:
         port = 25 if args.port == 0 else args.port
@@ -43,6 +49,10 @@ def init_connection(sslcontext, args):
         connection = sslcontext.wrap_socket(connection, server_hostname=host)
         connection.do_handshake()
 
+        connection.send(b"EHLO localhost\r\n")
+        answer = connection.recv(512)
+        logging.debug(answer)
+
     return connection