Changeset 2818f8e in github
- Timestamp:
- Jul 6, 2009 5:13:10 AM (4 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- b0d56e9
- Parents:
- 2f2bb40
- Files:
-
- 10 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_smtp.inc (modified) (9 diffs)
-
program/lib/Net/SMTP.php (modified) (1 diff)
-
program/localization/en_GB/messages.inc (modified) (1 diff)
-
program/localization/en_US/messages.inc (modified) (1 diff)
-
program/localization/pl_PL/messages.inc (modified) (1 diff)
-
program/steps/mail/func.inc (modified) (4 diffs)
-
program/steps/mail/sendmail.inc (modified) (1 diff)
-
program/steps/mail/sendmdn.inc (modified) (2 diffs)
-
skins/default/common.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rf7fff8f r2818f8e 2 2 =========================== 3 3 4 - Show SMTP errors in browser (#1485927) 4 5 - Allow WBR tag in HTML message (#1485960) 5 6 - Use spl_autoload_register() instead of __autoload (#1485947) -
program/include/rcube_smtp.inc
r3ca3bd4 r2818f8e 50 50 * @return bool Returns TRUE on success, or FALSE on error 51 51 */ 52 function smtp_mail($from, $recipients, &$headers, &$body, &$response )52 function smtp_mail($from, $recipients, &$headers, &$body, &$response, &$error) 53 53 { 54 54 global $SMTP_CONN, $RCMAIL; … … 97 97 if (PEAR::isError($result)) 98 98 { 99 $response[] = "Connection failed: ".$result->getMessage(); 100 $error = array('label' => 'smtpconnerror', 'vars' => array('code' => $SMTP_CONN->_code)); 99 101 $SMTP_CONN = null; 100 $response[] = "Connection failed: ".$result->getMessage();101 102 return FALSE; 102 103 } … … 120 121 if (PEAR::isError($result)) 121 122 { 123 $error = array('label' => 'smtpautherror', 'vars' => array('code' => $SMTP_CONN->_code)); 124 $response[] .= 'Authentication failure: ' . $result->getMessage() . ' (Code: ' . $result->getCode() . ')'; 122 125 smtp_reset(); 123 $response[] .= 'Authentication failure: ' . $result->getMessage() . ' (Code: ' . $result->getCode() . ')';124 126 return FALSE; 125 127 } … … 161 163 if (PEAR::isError($SMTP_CONN->mailFrom($from))) 162 164 { 163 smtp_reset();165 $error = array('label' => 'smtpfromerror', 'vars' => array('from' => $from, 'code' => $SMTP_CONN->_code)); 164 166 $response[] .= "Failed to set sender '$from'"; 167 smtp_reset(); 165 168 return FALSE; 166 169 } … … 171 174 if (PEAR::isError($recipients)) 172 175 { 176 $error = array('label' => 'smtprecipientserror'); 173 177 smtp_reset(); 174 178 return FALSE; … … 181 185 if (PEAR::isError($SMTP_CONN->rcptTo($recipient))) 182 186 { 187 $error = array('label' => 'smtptoerror', 'vars' => array('to' => $recipient, 'code' => $SMTP_CONN->_code)); 188 $response[] .= "Failed to add recipient '$recipient'"; 183 189 smtp_reset(); 184 $response[] .= "Failed to add recipient '$recipient'";185 190 return FALSE; 186 191 } … … 198 203 199 204 // Send the message's headers and the body as SMTP data. 200 if (PEAR::isError($ SMTP_CONN->data($data)))201 { 202 smtp_reset();205 if (PEAR::isError($result = $SMTP_CONN->data($data))) 206 { 207 $error = array('label' => 'smtperror', 'vars' => array('msg' => $result->getMessage())); 203 208 $response[] .= "Failed to send data"; 209 smtp_reset(); 204 210 return FALSE; 205 211 } … … 219 225 global $SMTP_CONN; 220 226 221 if (is_object($SMTP_CONN) )227 if (is_object($SMTP_CONN) && is_resource($SMTP_CONN->_socket->fp)) 222 228 { 223 229 $SMTP_CONN->rset(); … … 225 231 } 226 232 } 227 228 233 229 234 -
program/lib/Net/SMTP.php
rd78c417 r2818f8e 857 857 if (strlen($data) >= $this->_esmtp['SIZE']) { 858 858 $this->disconnect(); 859 return PEAR::raiseError('Message size exce des the server limit');859 return PEAR::raiseError('Message size exceedes the server limit'); 860 860 } 861 861 } -
program/localization/en_GB/messages.inc
r119cd17 r2818f8e 98 98 $messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?'; 99 99 $messages['httpreceivedencrypterror'] = 'A fatal configuration error occurred. Contact your administrator immediately. <b>Your message can not be sent.</b>'; 100 $messages['smtpconnerror'] = 'SMTP Error ($code): Connection to server failed'; 101 $messages['smtpautherror'] = 'SMTP Error ($code): Authentication failed'; 102 $messages['smtpfromerror'] = 'SMTP Error ($code): Failed to set sender "$from"'; 103 $messages['smtptoerror'] = 'SMTP Error ($code): Failed to add recipient "$to"'; 104 $messages['smtprecipientserror'] = 'SMTP Error: Unable to parse recipients list'; 105 $messages['smtperror'] = 'SMTP Error: $msg'; 100 106 101 107 ?> -
program/localization/en_US/messages.inc
r119cd17 r2818f8e 98 98 $messages['editorwarning'] = 'Switching to the plain text editor will cause all text formatting to be lost. Do you wish to continue?'; 99 99 $messages['httpreceivedencrypterror'] = 'A fatal configuration error occurred. Contact your administrator immediately. <b>Your message can not be sent.</b>'; 100 $messages['smtpconnerror'] = 'SMTP Error ($code): Connection to server failed'; 101 $messages['smtpautherror'] = 'SMTP Error ($code): Authentication failed'; 102 $messages['smtpfromerror'] = 'SMTP Error ($code): Failed to set sender "$from"'; 103 $messages['smtptoerror'] = 'SMTP Error ($code): Failed to add recipient "$to"'; 104 $messages['smtprecipientserror'] = 'SMTP Error: Unable to parse recipients list'; 105 $messages['smtperror'] = 'SMTP Error: $msg'; 100 106 101 107 ?> -
program/localization/pl_PL/messages.inc
r119cd17 r2818f8e 133 133 piÅ bÅÄ 134 134 d krytyczny. Skontaktuj siÄ z administratorem. <b>Nie moÅŒna wysÅaÄ wiadomoÅci.</b>'; 135 $messages['smtpconnerror'] = 'BÅÄ 136 d SMTP ($code): Nie moÅŒna nawiÄ 137 zaÄ poÅÄ 138 czenia z serwerem'; 139 $messages['smtpautherror'] = 'BÅÄ 140 d SMTP ($code): Uwierzytelnianie nie powiodÅo siÄ'; 141 $messages['smtpfromerror'] = 'BÅÄ 142 d SMTP ($code): Nie moÅŒna ustawiÄ nadawcy "$from"'; 143 $messages['smtptoerror'] = 'BÅÄ 144 d SMTP ($code): Nie moÅŒna dodaÄ odbiorcy "$to"'; 145 $messages['smtprecipientserror'] = 'BÅÄ 146 d SMTP: Parsowanie listy odbiorców nie powiodÅo siÄ'; 147 $messages['smtperror'] = 'BÅÄ 148 d SMTP: $msg'; 135 149 136 150 ?> -
program/steps/mail/func.inc
r2f2bb40 r2818f8e 1303 1303 * Send the given message compose object using the configured method 1304 1304 */ 1305 function rcmail_deliver_message(&$message, $from, $mailto )1305 function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error) 1306 1306 { 1307 1307 global $CONFIG, $RCMAIL; … … 1328 1328 // send message 1329 1329 $smtp_response = array(); 1330 $sent = smtp_mail($from, $a_recipients, ($foo = $message->txtHeaders($send_headers, true)), $msg_body, $smtp_response );1330 $sent = smtp_mail($from, $a_recipients, ($foo = $message->txtHeaders($send_headers, true)), $msg_body, $smtp_response, $smtp_error); 1331 1331 1332 1332 // log error … … 1381 1381 1382 1382 1383 function rcmail_send_mdn($uid )1383 function rcmail_send_mdn($uid, &$smtp_error) 1384 1384 { 1385 1385 global $RCMAIL, $IMAP; … … 1439 1439 $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); 1440 1440 1441 $sent = rcmail_deliver_message($compose, $identity['email'], $mailto );1441 $sent = rcmail_deliver_message($compose, $identity['email'], $mailto, $smtp_error); 1442 1442 1443 1443 if ($sent) -
program/steps/mail/sendmail.inc
recb9fb0 r2818f8e 442 442 } 443 443 444 $sent = rcmail_deliver_message($MAIL_MIME, $from, $mailto );444 $sent = rcmail_deliver_message($MAIL_MIME, $from, $mailto, $smtp_error); 445 445 446 446 // return to compose page if sending failed 447 447 if (!$sent) 448 448 { 449 $OUTPUT->show_message("sendingfailed", 'error'); 449 if ($smtp_error) 450 $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']); 451 else 452 $OUTPUT->show_message('sendingfailed', 'error'); 450 453 $OUTPUT->send('iframe'); 451 454 } -
program/steps/mail/sendmdn.inc
rcbbef37 r2818f8e 22 22 23 23 if (!empty($_POST['_uid'])) { 24 $sent = rcmail_send_mdn(get_input_value('_uid', RCUBE_INPUT_POST) );24 $sent = rcmail_send_mdn(get_input_value('_uid', RCUBE_INPUT_POST), $smtp_error); 25 25 } 26 26 … … 29 29 $OUTPUT->set_env('mdn_request', false); 30 30 $OUTPUT->show_message('receiptsent', 'confirmation'); 31 } 32 else if ($smtp_error) { 33 $OUTPUT->show_message($smtp_error['label'], 'error', $smtp_error['vars']); 31 34 } 32 35 else { -
skins/default/common.css
r9ff98778 r2818f8e 186 186 } 187 187 188 189 188 #message 190 189 { … … 202 201 width: 400px; 203 202 margin: 0px auto; 204 height: 22px;205 203 min-height: 22px; 206 204 padding: 8px 10px 8px 46px;
Note: See TracChangeset
for help on using the changeset viewer.
