From ec00e9d17e5bbb8e8ec553db21800bc0decf1f19 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 29 Sep 2022 23:06:53 +0800 Subject: [PATCH] Update index.py --- plugins/imail/index.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/imail/index.py b/plugins/imail/index.py index f259259ed..bfe6fae9c 100755 --- a/plugins/imail/index.py +++ b/plugins/imail/index.py @@ -47,6 +47,20 @@ class App: return tmp + def __release_port(self, port): + from collections import namedtuple + try: + import firewall_api + firewall_api.firewall_api().addAcceptPortArgs(port, 'Mail-Server', 'port') + return port + except Exception as e: + return "Release failed {}".format(e) + + def openPort(self): + for i in ["25", "110", "143", "465", "995", "993", "587"]: + self.__release_port(i) + return True + def getPluginName(self): return 'imail' @@ -101,6 +115,8 @@ class App: initD_path = self.getServerDir() + '/init.d' if not os.path.exists(initD_path): os.mkdir(initD_path) + self.openPort() + file_bin = initD_path + '/' + self.getPluginName() if not os.path.exists(file_bin):