Commit ae6b86b0 authored by tbrehm's avatar tbrehm
Browse files

- Select sieve template depending on dovecot version as doevceot 1.0 does not...

- Select sieve template depending on dovecot version as doevceot 1.0 does not support the new date based autoresponders.
- Cleaned up opensuse dovecot-sql.conf file
parent 0b376a3b
......@@ -134,5 +134,4 @@ connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_se
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
# user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE email = '%u' AND disable%Ls = 'n'
......@@ -100,9 +100,23 @@ class maildeliver_plugin {
if(is_file($sieve_file)) unlink($sieve_file) or $app->log("Unable to delete file: $sieve_file",LOGLEVEL_WARN);
$app->load('tpl');
//* Select sieve filter file for dovecot version
exec('dovecot --version',$tmp);
if(substr($tmp[0],0,3) == '1.0') {
$filter_file_template = "sieve_filter.master";
} elseif(substr($tmp[0],0,3) == '1.2') {
$filter_file_template = "sieve_filter_1.2.master";
} elseif(substr($tmp[0],0,1) == '2') {
$filter_file_template = "sieve_filter_1.2.master";
} else {
$filter_file_template = "sieve_filter.master";
}
unset($tmp);
//* Create new filter file based on template
$tpl = new tpl();
$tpl->newTemplate("sieve_filter.master");
$tpl->newTemplate($filter_file_template);
// cc Field
$tpl->setVar('cc',$data["new"]["cc"]);
......
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