@@ -23,3 +23,10 @@ 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
|
||||
|
||||
At the end of the process, you should consider updating virus database with this command::
|
||||
|
||||
freshclam
|
||||
/etc/init.d/clamav-daemon restart
|
||||
|
||||
@@ -5,6 +5,7 @@ tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
[database]
|
||||
# Select database engine : postgres or mysql
|
||||
engine = postgres
|
||||
#engine = mysql
|
||||
host = 127.0.0.1
|
||||
install = true
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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."""
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user