alecpl
2010-04-23 bf67d60e435a6f01b835a0d5afb9737f81560433
program/include/rcube_smtp.php
@@ -233,7 +233,13 @@
    // 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;
@@ -386,14 +392,14 @@
    
    $addresses = array();
    $recipients = rcube_explode_quoted_string(',', $recipients);
    reset($recipients);
    while (list($k, $recipient) = each($recipients))
    {
      $a = explode(" ", $recipient);
      while (list($k2, $word) = each($a))
      {
        if ((strpos($word, "@") > 0) && (strpos($word, "\"")===false))
        if (strpos($word, "@") > 0 && $word[strlen($word)-1] != '"')
        {
          $word = preg_replace('/^<|>$/', '', trim($word));
          if (in_array($word, $addresses)===false)
@@ -405,5 +411,3 @@
  }
}
?>