diff --git a/framework/Smtp/lib/Horde/Smtp.php b/framework/Smtp/lib/Horde/Smtp.php
index 73c8f0ab4a9..72bce416057 100644
--- a/framework/Smtp/lib/Horde/Smtp.php
+++ b/framework/Smtp/lib/Horde/Smtp.php
@@ -379,6 +379,12 @@ public function login()
case 502:
// Old server - doesn't support EHLO
$this->_connection->write('HELO ' . $host);
+ try {
+ $this->_getResponse(250);
+ } catch (Horde_Smtp_Exception $e2) {
+ $this->logout();
+ throw $e;
+ }
$this->_extensions = array();
break;
diff --git a/framework/Smtp/package.xml b/framework/Smtp/package.xml
index befbf17c7ae..a76c8628744 100644
--- a/framework/Smtp/package.xml
+++ b/framework/Smtp/package.xml
@@ -21,6 +21,7 @@
LGPL-2.1
+* [mms] Fix handling servers that don't support ESMTP (Bug #12853).
* [mms] Fix returning reply code in Exceptions.
@@ -304,6 +305,7 @@
2013-10-30
LGPL-2.1
+* [mms] Fix handling servers that don't support ESMTP (Bug #12853).
* [mms] Fix returning reply code in Exceptions.