summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2012-04-21 16:42:23 +0000
committerthomascube <thomas@roundcube.net>2012-04-21 16:42:23 +0000
commit2cadfbbd76581c7f4bbbbcdb63b812e56acc6839 (patch)
treee0ddbac4c7a9a7cf607b1922436574a5e6cfe816
parent6dc7ce5a0692bf7433a5ab2221457fda4893502a (diff)
Backported r6109 to release branch
-rw-r--r--CHANGELOG1
-rw-r--r--program/steps/settings/save_identity.inc24
2 files changed, 14 insertions, 11 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 33e5577fa..993b46a01 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Support mutliple name/email pairs for Bcc and Reply-To identity settings (#1488445)
- Fix parent folder permissions checking on folder creation (#1488443)
- Set flexible width to login form fields (#1488418)
- Fix re-draw bug on list columns change in IE8 (#1487822)
diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc
index af0e6af98..59a943b09 100644
--- a/program/steps/settings/save_identity.inc
+++ b/program/steps/settings/save_identity.inc
@@ -25,7 +25,6 @@
define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0)));
$a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature', 'html_signature');
-$a_html_cols = array('signature', 'name', 'organization');
$a_boolean_cols = array('standard', 'html_signature');
$updated = $default_id = false;
@@ -43,7 +42,7 @@ foreach ($a_save_cols as $col)
{
$fname = '_'.$col;
if (isset($_POST[$fname]))
- $save_data[$col] = get_input_value($fname, RCUBE_INPUT_POST, in_array($col, $a_html_cols));
+ $save_data[$col] = get_input_value($fname, RCUBE_INPUT_POST, true);
}
// set "off" values for checkboxes that were not checked, and therefore
@@ -60,15 +59,18 @@ if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3)
unset($save_data['email']);
// Validate e-mail addresses
-foreach (array('email', 'reply-to', 'bcc') as $item) {
- if ($email = $save_data[$item]) {
- $ascii_email = rcube_idn_to_ascii($email);
- if (!check_email($ascii_email)) {
- // show error message
- $OUTPUT->show_message('emailformaterror', 'error', array('email' => $email), false);
- rcmail_overwrite_action('edit-identity');
- return;
- }
+$email_checks = array(rcube_idn_to_ascii($save_data['email']));
+foreach (array('reply-to', 'bcc') as $item) {
+ foreach (rcube_mime::decode_address_list(rcube_idn_to_ascii($save_data[$item]), null, false) as $rcpt)
+ $email_checks[] = $rcpt['mailto'];
+}
+
+foreach ($email_checks as $email) {
+ if ($email && !check_email($email)) {
+ // show error message
+ $OUTPUT->show_message('emailformaterror', 'error', array('email' => rcube_idn_to_utf8($email)), false);
+ rcmail_overwrite_action('edit-identity');
+ return;
}
}