From 52bbc896f72c575ce6b15937df986432309f450d Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Sun, 15 Nov 2015 03:57:23 -0500
Subject: [PATCH] postfix server-plugin (check your changes before restarting postfix)
---
server/plugins-available/postfix_server_plugin.inc.php | 38 ++++++++++++++++++++------------------
1 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/server/plugins-available/postfix_server_plugin.inc.php b/server/plugins-available/postfix_server_plugin.inc.php
index 87ae500..d0062b1 100644
--- a/server/plugins-available/postfix_server_plugin.inc.php
+++ b/server/plugins-available/postfix_server_plugin.inc.php
@@ -161,27 +161,29 @@
exec('postfix reload');
}
- if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') {
- // If dovecot switch to lmtp
- if($app->system->is_installed('dovecot')) {
- exec("postconf -e 'virtual_transport = lmtp:unix:private/dovecot-lmtp'");
- exec('postfix reload');
- $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3", "protocols = imap pop3 lmtp");
- exec($conf['init_scripts'] . '/' . 'dovecot restart');
- }
- }
- else {
- // If dovecot switch to dovecot
- if($app->system->is_installed('dovecot')) {
- exec("postconf -e 'virtual_transport = dovecot'");
- exec('postfix reload');
- $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3 lmtp", "protocols = imap pop3");
- exec($conf['init_scripts'] . '/' . 'dovecot restart');
+ if($app->system->is_installed('dovecot')) {
+ if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') {
+ $temp = exec("postconf -n virtual_transport", $out);
+ // If dovecot switch to lmtp
+ if($out[0] != "virtual_transport = lmtp:unix:private/dovecot-lmtp" {
+ exec("postconf -e 'virtual_transport = lmtp:unix:private/dovecot-lmtp'");
+ exec('postfix reload');
+ $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3", "protocols = imap pop3 lmtp");
+ exec($conf['init_scripts'] . '/' . 'dovecot restart');
+ }
+ } else {
+ // If dovecot switch to dovecot
+ if($out[0] != "virtual_transport = dovecot" {
+ exec("postconf -e 'virtual_transport = dovecot'");
+ exec('postfix reload');
+ $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3 lmtp", "protocols = imap pop3");
+ exec($conf['init_scripts'] . '/' . 'dovecot restart');
}
}
- exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'");
- exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'");
+ exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'"); //TODO : no reload?
+ exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'"); //TODO : no reload?
+
}
--
Gitblit v1.9.1