summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-12 13:33:36 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-12 13:33:36 +0000
commit40c69682392b7b0aece37bd3fb5826d981dc6c32 (patch)
treea75ec10f12c7db5b9e7c8a05a34ca4e838776ccd
parent57a12a18ecb8c273480ebf50533730e52649af7e (diff)
- get better message for error in DATA
git-svn-id: https://svn.roundcube.net/trunk@3357 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/include/rcube_smtp.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_smtp.php b/roundcubemail/program/include/rcube_smtp.php
index 2bf8cc1e0..658e4760c 100644
--- a/roundcubemail/program/include/rcube_smtp.php
+++ b/roundcubemail/program/include/rcube_smtp.php
@@ -233,7 +233,13 @@ class rcube_smtp {
// Send the message's headers and the body as SMTP data.
if (PEAR::isError($result = $this->conn->data($data, $text_headers)))
{
- $this->error = array('label' => 'smtperror', 'vars' => array('msg' => $result->getMessage()));
+ $err = $this->conn->getResponse();
+ if (count($err)>1 && $err[0] != 354 && $err[0] != 250)
+ $msg = sprintf('[%d] %s', $err[0], $err[1]);
+ else
+ $msg = $result->getMessage();
+
+ $this->error = array('label' => 'smtperror', 'vars' => array('msg' => $msg));
$this->response[] .= "Failed to send data";
$this->reset();
return false;