- Show SMTP errors in browser (#1485927)
| | |
| | | CHANGELOG RoundCube Webmail |
| | | =========================== |
| | | |
| | | - Show SMTP errors in browser (#1485927) |
| | | - Allow WBR tag in HTML message (#1485960) |
| | | - Use spl_autoload_register() instead of __autoload (#1485947) |
| | | - Add hook for identities listing (#1485958) |
| | |
| | | * |
| | | * @return bool Returns TRUE on success, or FALSE on error |
| | | */ |
| | | function smtp_mail($from, $recipients, &$headers, &$body, &$response) |
| | | function smtp_mail($from, $recipients, &$headers, &$body, &$response, &$error) |
| | | { |
| | | global $SMTP_CONN, $RCMAIL; |
| | | |
| | |
| | | $result = $SMTP_CONN->connect($smtp_timeout); |
| | | if (PEAR::isError($result)) |
| | | { |
| | | $SMTP_CONN = null; |
| | | $response[] = "Connection failed: ".$result->getMessage(); |
| | | $error = array('label' => 'smtpconnerror', 'vars' => array('code' => $SMTP_CONN->_code)); |
| | | $SMTP_CONN = null; |
| | | return FALSE; |
| | | } |
| | | |
| | |
| | | |
| | | if (PEAR::isError($result)) |
| | | { |
| | | smtp_reset(); |
| | | $error = array('label' => 'smtpautherror', 'vars' => array('code' => $SMTP_CONN->_code)); |
| | | $response[] .= 'Authentication failure: ' . $result->getMessage() . ' (Code: ' . $result->getCode() . ')'; |
| | | smtp_reset(); |
| | | return FALSE; |
| | | } |
| | | } |
| | |
| | | // set From: address |
| | | if (PEAR::isError($SMTP_CONN->mailFrom($from))) |
| | | { |
| | | smtp_reset(); |
| | | $error = array('label' => 'smtpfromerror', 'vars' => array('from' => $from, 'code' => $SMTP_CONN->_code)); |
| | | $response[] .= "Failed to set sender '$from'"; |
| | | smtp_reset(); |
| | | return FALSE; |
| | | } |
| | | |
| | |
| | | $recipients = smtp_parse_rfc822($recipients); |
| | | if (PEAR::isError($recipients)) |
| | | { |
| | | $error = array('label' => 'smtprecipientserror'); |
| | | smtp_reset(); |
| | | return FALSE; |
| | | } |
| | |
| | | { |
| | | if (PEAR::isError($SMTP_CONN->rcptTo($recipient))) |
| | | { |
| | | smtp_reset(); |
| | | $error = array('label' => 'smtptoerror', 'vars' => array('to' => $recipient, 'code' => $SMTP_CONN->_code)); |
| | | $response[] .= "Failed to add recipient '$recipient'"; |
| | | smtp_reset(); |
| | | return FALSE; |
| | | } |
| | | } |
| | |
| | | unset($text_headers, $body); |
| | | |
| | | // Send the message's headers and the body as SMTP data. |
| | | if (PEAR::isError($SMTP_CONN->data($data))) |
| | | if (PEAR::isError($result = $SMTP_CONN->data($data))) |
| | | { |
| | | smtp_reset(); |
| | | $error = array('label' => 'smtperror', 'vars' => array('msg' => $result->getMessage())); |
| | | $response[] .= "Failed to send data"; |
| | | smtp_reset(); |
| | | return FALSE; |
| | | } |
| | | |
| | |
| | | { |
| | | global $SMTP_CONN; |
| | | |
| | | if (is_object($SMTP_CONN)) |
| | | if (is_object($SMTP_CONN) && is_resource($SMTP_CONN->_socket->fp)) |
| | | { |
| | | $SMTP_CONN->rset(); |
| | | smtp_disconnect(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | if (isset($this->_esmtp['SIZE']) && ($this->_esmtp['SIZE'] > 0)) { |
| | | if (strlen($data) >= $this->_esmtp['SIZE']) { |
| | | $this->disconnect(); |
| | | return PEAR::raiseError('Message size excedes the server limit'); |
| | | return PEAR::raiseError('Message size exceedes the server limit'); |
| | | } |
| | | } |
| | | |
| | |
| | | $messages['nofromaddress'] = 'Missing e-mail address in selected identity'; |
| | | $messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?'; |
| | | $messages['httpreceivedencrypterror'] = 'A fatal configuration error occurred. Contact your administrator immediately. <b>Your message can not be sent.</b>'; |
| | | $messages['smtpconnerror'] = 'SMTP Error ($code): Connection to server failed'; |
| | | $messages['smtpautherror'] = 'SMTP Error ($code): Authentication failed'; |
| | | $messages['smtpfromerror'] = 'SMTP Error ($code): Failed to set sender "$from"'; |
| | | $messages['smtptoerror'] = 'SMTP Error ($code): Failed to add recipient "$to"'; |
| | | $messages['smtprecipientserror'] = 'SMTP Error: Unable to parse recipients list'; |
| | | $messages['smtperror'] = 'SMTP Error: $msg'; |
| | | |
| | | ?> |
| | |
| | | $messages['nofromaddress'] = 'Missing e-mail address in selected identity'; |
| | | $messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?'; |
| | | $messages['httpreceivedencrypterror'] = 'A fatal configuration error occurred. Contact your administrator immediately. <b>Your message can not be sent.</b>'; |
| | | $messages['smtpconnerror'] = 'SMTP Error ($code): Connection to server failed'; |
| | | $messages['smtpautherror'] = 'SMTP Error ($code): Authentication failed'; |
| | | $messages['smtpfromerror'] = 'SMTP Error ($code): Failed to set sender "$from"'; |
| | | $messages['smtptoerror'] = 'SMTP Error ($code): Failed to add recipient "$to"'; |
| | | $messages['smtprecipientserror'] = 'SMTP Error: Unable to parse recipients list'; |
| | | $messages['smtperror'] = 'SMTP Error: $msg'; |
| | | |
| | | ?> |
| | |
| | | $messages['nofromaddress'] = 'Brak adresu e-mail w wybranej tożsamości'; |
| | | $messages['editorwarning'] = 'Zmiana edytora spowoduje utratę formatowania tekstu. Czy jesteś pewien, że chcesz to zrobić?'; |
| | | $messages['httpreceivedencrypterror'] = 'Wystąpił błąd krytyczny. Skontaktuj się z administratorem. <b>Nie można wysłać wiadomości.</b>'; |
| | | $messages['smtpconnerror'] = 'Błąd SMTP ($code): Nie można nawiązać połączenia z serwerem'; |
| | | $messages['smtpautherror'] = 'Błąd SMTP ($code): Uwierzytelnianie nie powiodło się'; |
| | | $messages['smtpfromerror'] = 'Błąd SMTP ($code): Nie można ustawić nadawcy "$from"'; |
| | | $messages['smtptoerror'] = 'Błąd SMTP ($code): Nie można dodać odbiorcy "$to"'; |
| | | $messages['smtprecipientserror'] = 'Błąd SMTP: Parsowanie listy odbiorców nie powiodło się'; |
| | | $messages['smtperror'] = 'Błąd SMTP: $msg'; |
| | | |
| | | ?> |
| | |
| | | /** |
| | | * Send the given message compose object using the configured method |
| | | */ |
| | | function rcmail_deliver_message(&$message, $from, $mailto) |
| | | function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error) |
| | | { |
| | | global $CONFIG, $RCMAIL; |
| | | |
| | |
| | | |
| | | // send message |
| | | $smtp_response = array(); |
| | | $sent = smtp_mail($from, $a_recipients, ($foo = $message->txtHeaders($send_headers, true)), $msg_body, $smtp_response); |
| | | $sent = smtp_mail($from, $a_recipients, ($foo = $message->txtHeaders($send_headers, true)), $msg_body, $smtp_response, $smtp_error); |
| | | |
| | | // log error |
| | | if (!$sent) |
| | |
| | | } |
| | | |
| | | |
| | | function rcmail_send_mdn($uid) |
| | | function rcmail_send_mdn($uid, &$smtp_error) |
| | | { |
| | | global $RCMAIL, $IMAP; |
| | | |
| | |
| | | $compose->setTXTBody(rc_wordwrap($body, 75, "\r\n")); |
| | | $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); |
| | | |
| | | $sent = rcmail_deliver_message($compose, $identity['email'], $mailto); |
| | | $sent = rcmail_deliver_message($compose, $identity['email'], $mailto, $smtp_error); |
| | | |
| | | if ($sent) |
| | | { |
| | |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | |
| | | $sent = rcmail_deliver_message($MAIL_MIME, $from, $mailto); |
| | | $sent = rcmail_deliver_message($MAIL_MIME, $from, $mailto, $smtp_error); |
| | | |
| | | // return to compose page if sending failed |
| | | if (!$sent) |
| | | { |
| | | $OUTPUT->show_message("sendingfailed", 'error'); |
| | | if ($smtp_error) |
| | | $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']); |
| | | else |
| | | $OUTPUT->show_message('sendingfailed', 'error'); |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | if (!empty($_POST['_uid'])) { |
| | | $sent = rcmail_send_mdn(get_input_value('_uid', RCUBE_INPUT_POST)); |
| | | $sent = rcmail_send_mdn(get_input_value('_uid', RCUBE_INPUT_POST), $smtp_error); |
| | | } |
| | | |
| | | // show either confirm or error message |
| | |
| | | $OUTPUT->set_env('mdn_request', false); |
| | | $OUTPUT->show_message('receiptsent', 'confirmation'); |
| | | } |
| | | else if ($smtp_error) { |
| | | $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']); |
| | | } |
| | | else { |
| | | $OUTPUT->show_message('errorsendingreceipt', 'error'); |
| | | } |
| | |
| | | background-position: 0 -75px; |
| | | } |
| | | |
| | | |
| | | #message |
| | | { |
| | | position: absolute; |
| | |
| | | { |
| | | width: 400px; |
| | | margin: 0px auto; |
| | | height: 22px; |
| | | min-height: 22px; |
| | | padding: 8px 10px 8px 46px; |
| | | } |