diff --git a/README.rst b/README.rst index 71cd68b..61ce1c0 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/modoboa_installer/scripts/dovecot.py b/modoboa_installer/scripts/dovecot.py index 36dc586..9bbf8b9 100644 --- a/modoboa_installer/scripts/dovecot.py +++ b/modoboa_installer/scripts/dovecot.py @@ -50,20 +50,19 @@ class Dovecot(base.Installer): def post_run(self): """Additional tasks.""" - if self.dbengine != "postgres": - return - dbname = self.config.get("modoboa", "dbname") - dbuser = self.config.get("modoboa", "dbuser") - dbpassword = self.config.get("modoboa", "dbpassword") - backend = database.get_backend(self.config) - backend.load_sql_file( - dbname, dbuser, dbpassword, - self.get_file_path("install_modoboa_postgres_trigger.sql") - ) - backend.load_sql_file( - dbname, dbuser, dbpassword, - self.get_file_path("fix_modoboa_postgres_schema.sql") - ) + if self.dbengine == "postgres": + dbname = self.config.get("modoboa", "dbname") + dbuser = self.config.get("modoboa", "dbuser") + dbpassword = self.config.get("modoboa", "dbpassword") + backend = database.get_backend(self.config) + backend.load_sql_file( + dbname, dbuser, dbpassword, + self.get_file_path("install_modoboa_postgres_trigger.sql") + ) + backend.load_sql_file( + dbname, dbuser, dbpassword, + self.get_file_path("fix_modoboa_postgres_schema.sql") + ) for f in glob.glob("{}/*".format(self.get_file_path("conf.d"))): shutil.copy(f, "{}/conf.d".format(self.config_dir)) diff --git a/modoboa_installer/scripts/files/amavis/amavis_mysql_2.10.1.sql b/modoboa_installer/scripts/files/amavis/amavis_mysql_2.10.1.sql index 0cb3d82..a7f2d3c 100644 --- a/modoboa_installer/scripts/files/amavis/amavis_mysql_2.10.1.sql +++ b/modoboa_installer/scripts/files/amavis/amavis_mysql_2.10.1.sql @@ -162,7 +162,8 @@ CREATE TABLE msgs ( subject varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '', -- mail Subject header field, UTF8 host varchar(255) NOT NULL, -- hostname where amavisd is running - PRIMARY KEY (partition_tag,mail_id) + PRIMARY KEY (partition_tag,mail_id), + INDEX (mail_id), FOREIGN KEY (sid) REFERENCES maddr(id) ON DELETE RESTRICT ) ENGINE=InnoDB; CREATE INDEX msgs_idx_sid ON msgs (sid); @@ -191,7 +192,7 @@ CREATE TABLE msgrcpt ( wl char(1) DEFAULT ' ', -- sender whitelisted by this recip bspam_level float, -- per-recipient (total) spam level smtp_resp varchar(255) DEFAULT '', -- SMTP response given to MTA - PRIMARY KEY (partition_tag,mail_id,rseqnum) + PRIMARY KEY (partition_tag,mail_id,rseqnum), FOREIGN KEY (rid) REFERENCES maddr(id) ON DELETE RESTRICT, FOREIGN KEY (mail_id) REFERENCES msgs(mail_id) ON DELETE CASCADE ) ENGINE=InnoDB; @@ -208,7 +209,7 @@ CREATE TABLE quarantine ( mail_id varbinary(16) NOT NULL, -- long-term unique mail id chunk_ind integer unsigned NOT NULL, -- chunk number, starting with 1 mail_text blob NOT NULL, -- store mail as chunks of octets - PRIMARY KEY (partition_tag,mail_id,chunk_ind) + PRIMARY KEY (partition_tag,mail_id,chunk_ind), FOREIGN KEY (mail_id) REFERENCES msgs(mail_id) ON DELETE CASCADE ) ENGINE=InnoDB; diff --git a/modoboa_installer/scripts/files/amavis/amavis_mysql_2.7.1.sql b/modoboa_installer/scripts/files/amavis/amavis_mysql_2.7.1.sql index 710d290..4b6bc23 100644 --- a/modoboa_installer/scripts/files/amavis/amavis_mysql_2.7.1.sql +++ b/modoboa_installer/scripts/files/amavis/amavis_mysql_2.7.1.sql @@ -165,6 +165,7 @@ CREATE TABLE msgs ( -- mail Subject header field, UTF8 host varchar(255) NOT NULL, -- hostname where amavisd is running PRIMARY KEY (partition_tag,mail_id), + INDEX (mail_id), FOREIGN KEY (sid) REFERENCES maddr(id) ON DELETE RESTRICT ) ENGINE=InnoDB; CREATE INDEX msgs_idx_sid ON msgs (sid);