diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php index 26040368fe0eebbb3cdd22e157fdc4e5eacf2c06..5fc06279bc3aa7abd9281c7cae234ad0e5789cb4 100644 --- a/interface/lib/classes/tform.inc.php +++ b/interface/lib/classes/tform.inc.php @@ -1302,7 +1302,7 @@ class tform { $perm = $app->db->quote($perm); $table = $app->db->quote($table); - if($_SESSION["s"]["user"]["typ"] == 'admin') { + if($_SESSION["s"]["user"]["typ"] == 'admin' || $_SESSION['s']['user']['mailuser_id'] > 0) { return '1'; } else { if ($table != ''){ diff --git a/interface/web/mail/form/mail_user.tform.php b/interface/web/mail/form/mail_user.tform.php index b6f8dfa093a196abbcb74ae13fc896edab6f7541..66bc8e3c21ebbb3d7bc286825ac3343af4e8354c 100644 --- a/interface/web/mail/form/mail_user.tform.php +++ b/interface/web/mail/form/mail_user.tform.php @@ -160,7 +160,7 @@ $form["tabs"]['mailuser'] = array( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i', + 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}(,\s*\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,}$/i', 'errmsg'=> 'cc_error_isemail'), ), 'default' => '', diff --git a/interface/web/mail/lib/lang/de_mail_user.lng b/interface/web/mail/lib/lang/de_mail_user.lng index b5bdc598b42def87fc180ea48da375a8be58e3e1..cd8928ad81f46fc647762f431121577d27d70b94 100644 --- a/interface/web/mail/lib/lang/de_mail_user.lng +++ b/interface/web/mail/lib/lang/de_mail_user.lng @@ -48,4 +48,5 @@ $wb['repeat_password_txt'] = 'Passwort wiederholen'; $wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.'; $wb['password_match_txt'] = 'Die Passwörter stimmen überein.'; $wb['email_error_isascii'] = 'Bitte verwenden Sie keine Umlaute im Passwort. Dies kann zu Problemen mit Ihrem E-Mail-Programm führen.'; +$wb['cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)'; ?> \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_user.lng b/interface/web/mail/lib/lang/en_mail_user.lng index 81301db3526ebd66379fdc2032994f6e0e001663..7c80c76638b3ad265a998365879251454a89a516 100644 --- a/interface/web/mail/lib/lang/en_mail_user.lng +++ b/interface/web/mail/lib/lang/en_mail_user.lng @@ -48,4 +48,5 @@ $wb['repeat_password_txt'] = 'Repeat Password'; $wb['password_mismatch_txt'] = 'The passwords do not match.'; $wb['password_match_txt'] = 'The passwords do match.'; $wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.'; +$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)'; ?> diff --git a/interface/web/mail/templates/mail_user_mailbox_edit.htm b/interface/web/mail/templates/mail_user_mailbox_edit.htm index 0460bc6983c2a07dbd8bdf1448989c88c5177514..f946502dbd11d9b4a1bc79114d9c244cee736928 100644 --- a/interface/web/mail/templates/mail_user_mailbox_edit.htm +++ b/interface/web/mail/templates/mail_user_mailbox_edit.htm @@ -42,7 +42,7 @@ </div> <div class="ctrlHolder"> <label for="name">{tmpl_var name='cc_txt'}</label> - <input name="cc" id="cc" value="{tmpl_var name='cc'}" size="30" maxlength="255" type="text" class="textInput" /> {tmpl_var name='name_optional_txt'} + <input name="cc" id="cc" value="{tmpl_var name='cc'}" size="30" maxlength="255" type="text" class="textInput" /> {tmpl_var name='name_optional_txt'} {tmpl_var name='cc_note_txt'} </div> <div class="ctrlHolder"> <label for="policy">{tmpl_var name='policy_txt'}</label> diff --git a/interface/web/mailuser/form/mail_user_cc.tform.php b/interface/web/mailuser/form/mail_user_cc.tform.php index 6458bb730a9a7bb8c450d089917bb759c8cf80dd..5f1d9ef7a93335449dcfdfb5efe1ef2a29ab1e38 100644 --- a/interface/web/mailuser/form/mail_user_cc.tform.php +++ b/interface/web/mailuser/form/mail_user_cc.tform.php @@ -69,7 +69,8 @@ $form["tabs"]['mailuser'] = array ( 'type' => 'TOLOWER') ), 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z\-]{2,10}){0,1}$/i', + //'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z\-]{2,10}){0,1}$/i', + 'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}(,\s*\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,}$/i', 'errmsg'=> 'cc_error_isemail'), ), 'default' => '', diff --git a/interface/web/mailuser/lib/lang/de_mail_user_cc.lng b/interface/web/mailuser/lib/lang/de_mail_user_cc.lng index f39785ba8ff1c2d6999aa04471366bd749a767a4..cfb1ab3ca54552ceef04cdef47713374d97b8023 100644 --- a/interface/web/mailuser/lib/lang/de_mail_user_cc.lng +++ b/interface/web/mailuser/lib/lang/de_mail_user_cc.lng @@ -4,4 +4,6 @@ $wb['cc_txt'] = 'Kopie senden an'; $wb['email_txt'] = 'E-Mail'; $wb['cc_error_isemail'] = 'E-Mail Adresse ungültig im -Kopie senden an- Feld'; $wb['email_is_cc_error'] = 'E-Mail Adresse und '; +$wb['name_optional_txt'] = '(optional)'; +$wb['cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)'; ?> \ No newline at end of file diff --git a/interface/web/mailuser/lib/lang/en_mail_user_cc.lng b/interface/web/mailuser/lib/lang/en_mail_user_cc.lng index 0073c71647eb0196b2be0aebc83018484100d7cd..3437d50d195c8bdef543e2a688f5527250585415 100644 --- a/interface/web/mailuser/lib/lang/en_mail_user_cc.lng +++ b/interface/web/mailuser/lib/lang/en_mail_user_cc.lng @@ -4,4 +4,6 @@ $wb["cc_txt"] = 'Send copy to'; $wb["email_txt"] = 'Email'; $wb["cc_error_isemail"] = 'Email address invalid in -Send copy to- field'; $wb["email_is_cc_error"] = 'Email address and send copy to address can not be the same.'; +$wb["name_optional_txt"] = '(Optional)'; +$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)'; ?> \ No newline at end of file diff --git a/interface/web/mailuser/mail_user_spamfilter_edit.php b/interface/web/mailuser/mail_user_spamfilter_edit.php index dfc397dda342d8d19e759ad0e2f979707bcd2b06..3ea2aa57d55f363c75e57fddebccd755e6ab1025 100644 --- a/interface/web/mailuser/mail_user_spamfilter_edit.php +++ b/interface/web/mailuser/mail_user_spamfilter_edit.php @@ -51,7 +51,8 @@ $app->load('tform_actions'); class page_action extends tform_actions { function onShow() { - + global $app; + $this->id = $app->functions->intval($_SESSION['s']['user']['mailuser_id']); parent::onShow(); diff --git a/interface/web/mailuser/templates/mail_user_cc_edit.htm b/interface/web/mailuser/templates/mail_user_cc_edit.htm index ba715c89ae1569baa7cf0135124d0b186291a9ba..3b82c464797d34306563c0674d02fb996de85a55 100644 --- a/interface/web/mailuser/templates/mail_user_cc_edit.htm +++ b/interface/web/mailuser/templates/mail_user_cc_edit.htm @@ -11,7 +11,7 @@ </div> <div class="ctrlHolder"> <label for="name">{tmpl_var name='cc_txt'}</label> - <input name="cc" id="cc" value="{tmpl_var name='cc'}" size="30" maxlength="255" type="text" class="textInput" /> {tmpl_var name='name_optional_txt'} + <input name="cc" id="cc" value="{tmpl_var name='cc'}" size="30" maxlength="255" type="text" class="textInput" /> {tmpl_var name='name_optional_txt'} {tmpl_var name='cc_note_txt'} </div> </fieldset> diff --git a/server/conf/sieve_filter.master b/server/conf/sieve_filter.master index 09d7fa943109725d4cb42b80a09ba206c6321f50..e161a9f4999bf97b404ba42ada39d83c6b72559d 100644 --- a/server/conf/sieve_filter.master +++ b/server/conf/sieve_filter.master @@ -2,7 +2,9 @@ require ["fileinto", "regex", "vacation"]; <tmpl_if name="cc"> # Send a copy of email to -redirect "<tmpl_var name='cc'>"; +<tmpl_loop name="ccloop"> +redirect "<tmpl_var name='address'>"; +</tmpl_loop> </tmpl_if> <tmpl_if name="move_junk" op="==" value="y"> diff --git a/server/conf/sieve_filter_1.2.master b/server/conf/sieve_filter_1.2.master index a88dc2d6009b7d9e82b61371ffbcc8a696e7ed99..08473e69c0ed3088a00b3d000646cae07f009357 100644 --- a/server/conf/sieve_filter_1.2.master +++ b/server/conf/sieve_filter_1.2.master @@ -2,7 +2,9 @@ require ["fileinto", "regex", "date", "relational", "vacation"]; <tmpl_if name="cc"> # Send a copy of email to -redirect "<tmpl_var name='cc'>"; +<tmpl_loop name="ccloop"> +redirect "<tmpl_var name='address'>"; +</tmpl_loop> </tmpl_if> <tmpl_if name="move_junk" op="==" value="y"> diff --git a/server/plugins-available/maildeliver_plugin.inc.php b/server/plugins-available/maildeliver_plugin.inc.php index 16e3e7306984c09adabb9a23b1fa8eea964199a7..e3799d716e2f78149b113b7f96ce2bb2daab8575 100644 --- a/server/plugins-available/maildeliver_plugin.inc.php +++ b/server/plugins-available/maildeliver_plugin.inc.php @@ -120,7 +120,14 @@ class maildeliver_plugin { $tpl->newTemplate($filter_file_template); // cc Field + $tmp_mails_arr = explode(',',$data["new"]["cc"]); + $tmp_addresses_arr = array(); + foreach($tmp_mails_arr as $address) { + if(trim($address) != '') $tmp_addresses_arr[] = array('address' => trim($address)); + } + $tpl->setVar('cc', $data["new"]["cc"]); + $tpl->setLoop('ccloop', $tmp_addresses_arr); // Custom filters $tpl->setVar('custom_mailfilter', $data["new"]["custom_mailfilter"]); diff --git a/server/plugins-available/maildrop_plugin.inc.php b/server/plugins-available/maildrop_plugin.inc.php index 73bace85fe340267b097b2f1147c485857dcdc3c..37b030608012cf01b3af88e0aed2c2577734c683 100644 --- a/server/plugins-available/maildrop_plugin.inc.php +++ b/server/plugins-available/maildrop_plugin.inc.php @@ -192,7 +192,11 @@ class maildrop_plugin { $mailfilter_content = ''; if($data["new"]["cc"] != '') { - $mailfilter_content .= "cc \"!".$data["new"]["cc"]."\"\n"; + $tmp_mails_arr = explode(',',$data["new"]["cc"]); + foreach($tmp_mails_arr as $address) { + if(trim($address) != '') $mailfilter_content .= "cc \"!".trim($address)."\"\n"; + } + //$mailfilter_content .= "cc \"!".$data["new"]["cc"]."\"\n"; $app->log("Added CC address ".$data["new"]["cc"].' to mailfilter file.', LOGLEVEL_DEBUG); }