Commit ca2e5b4f authored by Marius Burkard's avatar Marius Burkard
Browse files

- added --use-amavis to use Amavisd-new instead of rspamd on installation

parent c445a1d6
......@@ -154,6 +154,14 @@ class ISPConfig {
}
}
public static function wantsAmavis() {
if(isset($_GET['use-amavis']) && $_GET['use-amavis']) {
return true;
} else {
return false;
}
}
public static function getISPConfigChannel() {
if(isset($_GET['channel']) && $_GET['channel']) {
return $_GET['channel'];
......@@ -184,6 +192,7 @@ Possible arguments are:
--lang ->Use language for ISPConfig installation. Specify with --lang=en|de (only en (English) and de (German) supported currently).
--interactive ->Don\'t install ISPConfig in non-interactive mode. This is needed if you want to use expert mode, e. g. to install a slave server that shall be integrated into an existing multiserver setup.
--use-nginx ->Use nginx webserver instead of apache2
--use-amavis ->Use amavis instead of rspamd for mail filtering
--no-web ->Do not use ISPConfig on this server to manage webserver setting and don\'t install nginx/apache or pureftpd. This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma
--no-mail ->Do not use ISPConfig on this server to manage mailserver settings. This will install postfix for sending system mails, but not dovecot and not configure any settings for ISPConfig mail. It implies --no-mailman.
--no-dns ->Do not use ISPConfig on this server to manage DNS entries. Bind will be installed for local DNS caching / resolving only.
......@@ -207,7 +216,7 @@ Possible arguments are:
$valid_args = array(
'help', 'debug', 'interactive',
'use-nginx', 'channel', 'lang',
'use-nginx', 'use-amavis', 'channel', 'lang',
'no-web', 'no-mail', 'no-dns', 'no-firewall', 'no-roundcube', 'no-pma', 'no-mailman',
'i-know-what-i-am-doing'
);
......@@ -254,8 +263,8 @@ Possible arguments are:
exit;
}
if(!isset($_GET['channel']) || $_GET['channel'] !== 'dev') {
ISPConfigLog::info('<lightred>NOTE:</lightred> Installing ISPConfig stable is not supported until 3.1.15 release (due to rspamd support). Please use --channel=dev to install stable-3.1 git development branch.', true);
if(!self::wantsAmavis() && (!isset($_GET['channel']) || $_GET['channel'] !== 'dev')) {
ISPConfigLog::info('<lightred>NOTE:</lightred> Installing ISPConfig stable with rspamd is not supported until 3.1.15 release (due to rspamd support). Please use --channel=dev to install stable-3.1 git development branch or --use-amavis to use amavis instead of rspamd.', true);
exit;
}
......
......@@ -125,8 +125,12 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
if(ISPConfig::shallInstall('mail')) {
$packages[] = 'spamassassin';
$packages[] = 'rspamd';
$packages[] = 'redis-server';
if(ISPConfig::wantsAmavis()) {
$packages[] = 'amavisd-new';
} else {
$packages[] = 'rspamd';
$packages[] = 'redis-server';
}
$packages[] = 'postgrey';
}
}
......@@ -286,6 +290,7 @@ maxretry = 3';
$package = 'mailman';
$this->installPackages($package);
$listpw = '';
if(!is_dir('/var/lib/mailman/lists/mailman')) {
$listpw = ISPConfigFunctions::generatePassword(12);
$cmd = 'newlist -q -e ' . escapeshellarg($host_name) . ' mailman ' . escapeshellarg('root@' . $host_name) . ' ' . escapeshellarg($listpw);
......@@ -397,7 +402,7 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
);
$this->installPackages($packages);
if(ISPConfig::shallInstall('mail')) {
if(ISPConfig::shallInstall('mail') && !ISPConfig::wantsAmavis()) {
ISPConfigLog::info('Activating rspamd repository.', true);
$cmd = 'wget -O - "https://rspamd.com/apt-stable/gpg.key" 2>/dev/null | apt-key add - 2>/dev/null ; echo "deb http://rspamd.com/apt-stable/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/rspamd.list';
$result = $this->exec($cmd);
......@@ -652,7 +657,7 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
$packages = $this->getPackagesToInstall('mail');
$this->installPackages($packages);
if(ISPConfig::shallInstall('mail')) {
if(ISPConfig::shallInstall('mail') && !ISPConfig::wantsAmavis()) {
ISPConfigLog::info('Stopping Rspamd.', true);
$this->stopService('rspamd');
}
......@@ -1073,7 +1078,11 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
$this->restartService('clamav-daemon');
if(ISPConfig::shallInstall('mail')) {
$this->startService('rspamd');
if(ISPConfig::wantsAmavis()) {
$this->restartService('amavis');
} else {
$this->startService('rspamd');
}
}
......@@ -1089,8 +1098,12 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
$check_services[] = 'apache2';
}
if(ISPConfig::shallInstall('mail')) {
$check_services[] = 'rspamd';
$check_services[] = 'redis-server';
if(!ISPConfig::wantsAmavis()) {
$check_services[] = 'rspamd';
$check_services[] = 'redis-server';
} else {
$check_services[] = 'amavis';
}
$check_services[] = 'dovecot';
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment