Skip to content

Commit aa39c6a

Browse files
committed
forward mail_user.cc in postfix
1 parent 09767f8 commit aa39c6a

File tree

5 files changed

+4
-35
lines changed

5 files changed

+4
-35
lines changed

install/tpl/mysql-virtual_email2email.cf.master

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ user = {mysql_server_ispconfig_user}
22
password = {mysql_server_ispconfig_password}
33
dbname = {mysql_server_database}
44
hosts = {mysql_server_ip}
5-
query = SELECT email FROM mail_user WHERE email = '%s' AND postfix = 'y' AND disabledeliver = 'n' AND server_id = {server_id}
6-
UNION
7-
SELECT cc AS email FROM mail_user WHERE email = '%s' AND postfix = 'y' AND disabledeliver = 'y' AND server_id = {server_id}
5+
query = SELECT cc AS email FROM mail_user WHERE cc != '' AND email = '%s' AND postfix = 'y' AND disabledeliver = 'y' AND server_id = {server_id}

install/tpl/mysql-virtual_mailboxes.cf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ user = {mysql_server_ispconfig_user}
22
password = {mysql_server_ispconfig_password}
33
dbname = {mysql_server_database}
44
hosts = {mysql_server_ip}
5-
query = select CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') from mail_user where login = '%s' and postfix = 'y' and server_id = {server_id}
5+
query = select CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') from mail_user where login = '%s' and postfix = 'y' and disabledeliver = 'n' and server_id = {server_id}

server/conf/sieve_filter.master

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes",
1414
}
1515
</tmpl_if>
1616

17-
<tmpl_if name="cc">
18-
# Send a copy of email to
19-
<tmpl_loop name="ccloop">
20-
redirect "<tmpl_var name='address'>";
21-
</tmpl_loop>
22-
</tmpl_if>
23-
2417
<tmpl_var name='custom_mailfilter'>
2518

2619
</tmpl_if>

server/plugins-available/maildeliver_plugin.inc.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ function update($event_name, $data) {
9292
or (isset($data["new"]["email"]) and $data["old"]["email"] != $data["new"]["email"])
9393
or $data["old"]["autoresponder_start_date"] != $data["new"]["autoresponder_start_date"]
9494
or $data["old"]["autoresponder_end_date"] != $data["new"]["autoresponder_end_date"]
95-
or $data["old"]["cc"] != $data["new"]["cc"]
9695
) {
9796

9897
$app->log("Mailfilter config has been changed", LOGLEVEL_DEBUG);
@@ -120,16 +119,6 @@ function update($event_name, $data) {
120119
$tpl = new tpl();
121120
$tpl->newTemplate("sieve_filter.master");
122121

123-
// cc Field
124-
$tmp_mails_arr = explode(',',$data["new"]["cc"]);
125-
$tmp_addresses_arr = array();
126-
foreach($tmp_mails_arr as $address) {
127-
if(trim($address) != '') $tmp_addresses_arr[] = array('address' => trim($address));
128-
}
129-
130-
$tpl->setVar('cc', $data["new"]["cc"]);
131-
$tpl->setLoop('ccloop', $tmp_addresses_arr);
132-
133122
// Custom filters
134123
if($data["new"]["custom_mailfilter"] == 'NULL') $data["new"]["custom_mailfilter"] = '';
135124
$tpl->setVar('custom_mailfilter', str_replace("\r\n","\n",$data["new"]["custom_mailfilter"]));

server/plugins-available/maildrop_plugin.inc.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,11 @@ function update($event_name, $data) {
175175

176176
// Write the custom mailfilter script, if mailfilter recipe has changed
177177
if($data["old"]["custom_mailfilter"] != $data["new"]["custom_mailfilter"]
178-
or $data["old"]["move_junk"] != $data["new"]["move_junk"]
179-
or $data["old"]["cc"] != $data["new"]["cc"]) {
178+
or $data["old"]["move_junk"] != $data["new"]["move_junk"]) {
180179

181180
$app->log("Mailfilter config has been changed", LOGLEVEL_DEBUG);
182181
if(trim($data["new"]["custom_mailfilter"]) != ''
183-
or $data["new"]["move_junk"] != 'n'
184-
or $data["new"]["cc"] != '') {
182+
or $data["new"]["move_junk"] != 'n') {
185183

186184
// Delete the old filter recipe
187185
$email_parts = explode("@", $data["old"]["email"]);
@@ -198,15 +196,6 @@ function update($event_name, $data) {
198196

199197
$mailfilter_content = '';
200198

201-
if($data["new"]["cc"] != '') {
202-
$tmp_mails_arr = explode(',',$data["new"]["cc"]);
203-
foreach($tmp_mails_arr as $address) {
204-
if(trim($address) != '') $mailfilter_content .= "cc \"!".trim($address)."\"\n";
205-
}
206-
//$mailfilter_content .= "cc \"!".$data["new"]["cc"]."\"\n";
207-
$app->log("Added CC address ".$data["new"]["cc"].' to mailfilter file.', LOGLEVEL_DEBUG);
208-
}
209-
210199
if($data["new"]["move_junk"] != 'n') {
211200
if(file_exists($conf["rootpath"].'/conf-custom/mailfilter_move_junk.master')) {
212201
$mailfilter_content .= file_get_contents($conf["rootpath"].'/conf-custom/mailfilter_move_junk.master')."\n";

0 commit comments

Comments
 (0)