From aac4d536143169243a1a121e2f880b58de2ba6fd Mon Sep 17 00:00:00 2001 From: fpiccinali Date: Sat, 24 Oct 2015 19:15:08 +0200 Subject: [PATCH 1/8] documentation about --debug --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 71cd68b..69507cf 100644 --- a/README.rst +++ b/README.rst @@ -23,3 +23,5 @@ By default, the following components are installed: * Postfix * Dovecot * Amavis (with SpamAssassin and ClamAV) + +If you want to follow details of installation process, use --debug From a2a948d3da75b000aac89738aaf9208196e98fdb Mon Sep 17 00:00:00 2001 From: fpiccinali Date: Sun, 25 Oct 2015 06:22:43 +0100 Subject: [PATCH 2/8] mend --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index 69507cf..9607224 100644 --- a/README.rst +++ b/README.rst @@ -25,3 +25,9 @@ By default, the following components are installed: * Amavis (with SpamAssassin and ClamAV) If you want to follow details of installation process, use --debug + +At the end of the process, you should consider updating virus database with this command: +```` +freshclam +/etc/init.d/clamav-daemon restart +```` From bbc2874adea2caa4c6c0a557b8797bf995dd3d18 Mon Sep 17 00:00:00 2001 From: fpiccinali Date: Sun, 25 Oct 2015 06:22:43 +0100 Subject: [PATCH 3/8] mise en page --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 69507cf..cdee5c6 100644 --- a/README.rst +++ b/README.rst @@ -25,3 +25,10 @@ By default, the following components are installed: * Amavis (with SpamAssassin and ClamAV) If you want to follow details of installation process, use --debug + +At the end of the process, you should consider updating virus database with this command: + +``` +freshclam +/etc/init.d/clamav-daemon restart +``` From aa0732b7805ebcf2cd094b2b4bd6688a01ed561b Mon Sep 17 00:00:00 2001 From: fpiccinali Date: Sun, 25 Oct 2015 06:28:10 +0100 Subject: [PATCH 4/8] mise en page --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index a66c932..cdee5c6 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,6 @@ If you want to follow details of installation process, use --debug At the end of the process, you should consider updating virus database with this command: - ``` freshclam /etc/init.d/clamav-daemon restart From 7dceb6c0a4b70274a94ab894f6fb51f744fbf616 Mon Sep 17 00:00:00 2001 From: Fabrice Piccinali Date: Sun, 25 Oct 2015 06:32:04 +0100 Subject: [PATCH 5/8] mise en page --- README.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index cdee5c6..61ce1c0 100644 --- a/README.rst +++ b/README.rst @@ -26,9 +26,7 @@ By default, the following components are installed: If you want to follow details of installation process, use --debug -At the end of the process, you should consider updating virus database with this command: +At the end of the process, you should consider updating virus database with this command:: -``` -freshclam -/etc/init.d/clamav-daemon restart -``` + freshclam + /etc/init.d/clamav-daemon restart From bd86aa65442f1e8647349c9b2783db4b697e920d Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Mon, 26 Oct 2015 07:46:39 +0100 Subject: [PATCH 6/8] Do not forget to use the password. see #1 --- installer.cfg | 3 ++- modoboa_installer/scripts/modoboa.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/installer.cfg b/installer.cfg index b415532..462b490 100644 --- a/installer.cfg +++ b/installer.cfg @@ -4,7 +4,8 @@ tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem [database] # Select database engine : postgres or mysql -engine = postgres +#engine = postgres +engine = mysql host = 127.0.0.1 install = true diff --git a/modoboa_installer/scripts/modoboa.py b/modoboa_installer/scripts/modoboa.py index 59e0f45..145ea51 100644 --- a/modoboa_installer/scripts/modoboa.py +++ b/modoboa_installer/scripts/modoboa.py @@ -104,7 +104,8 @@ class Modoboa(base.Installer): "INSERT INTO lib_parameter (name, value) VALUES ('{0}', '{1}')" .format(name, value) ) - self.backend._exec_query(query, self.dbname, self.dbuser) + self.backend._exec_query( + query, self.dbname, self.dbuser, self.dbpasswd) def post_run(self): """Additional tasks.""" From e9f825f70bf06f44057112a95929cad9f3b4ea7e Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Mon, 26 Oct 2015 08:20:30 +0100 Subject: [PATCH 7/8] Fix for postgres. see #1 --- installer.cfg | 4 ++-- modoboa_installer/database.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/installer.cfg b/installer.cfg index 462b490..0b181d6 100644 --- a/installer.cfg +++ b/installer.cfg @@ -4,8 +4,8 @@ tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem [database] # Select database engine : postgres or mysql -#engine = postgres -engine = mysql +engine = postgres +#engine = mysql host = 127.0.0.1 install = true diff --git a/modoboa_installer/database.py b/modoboa_installer/database.py index eddc7b3..f325617 100644 --- a/modoboa_installer/database.py +++ b/modoboa_installer/database.py @@ -45,6 +45,7 @@ class PostgreSQL(Database): """Exec a postgresql query.""" cmd = "psql" if dbname and dbuser: + self._setup_pgpass(dbname, dbuser, dbpassword) cmd += " -h {} -d {} -U {} -w".format(self.dbhost, dbname, dbuser) utils.exec_cmd( """{} -c "{}" """.format(cmd, query), sudo_user=self.dbuser) From 2e4e1a9d63f37e50b5dae35edf9747aa24d4717b Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Mon, 26 Oct 2015 21:45:24 +0100 Subject: [PATCH 8/8] Generate maps only for compatible extensions. see #1 --- modoboa_installer/scripts/postfix.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modoboa_installer/scripts/postfix.py b/modoboa_installer/scripts/postfix.py index 35746d0..382a19f 100644 --- a/modoboa_installer/scripts/postfix.py +++ b/modoboa_installer/scripts/postfix.py @@ -48,8 +48,14 @@ class Postfix(base.Installer): self.dbengine, self.config.get("modoboa", "dbuser"), self.config.get("modoboa", "dbpassword"), self.dbhost, self.config.get("modoboa", "dbname")) + extensions = self.config.get("modoboa", "extensions") + exts_with_maps = ["modoboa-admin", "modoboa-admin-relaydomains", + "modoboa-postfix-autoreply"] + extensions = [ext for ext in exts_with_maps if ext in extensions] + if not extensions: + return cmd = ( - "{} {} postfix_maps --dbtype {} --extensions all --dburl {} {}" - .format(python_path, script_path, self.dbengine, db_url, - self.config_dir)) + "{} {} postfix_maps --dbtype {} --extensions {} --dburl {} {}" + .format(python_path, script_path, self.dbengine, + " ".join(extensions), db_url, self.config_dir)) utils.exec_cmd(cmd)