From 156ae8d8336e94e8aa43e0aae479fd1f57d11247 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@enhancesoft.com>
Date: Sun, 11 Aug 2013 20:34:54 +0000
Subject: [PATCH] Make sure password or no auth. is set on SMTP 'is enabled'
 check.

---
 include/class.email.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/class.email.php b/include/class.email.php
index 480b26eba..a55a0e3e4 100644
--- a/include/class.email.php
+++ b/include/class.email.php
@@ -120,7 +120,12 @@ class Email {
     }
 
     function isSMTPEnabled() {
-        return $this->ht['smtp_active'];
+
+        return (
+                $this->ht['smtp_active']
+                    && ($info=$this->getSMTPInfo())
+                    && (!$info['auth'] || $info['password'])
+                );
     }
 
     function allowSpoofing() {
-- 
GitLab