Browse Source

merge back from stable, rfc2821 fix. Fall back to HELO if EHLO is not
supported.

stekkel 21 years ago
parent
commit
7f510a8b05
1 changed files with 10 additions and 1 deletions
  1. 10 1
      class/deliver/Deliver_SMTP.class.php

+ 10 - 1
class/deliver/Deliver_SMTP.class.php

@@ -85,7 +85,16 @@ class Deliver_SMTP extends Deliver {
         fputs($stream, "EHLO $helohost\r\n");
         $tmp = fgets($stream,1024);
         if ($this->errorCheck($tmp,$stream)) {
-            return(0);
+            // fall back to HELO if EHLO is not supported
+            if ($this->dlv_ret_no == '500') {
+                fputs($stream, "HELO $helohost\r\n");
+                $tmp = fgets($stream,1024);
+                if ($this->errorCheck($tmp,$stream)) {
+                    return(0);
+                }
+            } else {
+                return(0);
+            }
         }
     
         if (( $smtp_auth_mech == 'cram-md5') or ( $smtp_auth_mech == 'digest-md5' )) {