monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: sendmail.c, use EHLO only if needed.


From: Thomas Lohmüller
Subject: Patch: sendmail.c, use EHLO only if needed.
Date: Sun, 19 Aug 2007 23:23:58 +0200

Hi

Some mailservers don't understand EHLO but this is needed for TLS and authentification. With this small patch EHLO is only used if it is required.


diff -u -r1.50 sendmail.c
--- sendmail.c  12 Aug 2007 15:53:52 -0000      1.50
+++ sendmail.c  19 Aug 2007 21:19:36 -0000
@@ -127,7 +127,14 @@
   }
  
   do_status(&S);
-  do_send(&S, "EHLO %s\r\n", S.localhost);
+
+  /* Use EHLO if TLS or Authentification is requested */
+  if((S.ssl.use_ssl && S.ssl.version == SSL_VERSION_TLS) ||
+     S.username) {
+    do_send(&S, "EHLO %s\r\n", S.localhost);
+  } else {
+    do_send(&S, "HELO %s\r\n", S.localhost);
+  }
   do_status(&S);
 
   /* Switch to TLS now if configured */


Thomas

reply via email to

[Prev in Thread] Current Thread [Next in Thread]