summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-12 13:33:36 +0000
committeralecpl <alec@alec.pl>2010-03-12 13:33:36 +0000
commitb9d751df60a8f0126848a976b6c045a790ee36eb (patch)
tree1fcda3fa0998391498a39f644ca66c03c0749b6d /program
parent1baeb660eb32496b06473f962386c1874e359d9d (diff)
- get better message for error in DATA
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_smtp.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/program/include/rcube_smtp.php b/program/include/rcube_smtp.php
index 2bf8cc1e0..658e4760c 100644
--- a/program/include/rcube_smtp.php
+++ b/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;