Commit 00c5c51e authored by Till Brehm's avatar Till Brehm

Merge branch 'master' into 'master'

Support mail filtering by envelope :detail (+ part in mail addresses)

See merge request !703
parents 6b8a1eb4 8ef8a7d2
......@@ -61,7 +61,7 @@ class installer extends installer_base {
}
//* Configure master.cf and add a line for deliver
$content = rf($conf["postfix"]["config_dir"].'/master.cf');
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'."\n";
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${original_recipient}'."\n";
af($config_dir.'/master.cf', $deliver_content);
unset($content);
unset($deliver_content);
......
......@@ -394,7 +394,7 @@ class installer_dist extends installer_base {
}
//* Configure master.cf and add a line for deliver
$content = rf($conf["postfix"]["config_dir"].'/master.cf');
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'."\n";
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${original_recipient}'."\n";
af($conf["postfix"]["config_dir"].'/master.cf', $deliver_content);
unset($content);
unset($deliver_content);
......
......@@ -303,7 +303,7 @@ class installer extends installer_base
}
//* Configure master.cf and add a line for deliver
$content = rf($conf["postfix"]["config_dir"].'/master.cf');
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'."\n";
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${original_recipient}'."\n";
af($config_dir.'/master.cf', $deliver_content);
unset($content);
unset($deliver_content);
......
......@@ -404,7 +404,7 @@ class installer_dist extends installer_base {
}
//* Configure master.cf and add a line for deliver
$content = rf($conf["postfix"]["config_dir"].'/master.cf');
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'."\n";
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${original_recipient}'."\n";
af($conf["postfix"]["config_dir"].'/master.cf', $deliver_content);
unset($content);
unset($deliver_content);
......
......@@ -1322,7 +1322,7 @@ class installer_base {
}
//* Configure master.cf and add a line for deliver
$content = rf($conf["postfix"]["config_dir"].'/master.cf');
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'."\n";
$deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -a ${original_recipient}'."\n";
af($config_dir.'/master.cf', $deliver_content);
unset($content);
unset($deliver_content);
......
......@@ -148,17 +148,20 @@ class mail_user_filter_plugin {
}
$content .= 'if size :over '.intval($page_form->dataRecord["searchterm"]).$unit.' {'."\n";
} else {
if($page_form->dataRecord["source"] == 'Header') {
$parts = explode(':',trim($page_form->dataRecord["searchterm"]));
$page_form->dataRecord["source"] = trim($parts[0]);
unset($parts[0]);
$page_form->dataRecord["searchterm"] = trim(implode(':',$parts));
unset($parts);
if($page_form->dataRecord["source"] == 'Detail') {
$content .= 'if envelope :detail :regex "to" ["';
} else {
if($page_form->dataRecord["source"] == 'Header') {
$parts = explode(':',trim($page_form->dataRecord["searchterm"]));
$page_form->dataRecord["source"] = trim($parts[0]);
unset($parts[0]);
$page_form->dataRecord["searchterm"] = trim(implode(':',$parts));
unset($parts);
}
$content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["';
}
$content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["';
$searchterm = preg_quote($page_form->dataRecord["searchterm"]);
$searchterm = str_replace(
array(
......
......@@ -88,7 +88,7 @@ $form["tabs"]['filter'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => '',
'value' => array('Subject' => 'subject_txt', 'From'=>'from_txt', 'To'=>'to_txt')
'value' => array('Subject' => 'subject_txt', 'From'=>'from_txt', 'To'=>'to_txt', 'Detail'=>'detail_txt')
),
'op' => array (
'datatype' => 'VARCHAR',
......
......@@ -27,4 +27,5 @@ $wb['reject_txt'] = 'Abweisen';
$wb['stop_txt'] = 'Stop';
$wb['move_to_txt'] = 'Verschiebe nach';
$wb['mark_read_txt'] = 'Als gelesen markieren';
$wb['detail_txt'] = 'Detail-Angabe des Empfängers (user+detail@domain.com)';
?>
......@@ -27,4 +27,5 @@ $wb['reject_txt'] = 'Reject';
$wb['stop_txt'] = 'Stop';
$wb['move_to_txt'] = 'Move to';
$wb['mark_read_txt'] = 'Mark as read';
$wb['detail_txt'] = 'Detail part in recipient (user+detail@domain.com)';
?>
......@@ -18,4 +18,5 @@ $wb['begins_with_txt'] = 'Startet mit';
$wb['ends_with_txt'] = 'Endet mit';
$wb['move_to_txt'] = 'Verschieben nach';
$wb['delete_txt'] = 'Löschen';
$wb['detail_txt'] = 'Detail-Angabe des Empfängers (user+detail@domain.com)';
?>
......@@ -18,4 +18,5 @@ $wb['begins_with_txt'] = 'Begins with';
$wb['ends_with_txt'] = 'Ends with';
$wb['move_to_txt'] = 'Move to';
$wb['delete_txt'] = 'Delete';
$wb['detail_txt'] = 'Detail part in recipient (user+detail@domain.com)';
?>
require ["fileinto", "regex", "vacation", "imap4flags"];
require ["fileinto", "regex", "vacation", "imap4flags", "envelope", "subaddress"];
<tmpl_if name="cc">
# Send a copy of email to
......
require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags"];
require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress"];
<tmpl_if name="cc">
# Send a copy of email to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment