public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Postfix] BCC destination must be single email address, fixes #993
9069a6f3
data/web/inc/functions.address_rewriting.inc.php | 28 ++++++++----------------
1 file changed, 9 insertions(+), 19 deletions(-)
Diff
diff --git a/data/web/inc/functions.address_rewriting.inc.php b/data/web/inc/functions.address_rewriting.inc.php
index 9dbc5673..b731e16b 100644
--- a/data/web/inc/functions.address_rewriting.inc.php
+++ b/data/web/inc/functions.address_rewriting.inc.php
@@ -15,7 +15,7 @@ function bcc($_action, $_data = null, $attr = null) {
return false;
}
$local_dest = strtolower(trim($_data['local_dest']));
- $bcc_dest = array_map('trim', preg_split( "/( |,|;|\n)/", $_data['bcc_dest']));
+ $bcc_dest = $_data['bcc_dest'];
$active = intval($_data['active']);
$type = $_data['type'];
if ($type != 'sender' && $type != 'rcpt') {
@@ -60,18 +60,10 @@ function bcc($_action, $_data = null, $attr = null) {
else {
return false;
}
- foreach ($bcc_dest as &$bcc_dest_e) {
- if (!filter_var($bcc_dest_e, FILTER_VALIDATE_EMAIL)) {
- $bcc_dest_e = null;;
- }
- $bcc_dest_e = strtolower($bcc_dest_e);
- }
- $bcc_dest = array_filter($bcc_dest);
- $bcc_dest = implode(",", $bcc_dest);
- if (empty($bcc_dest)) {
+ if (!filter_var($bcc_dest, FILTER_VALIDATE_EMAIL)) {
$_SESSION['return'] = array(
'type' => 'danger',
- 'msg' => 'BCC map destination cannot be empty'
+ 'msg' => 'BCC map must be a valid email address'
);
return false;
}
@@ -142,16 +134,14 @@ function bcc($_action, $_data = null, $attr = null) {
);
return false;
}
- $bcc_dest = array_map('trim', preg_split( "/( |,|;|\n)/", $bcc_dest));
$active = intval($_data['active']);
- foreach ($bcc_dest as &$bcc_dest_e) {
- if (!filter_var($bcc_dest_e, FILTER_VALIDATE_EMAIL)) {
- $bcc_dest_e = null;;
- }
- $bcc_dest_e = strtolower($bcc_dest_e);
+ if (!filter_var($bcc_dest, FILTER_VALIDATE_EMAIL)) {
+ $_SESSION['return'] = array(
+ 'type' => 'danger',
+ 'msg' => 'BCC map must be a valid email address'
+ );
+ return false;
}
- $bcc_dest = array_filter($bcc_dest);
- $bcc_dest = implode(",", $bcc_dest);
if (empty($bcc_dest)) {
$_SESSION['return'] = array(
'type' => 'danger',