- Support %h variable in 'smtp_server' option (#1485766)

release-0.6
alecpl 16 years ago
parent 16036b9c86
commit 72cd3c1a76

@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
=========================== ===========================
- Support %h variable in 'smtp_server' option (#1485766)
- Show SMTP errors in browser (#1485927) - Show SMTP errors in browser (#1485927)
- Allow WBR tag in HTML message (#1485960) - Allow WBR tag in HTML message (#1485960)
- Use spl_autoload_register() instead of __autoload (#1485947) - Use spl_autoload_register() instead of __autoload (#1485947)

@ -98,6 +98,7 @@ $rcmail_config['virtuser_query'] = '';
// use this host for sending mails. // use this host for sending mails.
// to use SSL connection, set ssl://smtp.host.com // to use SSL connection, set ssl://smtp.host.com
// if left blank, the PHP mail() function is used // if left blank, the PHP mail() function is used
// Use %h variable as replacement for user's IMAP hostname
$rcmail_config['smtp_server'] = ''; $rcmail_config['smtp_server'] = '';
// SMTP port (default is 25; 465 for SSL) // SMTP port (default is 25; 465 for SSL)

@ -64,9 +64,9 @@ function smtp_mail($from, $recipients, &$headers, &$body, &$response, &$error)
)); ));
$smtp_timeout = null; $smtp_timeout = null;
$smtp_host = $CONFIG['smtp_server']; $smtp_host = str_replace('%h', $_SESSION['imap_host'], $CONFIG['smtp_server']);
$smtp_port = is_numeric($CONFIG['smtp_port']) ? $CONFIG['smtp_port'] : 25; $smtp_port = is_numeric($CONFIG['smtp_port']) ? $CONFIG['smtp_port'] : 25;
$smtp_host_url = parse_url($CONFIG['smtp_server']); $smtp_host_url = parse_url($smtp_host);
// overwrite port // overwrite port
if (isset($smtp_host_url['host']) && isset($smtp_host_url['port'])) if (isset($smtp_host_url['host']) && isset($smtp_host_url['port']))

@ -260,7 +260,6 @@ function iil_MultLine($fp, $line, $escape=false) {
} }
$line = $a[1][0] . '"' . ($escape ? iil_Escape($out) : $out) . '"'; $line = $a[1][0] . '"' . ($escape ? iil_Escape($out) : $out) . '"';
// console('[...] '. $out);
} }
return $line; return $line;
} }
@ -269,10 +268,12 @@ function iil_ReadBytes($fp, $bytes) {
$data = ''; $data = '';
$len = 0; $len = 0;
do { do {
$data .= fread($fp, $bytes-$len); $d = fread($fp, $bytes-$len);
$data .= $d;
if ($len == strlen($data)) { if ($len == strlen($data)) {
break; //nothing was read -> exit to avoid apache lockups break; //nothing was read -> exit to avoid apache lockups
} }
// console('[...] '. $d);
$len = strlen($data); $len = strlen($data);
} while ($len < $bytes); } while ($len < $bytes);

Loading…
Cancel
Save