From 157ae0dab32e834ebc7edd16bc529c7161b9ceb0 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 27 Jan 2020 12:19:27 +0500 Subject: [PATCH] bug fix: dovecot --- install/email-configs-one/dovecot.conf | 13 +++++++++++++ install/email-configs/dovecot.conf | 13 +++++++++++++ plogical/processUtilities.py | 2 +- plogical/upgrade.py | 26 ++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/install/email-configs-one/dovecot.conf b/install/email-configs-one/dovecot.conf index 8341883a6..9ec4b1a1c 100755 --- a/install/email-configs-one/dovecot.conf +++ b/install/email-configs-one/dovecot.conf @@ -68,4 +68,17 @@ plugin { zlib_save = gz zlib_save_level = 6 +} + +service stats { + unix_listener stats-reader { + user = vmail + group = vmail + mode = 0660 + } + unix_listener stats-writer { + user = vmail + group = vmail + mode = 0660 + } } \ No newline at end of file diff --git a/install/email-configs/dovecot.conf b/install/email-configs/dovecot.conf index b71bc85eb..a7694b6ed 100755 --- a/install/email-configs/dovecot.conf +++ b/install/email-configs/dovecot.conf @@ -69,4 +69,17 @@ plugin { zlib_save = gz zlib_save_level = 6 +} + +service stats { + unix_listener stats-reader { + user = vmail + group = vmail + mode = 0660 + } + unix_listener stats-writer { + user = vmail + group = vmail + mode = 0660 + } } \ No newline at end of file diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 8ae5691ed..7bf29cb21 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -192,7 +192,7 @@ class ProcessUtilities(multi.Thread): else: command = '%s-u %s %s' % (ProcessUtilities.token, user, command) command = command.replace('sudo', '') - #logging.writeToFile(ProcessUtilities.token + command) + #logging.writeToFile(command) sock.sendall(command.encode('utf-8')) data = "" diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 5a29bcd7c..f0208464b 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1923,6 +1923,32 @@ failovermethod=priority command = "systemctl restart dovecot" Upgrade.executioner(command, 0) + dovecotConf = '/etc/dovecot/dovecot.conf' + + dovecotContent = open(dovecotConf, 'r').read() + + if dovecotContent.find('service stats') == -1: + writeToFile = open(dovecotConf, 'a') + + content = """\nservice stats { + unix_listener stats-reader { + user = vmail + group = vmail + mode = 0660 + } + unix_listener stats-writer { + user = vmail + group = vmail + mode = 0660 + } +}\n""" + + writeToFile.write(content) + writeToFile.close() + + command = 'systemctl restart dovecot' + Upgrade.executioner(command, command, 0) + Upgrade.stdOut("Dovecot upgraded.") except BaseException as msg: