diff --git a/install/dist/conf/debian40.conf.php b/install/dist/conf/debian40.conf.php
index 5957e4887600fa32564db65a2a3c63be28f3e6a3..6a3c410c50bce4f6298f9430c2e7ba36b15fa881 100644
--- a/install/dist/conf/debian40.conf.php
+++ b/install/dist/conf/debian40.conf.php
@@ -31,6 +31,10 @@ $conf["dist_postfix_vmail_groupid"] = "5000";
$conf["dist_postfix_vmail_groupname"] = "vmail";
$conf["dist_postfix_vmail_mailbox_base"] = "/home/vmail";
+// Getmail
+$conf["dist_getmail_config_dir"] = "/etc/getmail";
+$conf["dist_getmail_program"] = "/usr/bin/getmail";
+
// Courier
$conf["dist_courier_config_dir"] = "/etc/courier";
diff --git a/install/install.php b/install/install.php
index 1805ef310aef483d351bbacf953565eb5dda05c8..abbe35839f64169648c014cd746f39e9fe78705f 100644
--- a/install/install.php
+++ b/install/install.php
@@ -94,6 +94,10 @@ $inst->configure_getmail();
swriteln('Installing ISPConfig');
$inst->install_ispconfig();
+// Configure ISPConfig
+swriteln('Installing Crontab');
+$inst->install_crontab();
+
/*
Restart services:
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 8370a069803d4cef2ad0104df8c99d1602fc67ba..b1c5a85874d0c8e395cf99e8941779e85b3ede6e 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -521,6 +521,39 @@ postfix check
}
+ function install_crontab() {
+ global $conf;
+
+ // Root Crontab
+ exec("crontab -u root -l > crontab.txt");
+ $existing_root_cron_jobs = file('crontab.txt');
+
+ $root_cron_jobs = array('* * * * * /usr/bin/php -q /usr/local/ispconfig/server/server.php &> /dev/null');
+ foreach($root_cron_jobs as $cron_job) {
+ if(!in_array($cron_job."\n",$existing_root_cron_jobs)) {
+ $existing_root_cron_jobs[] = $cron_job."\n";
+ }
+ }
+ file_put_contents('crontab.txt',$existing_root_cron_jobs);
+ exec("crontab -u root crontab.txt &> /dev/null");
+ unlink('crontab.txt');
+
+ // Getmail crontab
+ exec("crontab -u root -l > crontab.txt");
+ $existing_cron_jobs = file('crontab.txt');
+
+ $cron_jobs = array('*/5 * * * * '.$conf["dist_getmail_program"].' -g '.$conf["dist_getmail_config_dir"].' -r '.$conf["dist_getmail_config_dir"].'/*.conf &> /dev/null');
+ foreach($cron_jobs as $cron_job) {
+ if(!in_array($cron_job."\n",$existing_cron_jobs)) {
+ $existing_cron_jobs[] = $cron_job."\n";
+ }
+ }
+ file_put_contents('crontab.txt',$existing_cron_jobs);
+ exec("crontab -u root crontab.txt &> /dev/null");
+ unlink('crontab.txt');
+
+ }
+
}
diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index a9ae437cea66b3644de2a38d29c24cfef128fb64..bdcbaed8556a7396561f3566a4780701156cdc2e 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -853,6 +853,7 @@ class tform {
// Insert the server_id, if the record has a server_id
$server_id = ($record_old["server_id"] > 0)?$record_old["server_id"]:0;
+ if(isset($record_new["server_id"])) $server_id = $record_new["server_id"];
$this->diffrec = $diffrec;
diff --git a/interface/web/mail/lib/lang/en_mail_domain.lng b/interface/web/mail/lib/lang/en_mail_domain.lng
index 49f823604cb6a528040de0c652bee20fd0b29e16..efa7c81ef1e29ab298bff9767e9ba93aa9f57547 100644
--- a/interface/web/mail/lib/lang/en_mail_domain.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain.lng
@@ -10,5 +10,6 @@ $wb["domain_error_unique"] = 'Duplicate Domain.';
$wb["domain_error_regex"] = 'Invalid domain name.';
$wb["client_txt"] = 'Client';
$wb["limit_maildomain_txt"] = 'The max. number of email domains for your account is reached.';
-
+$wb["policy_txt"] = 'Spamfilter';
+$wb["no_policy"] = '- not enabled -';
?>
\ No newline at end of file
diff --git a/interface/web/mail/lib/lang/en_mail_user.lng b/interface/web/mail/lib/lang/en_mail_user.lng
index 3026274db5ef1aa97679872c83832c7b1e96d12d..69908191235f76b01707b3197233b698dc127a39 100644
--- a/interface/web/mail/lib/lang/en_mail_user.lng
+++ b/interface/web/mail/lib/lang/en_mail_user.lng
@@ -17,6 +17,10 @@ $wb["password_txt"] = 'password';
$wb["maildir_txt"] = 'maildir';
$wb["postfix_txt"] = 'Enable Receiving';
$wb["access_txt"] = 'Enable Access';
+$wb["policy_txt"] = 'Spamfilter';
+$wb["no_policy"] = '- not enabled -';
$wb["limit_mailbox_txt"] = 'The max. number of mailboxes for your account is reached.';
$wb["limit_mailquota_txt"] = 'The max space for mailboxes is reached. The max. available space in MB is';
+$wb["welcome_mail_subject"] = "Welcome to your new email account.";
+$wb["welcome_mail_message"] = "Welcome to your new email account.\r\n \r\n Your webmaster.";
?>
\ No newline at end of file
diff --git a/interface/web/mail/lib/module.conf.php b/interface/web/mail/lib/module.conf.php
index 5cf7455247eba1c8e307e91adfa2a8160c15dc12..34a7afc8f35428a0fb4ce557d69e856b2b0ed360 100644
--- a/interface/web/mail/lib/module.conf.php
+++ b/interface/web/mail/lib/module.conf.php
@@ -94,11 +94,11 @@ unset($items);
if($_SESSION["s"]["user"]["typ"] == 'admin') {
- $items[] = array( 'title' => "Whitelist",
+ $items[] = array( 'title' => "Postfix Whitelist",
'target' => 'content',
'link' => 'mail/mail_whitelist_list.php');
- $items[] = array( 'title' => "Blacklist",
+ $items[] = array( 'title' => "Postfix Blacklist",
'target' => 'content',
'link' => 'mail/mail_blacklist_list.php');
diff --git a/interface/web/mail/mail_domain_edit.php b/interface/web/mail/mail_domain_edit.php
index 579a05295513e3224d85353263cb9f17157d76bf..13333b19634343d981d03205f0d9f9b18624ee49 100644
--- a/interface/web/mail/mail_domain_edit.php
+++ b/interface/web/mail/mail_domain_edit.php
@@ -92,6 +92,22 @@ class page_action extends tform_actions {
$app->tpl->setVar("client_group_id",$client_select);
}
+ // Get the spamfilter policys for the user
+ $tmp_user = $app->db->queryOneRecord("SELECT policy_id FROM spamfilter_users WHERE email = '@".$this->dataRecord["domain"]."'");
+ $sql = "SELECT id, policy_name FROM spamfilter_policy WHERE ".$app->tform->getAuthSQL('r');
+ $policys = $app->db->queryAllRecords($sql);
+ $policy_select = "".$app->tform->wordbook["no_policy"]." ";
+ if(is_array($policys)) {
+ foreach( $policys as $p) {
+ $selected = ($p["id"] == $tmp_user["policy_id"])?'SELECTED':'';
+ $policy_select .= "$p[policy_name] \r\n";
+ }
+ }
+ $app->tpl->setVar("policy",$policy_select);
+ unset($policys);
+ unset($policy_select);
+ unset($tmp_user);
+
parent::onShowEnd();
}
@@ -138,6 +154,24 @@ class page_action extends tform_actions {
$client_group_id = intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id);
}
+
+ // Spamfilter policy
+ $policy_id = intval($this->dataRecord["policy"]);
+ if($policy_id > 0) {
+ $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".addslashes($this->dataRecord["domain"])."'");
+ if($tmp_user["id"] > 0) {
+ // There is already a record that we will update
+ $sql = "UPDATE spamfilter_users SET policy_id = $ploicy_id WHERE id = ".$tmp_user["id"];
+ $app->db->query($sql);
+ } else {
+ $tmp_domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain_id = ".$this->id);
+ // We create a new record
+ $sql = "INSERT INTO `spamfilter_users` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`)
+ VALUES (".$_SESSION["s"]["user"]["userid"].", ".$tmp_domain["sys_groupid"].", 'riud', 'riud', '', ".$this->dataRecord["server_id"].", 5, ".$policy_id.", '@".addslashes($this->dataRecord["domain"])."', '@".addslashes($this->dataRecord["domain"])."', 'Y')";
+ $app->db->query($sql);
+ unset($tmp_domain);
+ }
+ } // endif spamfilter policy
}
function onAfterUpdate() {
@@ -149,6 +183,30 @@ class page_action extends tform_actions {
$client_group_id = intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id);
}
+
+ // Spamfilter policy
+ $policy_id = intval($this->dataRecord["policy"]);
+ $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".addslashes($this->dataRecord["domain"])."'");
+ if($policy_id > 0) {
+ if($tmp_user["id"] > 0) {
+ // There is already a record that we will update
+ $sql = "UPDATE spamfilter_users SET policy_id = $policy_id WHERE id = ".$tmp_user["id"];
+ $app->db->query($sql);
+ } else {
+ $tmp_domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain_id = ".$this->id);
+ // We create a new record
+ $sql = "INSERT INTO `spamfilter_users` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`)
+ VALUES (".$_SESSION["s"]["user"]["userid"].", ".$tmp_domain["sys_groupid"].", 'riud', 'riud', '', ".$this->dataRecord["server_id"].", 5, ".$policy_id.", '@".addslashes($this->dataRecord["domain"])."', '@".addslashes($this->dataRecord["domain"])."', 'Y')";
+ $app->db->query($sql);
+ unset($tmp_domain);
+ }
+ }else {
+ if($tmp_user["id"] > 0) {
+ // There is already a record but the user shall have no policy, so we delete it
+ $sql = "DELETE FROM spamfilter_users WHERE id = ".$tmp_user["id"];
+ $app->db->query($sql);
+ }
+ } // endif spamfilter policy
}
}
diff --git a/interface/web/mail/mail_get_edit.php b/interface/web/mail/mail_get_edit.php
index 1d0726665ecf75d1a14abd9b8387a1900637cfbb..1da67355e1bfa69f51d7ee4a9613288990e6d28a 100644
--- a/interface/web/mail/mail_get_edit.php
+++ b/interface/web/mail/mail_get_edit.php
@@ -53,6 +53,16 @@ $app->load('tform_actions');
class page_action extends tform_actions {
+ function onSubmit() {
+ global $app, $conf;
+
+ // Set the server ID according to the selected destination
+ $tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE email = '".addslashes($this->dataRecord["destination"])."'");
+ $this->dataRecord["server_id"] = $tmp["server_id"];
+ unset($tmp);
+
+ parent::onSubmit();
+ }
}
diff --git a/interface/web/mail/mail_user_edit.php b/interface/web/mail/mail_user_edit.php
index 4659d87581bbc5d65a47c84af419f57a75aff03c..88986e95bf850866ea75acf6de419d15f5fb6976 100644
--- a/interface/web/mail/mail_user_edit.php
+++ b/interface/web/mail/mail_user_edit.php
@@ -94,9 +94,27 @@ class page_action extends tform_actions {
}
}
$app->tpl->setVar("email_domain",$domain_select);
+ unset($domains);
+ unset($domain_select);
+
+ // Get the spamfilter policys for the user
+ $tmp_user = $app->db->queryOneRecord("SELECT policy_id FROM spamfilter_users WHERE email = '".$this->dataRecord["email"]."'");
+ $sql = "SELECT id, policy_name FROM spamfilter_policy WHERE ".$app->tform->getAuthSQL('r');
+ $policys = $app->db->queryAllRecords($sql);
+ $policy_select = "".$app->tform->wordbook["no_policy"]." ";
+ if(is_array($policys)) {
+ foreach( $policys as $p) {
+ $selected = ($p["id"] == $tmp_user["policy_id"])?'SELECTED':'';
+ $policy_select .= "$p[policy_name] \r\n";
+ }
+ }
+ $app->tpl->setVar("policy",$policy_select);
+ unset($policys);
+ unset($policy_select);
+ unset($tmp_user);
// Convert quota from Bytes to MB
- $app->tpl->setVar("quota",$this->dataRecord["quota"] / 1024/ 1024);
+ $app->tpl->setVar("quota",$this->dataRecord["quota"] / 1024 / 1024);
parent::onShowEnd();
}
@@ -176,16 +194,59 @@ class page_action extends tform_actions {
global $app, $conf;
// Set the domain owner as mailbox owner
- $domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
+ $domain = $app->db->queryOneRecord("SELECT sys_groupid, server_id FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
$app->db->query("UPDATE mail_user SET sys_groupid = ".$domain["sys_groupid"]." WHERE mailuser_id = ".$this->id);
+
+ // send a welcome email to create the mailbox
+ mail($this->dataRecord["email"],$app->tform->wordbook["welcome_mail_subject"],$app->tform->wordbook["welcome_mail_message"]);
+
+ // Spamfilter policy
+ $policy_id = intval($this->dataRecord["policy"]);
+ if($policy_id > 0) {
+ $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '".addslashes($this->dataRecord["email"])."'");
+ if($tmp_user["id"] > 0) {
+ // There is already a record that we will update
+ $sql = "UPDATE spamfilter_users SET policy_id = $ploicy_id WHERE id = ".$tmp_user["id"];
+ $app->db->query($sql);
+ } else {
+ // We create a new record
+ $sql = "INSERT INTO `spamfilter_users` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`)
+ VALUES (".$_SESSION["s"]["user"]["userid"].", ".$domain["sys_groupid"].", 'riud', 'riud', '', ".$domain["server_id"].", 1, ".$policy_id.", '".addslashes($this->dataRecord["email"])."', '".addslashes($this->dataRecord["email"])."', 'Y')";
+ $app->db->query($sql);
+ }
+ } // endif spamfilter policy
+
}
function onAfterUpdate() {
global $app, $conf;
// Set the domain owner as mailbox owner
- $domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
+ $domain = $app->db->queryOneRecord("SELECT sys_groupid, server_id FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
$app->db->query("UPDATE mail_user SET sys_groupid = ".$domain["sys_groupid"]." WHERE mailuser_id = ".$this->id);
+
+ // Spamfilter policy
+ $policy_id = intval($this->dataRecord["policy"]);
+ $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '".addslashes($this->dataRecord["email"])."'");
+ if($policy_id > 0) {
+ if($tmp_user["id"] > 0) {
+ // There is already a record that we will update
+ $sql = "UPDATE spamfilter_users SET policy_id = $policy_id WHERE id = ".$tmp_user["id"];
+ $app->db->query($sql);
+ } else {
+ // We create a new record
+ $sql = "INSERT INTO `spamfilter_users` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`)
+ VALUES (".$_SESSION["s"]["user"]["userid"].", ".$domain["sys_groupid"].", 'riud', 'riud', '', ".$domain["server_id"].", 1, ".$policy_id.", '".addslashes($this->dataRecord["email"])."', '".addslashes($this->dataRecord["email"])."', 'Y')";
+ $app->db->query($sql);
+ }
+ }else {
+ if($tmp_user["id"] > 0) {
+ // There is already a record but the user shall have no policy, so we delete it
+ $sql = "DELETE FROM spamfilter_users WHERE id = ".$tmp_user["id"];
+ $app->db->query($sql);
+ }
+ } // endif spamfilter policy
+
}
}
diff --git a/interface/web/mail/spamfilter_blacklist_edit.php b/interface/web/mail/spamfilter_blacklist_edit.php
index 99c098fe53efb3127cb26c89e0167878387d341e..e4772da21d7e84f285b3290be5a7a4087be39bf8 100644
--- a/interface/web/mail/spamfilter_blacklist_edit.php
+++ b/interface/web/mail/spamfilter_blacklist_edit.php
@@ -93,6 +93,11 @@ class page_action extends tform_actions {
}
} // end if user is not admin
+ // Select and set the server_id so it matches the server_id of the spa,filter_users record
+ $tmp = $app->db->queryOneRecord("SELECT server_id FROM spamfilter_users WHERE id = ".intval($this->dataRecord["rid"]));
+ $this->dataRecord["server_id"] = $tmp["server_id"];
+ unset($tmp);
+
parent::onSubmit();
}
}
diff --git a/interface/web/mail/spamfilter_whitelist_edit.php b/interface/web/mail/spamfilter_whitelist_edit.php
index b1f249651f06431cc961d47c8de027a55679c7c6..fb2a5ef692aea56763325af8fb7e36a58eb292f4 100644
--- a/interface/web/mail/spamfilter_whitelist_edit.php
+++ b/interface/web/mail/spamfilter_whitelist_edit.php
@@ -93,6 +93,12 @@ class page_action extends tform_actions {
}
} // end if user is not admin
+ // Select and set the server_id so it matches the server_id of the spa,filter_users record
+ $tmp = $app->db->queryOneRecord("SELECT server_id FROM spamfilter_users WHERE id = ".intval($this->dataRecord["rid"]));
+ $this->dataRecord["server_id"] = $tmp["server_id"];
+ unset($tmp);
+
+
parent::onSubmit();
}
}
diff --git a/interface/web/mail/templates/mail_domain_edit.htm b/interface/web/mail/templates/mail_domain_edit.htm
index 9a02d87a2cf33c395ae2f18b18dbe22ad5064a06..6889b8a37dcfc98209f0104641720b34504c3dd8 100644
--- a/interface/web/mail/templates/mail_domain_edit.htm
+++ b/interface/web/mail/templates/mail_domain_edit.htm
@@ -21,6 +21,14 @@
{tmpl_var name='domain_txt'}:
+
+ {tmpl_var name='policy_txt'}:
+
+
+ {tmpl_var name='policy'}
+
+
+
{tmpl_var name='active'} {tmpl_var name='active_txt'}
diff --git a/interface/web/mail/templates/mail_get_edit.htm b/interface/web/mail/templates/mail_get_edit.htm
index 6b92616ab1b47b069753a0ba156dc84ab63b49f7..e89524445fad9190162e8c68bfc2bb4f7b225ac6 100644
--- a/interface/web/mail/templates/mail_get_edit.htm
+++ b/interface/web/mail/templates/mail_get_edit.htm
@@ -1,4 +1,5 @@
+
+
\ No newline at end of file
diff --git a/interface/web/mail/templates/mail_user_mailbox_edit.htm b/interface/web/mail/templates/mail_user_mailbox_edit.htm
index b7eabad92a7be823112a58dc4c9e16ec28ccd658..7f008992f824a4b8b11c76da4967f1c31509706f 100644
--- a/interface/web/mail/templates/mail_user_mailbox_edit.htm
+++ b/interface/web/mail/templates/mail_user_mailbox_edit.htm
@@ -11,6 +11,14 @@
{tmpl_var name='quota_txt'}:
MB
+
+ {tmpl_var name='policy_txt'}:
+
+
+ {tmpl_var name='policy'}
+
+
+
{tmpl_var name='postfix_txt'}:
{tmpl_var name='postfix'}
diff --git a/interface/web/mail/templates/spamfilter_blacklist_edit.htm b/interface/web/mail/templates/spamfilter_blacklist_edit.htm
index 9b515c21cab2b0059087d8cc3e570aa5348f5771..c658591801847804d9b6987847b15126771c7ffa 100644
--- a/interface/web/mail/templates/spamfilter_blacklist_edit.htm
+++ b/interface/web/mail/templates/spamfilter_blacklist_edit.htm
@@ -1,4 +1,5 @@
+
{tmpl_var name='rid_txt'}:
diff --git a/interface/web/mail/templates/spamfilter_whitelist_edit.htm b/interface/web/mail/templates/spamfilter_whitelist_edit.htm
index c35e5808eb60b81c3e51405f1b09cfcef3b38d12..d05796a3243c415d7023151ee86756ace0b50e26 100644
--- a/interface/web/mail/templates/spamfilter_whitelist_edit.htm
+++ b/interface/web/mail/templates/spamfilter_whitelist_edit.htm
@@ -1,4 +1,5 @@
+
{tmpl_var name='rid_txt'}:
diff --git a/server/conf/getmail.conf.master b/server/conf/getmail.conf.master
index 92bb689ef795d3c41326ca08c176afa483f8d395..1fb1c182cd594dc9dd1866b686b21eec30b5a66d 100644
--- a/server/conf/getmail.conf.master
+++ b/server/conf/getmail.conf.master
@@ -1,5 +1,6 @@
[options]
-message_log = /var/log/getmail.log
+# message_log = /var/log/getmail.log
+message_log_syslog = 1
delete = {DELETE}
[retriever]
diff --git a/server/lib/classes/modules.inc.php b/server/lib/classes/modules.inc.php
index a8de65bce9c9abbc5bb4d2920e6512fa2af37b88..16fc2cc84ac3b091926ce71b60709277b04d1089 100644
--- a/server/lib/classes/modules.inc.php
+++ b/server/lib/classes/modules.inc.php
@@ -78,15 +78,17 @@ class modules {
*/
function processDatalog() {
- global $app;
+ global $app,$conf;
// TODO: process only new entries.
- $sql = "SELECT * FROM sys_datalog WHERE 1";
+ $sql = "SELECT * FROM sys_datalog WHERE server_id = ".$conf["server_id"];
$records = $app->db->queryAllRecords($sql);
foreach($records as $rec) {
$data = unserialize(stripslashes($rec["data"]));
$this->raiseTableHook($rec["dbtable"],$rec["action"],$data);
}
+ $app->db->query("DELETE FROM sys_datalog WHERE datalog_id = ".$rec["datalog_id"]);
+ $app->log("Deleting sys_datalog ID ".$rec["datalog_id"],LOGLEVEL_DEBUG);
}
function raiseTableHook($table_name,$action,$data) {
diff --git a/server/plugins-enabled/getmail_plugin.inc.php b/server/plugins-enabled/getmail_plugin.inc.php
index 65569d4bf7eb4abc1095f15bc85841afc07e1924..b65a087dbe491714d63c56abc068ee3720d4ea21 100644
--- a/server/plugins-enabled/getmail_plugin.inc.php
+++ b/server/plugins-enabled/getmail_plugin.inc.php
@@ -113,6 +113,7 @@ class getmail_plugin {
// Write the config file.
file_put_contents($config_file_path,$tpl);
$app->log("Writing Getmail config file: $config_file_path",LOGLEVEL_DEBUG);
+ exec("chmod 400 $config_file_path");
unset($tpl);
unset($config_file_path);