Commit c6e05a8e authored by tbrehm's avatar tbrehm
Browse files

Implemented: FS#1385 - Define all Email aliases in dovecot autoresponder

parent c84a6d59
......@@ -31,6 +31,6 @@ if header :contains "X-Spam-Flag" "YES" {
}
vacation :days 1
:subject "Out of office reply"
# :addresses ["test@test.int", "till@test.int"]
<tmpl_var name='addresses'>
"<tmpl_var name='autoresponder_text'>";
</tmpl_if>
......@@ -118,7 +118,21 @@ class maildeliver_plugin {
$data["new"]["autoresponder_text"] = str_replace("\"","'",$data["new"]["autoresponder_text"]);
$tpl->setVar('autoresponder_text',$data["new"]["autoresponder_text"]);
//* Set alias addresses for autoresponder
$sql = "SELECT * FROM mail_forwarding WHERE type = 'alias' AND destination = '".$app->db->quote($data["new"]["email"])."'";
$records = $app->db->queryAllRecords($sql);
$addresses = '';
if(is_array($records)) {
$addresses .= ':addresses [';
foreach($records as $rec) {
$addresses .= '"'.$rec['source'].'",';
}
$addresses = substr($addresses,0,-1);
$addresses .= ']';
}
$tpl->setVar('addresses',$addresses);
file_put_contents($sieve_file,$tpl->grab());
unset($tpl);
......
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