Ernesto Nicolás Carrea 5 лет назад
Родитель
Сommit
b005e414d0

+ 1 - 1
bin/hestia

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 
 HESTIA_BIN=$HESTIA/bin
 HESTIA_BIN=$HESTIA/bin
 [ "$HESTIA_DEBUG" ] && OSAL_DEBUG=1
 [ "$HESTIA_DEBUG" ] && OSAL_DEBUG=1

+ 2 - 2
bin/module/clamav/exim-integration/disable.inc

@@ -1,6 +1,6 @@
 #!/bin/sh
 #!/bin/sh
 
 
-hestia_module_clamav_setup-exim() {
+hestia_module_clamav_exim-integration_disable() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
 
 
     module_installed=$(hestia_module_isinstalled mta)
     module_installed=$(hestia_module_isinstalled mta)
@@ -17,7 +17,7 @@ hestia_module_clamav_setup-exim() {
 
 
     echo "Disabling Exim-ClamAV integration..."
     echo "Disabling Exim-ClamAV integration..."
 
 
-    /usr/bin/sed -i "/CLAMD/ s/^/#/" $OSAL_PATH_EXIM_CONF/exim4.conf.template
+    /usr/bin/sed -i "/CLAMD/ s/^/#/" $OSAL_PATH_EXIM_CONF/${OSAL_PKG_EXIM}.conf.template
 
 
     # FIXME: how do we rebuild exim.conf? 
     # FIXME: how do we rebuild exim.conf? 
 }
 }

+ 3 - 3
bin/module/clamav/exim-integration/enable.inc

@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
 
 
-hestia_module_clamav_setup-exim() {
+hestia_module_clamav_exim-integration_enable() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
 
 
     module_installed=$(hestia_module_isinstalled mta)
     module_installed=$(hestia_module_isinstalled mta)
@@ -17,7 +17,7 @@ hestia_module_clamav_setup-exim() {
 
 
     echo "Enabling Exim-ClamAV integration..."
     echo "Enabling Exim-ClamAV integration..."
 
 
-    /usr/bin/sed -i "/CLAMD/ s/#*//" $OSAL_PATH_EXIM_CONF/exim4.conf.template
+    /usr/bin/sed -i "/CLAMD/ s/#*//" $OSAL_PATH_EXIM_CONF/${OSAL_PKG_EXIM}.conf.template
 
 
     gpasswd -a clamav mail > /dev/null 2>&1
     gpasswd -a clamav mail > /dev/null 2>&1
     gpasswd -a clamav $OSAL_USER_EXIM > /dev/null 2>&1
     gpasswd -a clamav $OSAL_USER_EXIM > /dev/null 2>&1

+ 15 - 16
bin/module/clamav/install.inc

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 
 hestia_module_clamav_install() {
 hestia_module_clamav_install() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
@@ -9,19 +9,16 @@ hestia_module_clamav_install() {
         exit 1
         exit 1
     fi
     fi
 
 
-    echo "Installing Antivirus (ClamAV) module..."
+    echo "Installing antivirus (ClamAV) module..."
 
 
-    osal_service_stop $OSAL_SERVICE_CLAMAV
-    hestia_config_backup 'clamav-install' $OSAL_PATH_CLAMAV_CONF
+    osal_service_stop $OSAL_SERVICE_CLAMAV > /dev/null 2>&1
+    hestia_config_backup 'clamav-install' $OSAL_PATH_CLAMAV_CONF $OSAL_PATH_CLAMAV_CONF_D
 
 
     osal_package_preinstall
     osal_package_preinstall
     osal_package_install $OSAL_PKG_CLAMAV
     osal_package_install $OSAL_PKG_CLAMAV
 
 
     cp -f $HESTIA_INSTALL_DIR/clamav/clamd.conf $OSAL_PATH_CLAMAV_CONF
     cp -f $HESTIA_INSTALL_DIR/clamav/clamd.conf $OSAL_PATH_CLAMAV_CONF
 
 
-    mkdir -p /var/log/clamav /var/run/clamav
-    chown -R clamav:clamav /var/log/clamav /var/run/clamav
-
     if [ $OS_BASE = 'debian' ]; then
     if [ $OS_BASE = 'debian' ]; then
         # FIXME: Why do we do this?
         # FIXME: Why do we do this?
         if [ -e "/lib/systemd/system/clamav-daemon.service" ]; then
         if [ -e "/lib/systemd/system/clamav-daemon.service" ]; then
@@ -33,24 +30,21 @@ hestia_module_clamav_install() {
         fi
         fi
     elif [ $OS_BASE = 'rhel' ]; then
     elif [ $OS_BASE = 'rhel' ]; then
         # Setup freshclam
         # Setup freshclam
-        useradd clamav -g clamupdate -s /sbin/nologin -d /var/lib/clamav 2>/dev/null
+        groupadd clamav 2>/dev/null
+        useradd clamav -g clamav -s /sbin/nologin -d /var/lib/clamav 2>/dev/null
         cp -f $HESTIA_INSTALL_DIR/clamav/freshclam.conf /etc/
         cp -f $HESTIA_INSTALL_DIR/clamav/freshclam.conf /etc/
-        chown clamav:clamupdate /var/log/clamav /var/run/clamav
-        chown -R clamav:clamupdate /var/lib/clamav
-        chmod 0775 /var/lib/clamav /var/log/clamav
     fi
     fi
 
 
+    mkdir -p /var/log/clamav /var/run/clamav
+    chown -R $OSAL_USER_CLAMAV:$OSAL_USER_CLAMAV /var/log/clamav /var/run/clamav
+
+    echo "Updating virus database..."
     osal_execute_with_spinner /usr/bin/freshclam
     osal_execute_with_spinner /usr/bin/freshclam
 
 
     osal_service_enable $OSAL_SERVICE_CLAMAV
     osal_service_enable $OSAL_SERVICE_CLAMAV
     osal_service_start $OSAL_SERVICE_CLAMAV
     osal_service_start $OSAL_SERVICE_CLAMAV
     check_result $? "ClamAV start failed"
     check_result $? "ClamAV start failed"
 
 
-    exim_installed=$(hestia_module_variant_installed 'mta' 'exim')
-    if [ "$exim_installed" ]; then
-        hestia module clamav exim-integration enable
-    fi
-
     osal_kv_write $HESTIA/conf/hestia.conf 'ANTIVIRUS_SYSTEM' 'clamav-daemon'
     osal_kv_write $HESTIA/conf/hestia.conf 'ANTIVIRUS_SYSTEM' 'clamav-daemon'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'installed' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'installed' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'description' 'Hestia Antivirus (ClamAV) module'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'description' 'Hestia Antivirus (ClamAV) module'
@@ -58,4 +52,9 @@ hestia_module_clamav_install() {
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'variant' 'clamav'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'variant' 'clamav'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'version' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'version' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'service_name' $OSAL_SERVICE_CLAMAV
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'service_name' $OSAL_SERVICE_CLAMAV
+
+    exim_installed=$(hestia_module_variant_installed 'mta' 'exim')
+    if [ "$exim_installed" ]; then
+        hestia module clamav exim-integration enable
+    fi
 }
 }

+ 10 - 12
bin/module/clamav/remove.inc

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 
 hestia_module_clamav_remove() {
 hestia_module_clamav_remove() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
@@ -17,19 +17,19 @@ hestia_module_clamav_remove() {
 
 
     echo "Removing antivirus (ClamAV) module..."
     echo "Removing antivirus (ClamAV) module..."
 
 
-    osal_service_stop $OSAL_SERVICE_CLAMAV
-    osal_service_disable $OSAL_SERVICE_CLAMAV
-
-    hestia_config_backup 'clamav-remove' $OSAL_PATH_CLAMAV_CONF
-
-    rm -rf $OSAL_PATH_CLAMAV_CONF
-
-    exim_installed=$(hestia_module_variant_installed 'antivirus' 'exim')
+    exim_installed=$(hestia_module_variant_installed 'mta' 'exim')
     if [ "$exim_installed" ]; then
     if [ "$exim_installed" ]; then
         hestia module clamav exim-integration disable
         hestia module clamav exim-integration disable
     fi
     fi
 
 
-    osal_package_remove $OSAL_PKG_EXIM
+    osal_service_stop $OSAL_SERVICE_CLAMAV > /dev/null 2>&1
+    osal_service_disable $OSAL_SERVICE_CLAMAV > /dev/null 2>&1
+
+    hestia_config_backup 'clamav-remove' $OSAL_PATH_CLAMAV_CONF $OSAL_PATH_CLAMAV_CONF_D
+
+    rm -rf $OSAL_PATH_CLAMAV_CONF $OSAL_PATH_CLAMAV_CONF_D
+
+    osal_package_remove $OSAL_PKG_CLAMAV
 
 
     osal_kv_write $HESTIA/conf/hestia.conf 'ANTIVIRUS_SYSTEM' 'no'
     osal_kv_write $HESTIA/conf/hestia.conf 'ANTIVIRUS_SYSTEM' 'no'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'installed' '0'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'installed' '0'
@@ -37,6 +37,4 @@ hestia_module_clamav_remove() {
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'enabled' '0'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'enabled' '0'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'variant' ''
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'variant' ''
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'version' '0'
     osal_kv_write $HESTIA_CONF_MODULES/antivirus.conf 'version' '0'
-
-    exit 0
 }
 }

+ 1 - 1
bin/module/dovecot/install.inc

@@ -11,7 +11,7 @@ hestia_module_dovecot_install() {
 
 
     echo "Installing IMAP (Dovecot) module..."
     echo "Installing IMAP (Dovecot) module..."
 
 
-    osal_service_stop $OSAL_SERVICE_DOVECOT
+    osal_service_stop $OSAL_SERVICE_DOVECOT > /dev/null 2>&1
     hestia_config_backup 'dovecot-install' $OSAL_PATH_DOVECOT_CONF
     hestia_config_backup 'dovecot-install' $OSAL_PATH_DOVECOT_CONF
 
 
     osal_package_preinstall
     osal_package_preinstall

+ 2 - 2
bin/module/dovecot/remove.inc

@@ -17,8 +17,8 @@ hestia_module_dovecot_remove() {
 
 
     echo "Removing IMAP (Dovecot) module..."
     echo "Removing IMAP (Dovecot) module..."
 
 
-    osal_service_stop $OSAL_SERVICE_DOVECOT
-    osal_service_disable $OSAL_SERVICE_DOVECOT
+    osal_service_stop $OSAL_SERVICE_DOVECOT > /dev/null 2>&1
+    osal_service_disable $OSAL_SERVICE_DOVECOT > /dev/null 2>&1
 
 
     hestia_config_backup 'dovecot-remove' $OSAL_PATH_DOVECOT_CONF
     hestia_config_backup 'dovecot-remove' $OSAL_PATH_DOVECOT_CONF
     rm -rf $OSAL_PATH_DOVECOT_CONF
     rm -rf $OSAL_PATH_DOVECOT_CONF

+ 14 - 24
bin/module/exim/install.inc

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 
 hestia_module_exim_install() {
 hestia_module_exim_install() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
@@ -11,7 +11,7 @@ hestia_module_exim_install() {
 
 
     echo "Installing MTA (Exim) module..."
     echo "Installing MTA (Exim) module..."
 
 
-    osal_service_stop $OSAL_SERVICE_EXIM
+    osal_service_stop $OSAL_SERVICE_EXIM > /dev/null 2>&1
     hestia_config_backup 'exim-install' $OSAL_PATH_EXIM_CONF
     hestia_config_backup 'exim-install' $OSAL_PATH_EXIM_CONF
 
 
     osal_package_preinstall
     osal_package_preinstall
@@ -23,14 +23,6 @@ hestia_module_exim_install() {
     cp -f $HESTIA_INSTALL_DIR/exim/spam-blocks.conf $OSAL_PATH_EXIM_CONF/
     cp -f $HESTIA_INSTALL_DIR/exim/spam-blocks.conf $OSAL_PATH_EXIM_CONF/
     touch $OSAL_PATH_EXIM_CONF/white-blocks.conf
     touch $OSAL_PATH_EXIM_CONF/white-blocks.conf
 
 
-    // TODO: move to clamd and spamd installers
-    #if [ "$spamd" = 'yes' ]; then
-    #    sed -i "s/#SPAM/SPAM/g" /etc/exim4/exim4.conf.template
-    #fi
-    #if [ "$clamd" = 'yes' ]; then
-    #    sed -i "s/#CLAMD/CLAMD/g" /etc/exim4/exim4.conf.template
-    #fi
-
     chmod 640 $OSAL_PATH_EXIM_CONF/${OSAL_PKG_EXIM}.conf.template
     chmod 640 $OSAL_PATH_EXIM_CONF/${OSAL_PKG_EXIM}.conf.template
     rm -rf $OSAL_PATH_EXIM_CONF/domains
     rm -rf $OSAL_PATH_EXIM_CONF/domains
     mkdir -p $OSAL_PATH_EXIM_CONF/domains
     mkdir -p $OSAL_PATH_EXIM_CONF/domains
@@ -38,15 +30,23 @@ hestia_module_exim_install() {
     rm -f /etc/alternatives/mta
     rm -f /etc/alternatives/mta
     ln -s /usr/sbin/$OSAL_PKG_EXIM /etc/alternatives/mta
     ln -s /usr/sbin/$OSAL_PKG_EXIM /etc/alternatives/mta
     
     
-    osal_service_stop sendmail
-    osal_service_disable sendmail
-    osal_service_stop postfix
-    osal_service_disable postfix
+    osal_service_stop sendmail > /dev/nul 2>&1
+    osal_service_disable sendmail > /dev/nul 2>&1
+    osal_service_stop postfix > /dev/nul 2>&1
+    osal_service_disable postfix > /dev/nul 2>&1
 
 
     osal_service_enable $OSAL_SERVICE_EXIM
     osal_service_enable $OSAL_SERVICE_EXIM
     osal_service_start $OSAL_SERVICE_EXIM
     osal_service_start $OSAL_SERVICE_EXIM
     check_result $? "Exim start failed"
     check_result $? "Exim start failed"
 
 
+    osal_kv_write $HESTIA/conf/hestia.conf 'MAIL_SYSTEM' 'exim'
+    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'installed' '1'
+    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'description' 'Hestia MTA (Exim) module'
+    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'enabled' '1'
+    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'variant' 'exim'
+    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'version' '1'
+    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'service_name' $OSAL_PKG_EXIM
+
     clamav_installed=$(hestia_module_variant_installed 'antivirus' 'clamav')
     clamav_installed=$(hestia_module_variant_installed 'antivirus' 'clamav')
     if [ "$clamav_installed" ]; then
     if [ "$clamav_installed" ]; then
         hestia module clamav exim-integration enable
         hestia module clamav exim-integration enable
@@ -56,14 +56,4 @@ hestia_module_exim_install() {
     if [ "$spamassassin_installed" ]; then
     if [ "$spamassassin_installed" ]; then
         hestia module spamassassin exim-integration enable
         hestia module spamassassin exim-integration enable
     fi
     fi
-
-    osal_kv_write $HESTIA/conf/hestia.conf 'MAIL_SYSTEM' 'exim'
-    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'installed' '1'
-    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'description' 'Hestia MTA (Exim) module'
-    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'enabled' '1'
-    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'variant' 'exim'
-    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'version' '1'
-    osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'service_name' $OSAL_PKG_EXIM
-
-    exit 0
 }
 }

+ 11 - 3
bin/module/exim/remove.inc

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 
 hestia_module_exim_remove() {
 hestia_module_exim_remove() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
@@ -24,12 +24,20 @@ hestia_module_exim_remove() {
 
 
     osal_package_remove $OSAL_PKG_EXIM
     osal_package_remove $OSAL_PKG_EXIM
 
 
+    clamav_installed=$(hestia_module_variant_installed 'antivirus' 'clamav')
+    if [ "$clamav_installed" ]; then
+        hestia module clamav exim-integration disable
+    fi
+
+    spamassassin_installed=$(hestia_module_variant_installed 'antispam' 'spamassassin')
+    if [ "$spamassassin_installed" ]; then
+        hestia module spamassassin exim-integration disable
+    fi
+
     osal_kv_write $HESTIA/conf/hestia.conf 'MAIL_SYSTEM' 'no'
     osal_kv_write $HESTIA/conf/hestia.conf 'MAIL_SYSTEM' 'no'
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'installed' '0'
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'installed' '0'
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'description' ''
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'description' ''
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'enabled' '0'
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'enabled' '0'
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'variant' ''
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'variant' ''
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'version' '0'
     osal_kv_write $HESTIA_CONF_MODULES/mta.conf 'version' '0'
-
-    exit 0
 }
 }

+ 4 - 4
bin/module/spamassasin/exim-integration/disable.inc → bin/module/spamassassin/exim-integration/disable.inc

@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
 
 
-hestia_module_clamav_setup-exim() {
+hestia_module_spamassassin_exim-integration_disable() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
 
 
     module_installed=$(hestia_module_isinstalled mta)
     module_installed=$(hestia_module_isinstalled mta)
@@ -15,9 +15,9 @@ hestia_module_clamav_setup-exim() {
         exit 1
         exit 1
     fi
     fi
 
 
-    echo "Disabling SpamAssassin-ClamAV integration..."
+    echo "Disabling SpamAssassin-Exim integration..."
 
 
-    /usr/bin/sed -i "/SPAMASSASSIN/ s/^/#/" $OSAL_PATH_EXIM_CONF/exim4.conf.template
+    /usr/bin/sed -i "/SPAMASSASSIN/ s/^/#/" $OSAL_PATH_EXIM_CONF/${OSAL_PKG_EXIM}.conf.template
 
 
     # FIXME: how do we rebuild exim.conf? 
     # FIXME: how do we rebuild exim.conf? 
 }
 }

+ 4 - 4
bin/module/spamassasin/exim-integration/enable.inc → bin/module/spamassassin/exim-integration/enable.inc

@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
 
 
-hestia_module_clamav_setup-exim() {
+hestia_module_spamassassin_exim-integration_enable() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
 
 
     module_installed=$(hestia_module_isinstalled mta)
     module_installed=$(hestia_module_isinstalled mta)
@@ -15,9 +15,9 @@ hestia_module_clamav_setup-exim() {
         exit 1
         exit 1
     fi
     fi
 
 
-    echo "Enabling SpamAssassin-ClamAV integration..."
+    echo "Enabling SpamAssassin-Exim integration..."
 
 
-    /usr/bin/sed -i "/SPAMASSASSIN/ s/#*//" $OSAL_PATH_EXIM_CONF/exim4.conf.template
+    /usr/bin/sed -i "/SPAMASSASSIN/ s/#*//" $OSAL_PATH_EXIM_CONF/${OSAL_PKG_EXIM}.conf.template
 
 
     # FIXME: how do we rebuild exim.conf? 
     # FIXME: how do we rebuild exim.conf? 
 }
 }

+ 9 - 9
bin/module/spamassasin/install.inc → bin/module/spamassassin/install.inc

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 
 hestia_module_spamassassin_install() {
 hestia_module_spamassassin_install() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
@@ -11,7 +11,7 @@ hestia_module_spamassassin_install() {
 
 
     echo "Installing Antispam (SpamAssassin) module..."
     echo "Installing Antispam (SpamAssassin) module..."
 
 
-    osal_service_stop $OSAL_SERVICE_SPAMASSASSIN
+    osal_service_stop $OSAL_SERVICE_SPAMASSASSIN > /dev/null 2>&1
     hestia_config_backup 'spamassassin-install' $OSAL_PATH_SPAMASSASSIN_CONF
     hestia_config_backup 'spamassassin-install' $OSAL_PATH_SPAMASSASSIN_CONF
 
 
     osal_package_preinstall
     osal_package_preinstall
@@ -25,15 +25,10 @@ hestia_module_spamassassin_install() {
         fi
         fi
     fi
     fi
 
 
-    osal_service_enable $OSAL_SERVICE_SPAMASSASSIN
-    osal_service_start $OSAL_SERVICE_SPAMASSASSIN
+    osal_service_enable $OSAL_SERVICE_SPAMASSASSIN > /dev/null 2>&1
+    osal_service_start $OSAL_SERVICE_SPAMASSASSIN > /dev/null 2>&1
     check_result $? "SpamAssassin start failed"
     check_result $? "SpamAssassin start failed"
 
 
-    exim_installed=$(hestia_module_variant_installed 'mta' 'exim')
-    if [ "$exim_installed" ]; then
-        hestia module spamassassin exim-integration enable
-    fi
-
     osal_kv_write $HESTIA/conf/hestia.conf 'ANTISPAM_SYSTEM' 'spamassassin'
     osal_kv_write $HESTIA/conf/hestia.conf 'ANTISPAM_SYSTEM' 'spamassassin'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'installed' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'installed' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'description' 'Hestia Antispam (SpamAssassin) module'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'description' 'Hestia Antispam (SpamAssassin) module'
@@ -41,4 +36,9 @@ hestia_module_spamassassin_install() {
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'variant' 'spamassassin'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'variant' 'spamassassin'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'version' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'version' '1'
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'service_name' $OSAL_SERVICE_SPAMASSASSIN
     osal_kv_write $HESTIA_CONF_MODULES/antispam.conf 'service_name' $OSAL_SERVICE_SPAMASSASSIN
+
+    exim_installed=$(hestia_module_variant_installed 'mta' 'exim')
+    if [ "$exim_installed" ]; then
+        hestia module spamassassin exim-integration enable
+    fi
 }
 }

+ 7 - 7
bin/module/spamassasin/remove.inc → bin/module/spamassassin/remove.inc

@@ -1,6 +1,6 @@
 #!/bin/sh
 #!/bin/sh
 
 
-hestia_module_clamav_remove() {
+hestia_module_spamassassin_remove() {
     source $HESTIA/bin/module/func.inc
     source $HESTIA/bin/module/func.inc
 
 
     module_installed=$(hestia_module_isinstalled antispam)
     module_installed=$(hestia_module_isinstalled antispam)
@@ -10,23 +10,23 @@ hestia_module_clamav_remove() {
     fi
     fi
 
 
     module_variant=$(hestia_module_getvariant antispam)
     module_variant=$(hestia_module_getvariant antispam)
-    if [ "$module_variant" != 'clamav' ] && [ ! "$param_force" ]; then
+    if [ "$module_variant" != 'spamassassin' ] && [ ! "$param_force" ]; then
         echo "The installed antispam module is not SpamAssassin. See 'hestia module info antispam'."
         echo "The installed antispam module is not SpamAssassin. See 'hestia module info antispam'."
         exit 1
         exit 1
     fi
     fi
 
 
     echo "Removing antispam (SpamAssassin) module..."
     echo "Removing antispam (SpamAssassin) module..."
 
 
-    osal_service_stop $OSAL_SERVICE_SPAMASSASSIN
-    osal_service_disable $OSAL_SERVICE_SPAMASSASSIN
-
-    hestia_config_backup 'clamav-remove' $OSAL_PATH_SPAMASSASSIN_CONF
-
     exim_installed=$(hestia_module_variant_installed 'mta' 'exim')
     exim_installed=$(hestia_module_variant_installed 'mta' 'exim')
     if [ "$exim_installed" ]; then
     if [ "$exim_installed" ]; then
         hestia module spamassassin exim-integration disable
         hestia module spamassassin exim-integration disable
     fi
     fi
 
 
+    osal_service_stop $OSAL_SERVICE_SPAMASSASSIN > /dev/null 2>&1
+    osal_service_disable $OSAL_SERVICE_SPAMASSASSIN > /dev/null 2>&1
+
+    hestia_config_backup 'spamassassin-remove' $OSAL_PATH_SPAMASSASSIN_CONF
+
     osal_package_remove $OSAL_PKG_SPAMASSASSIN
     osal_package_remove $OSAL_PKG_SPAMASSASSIN
 
 
     rm -rf $OSAL_PATH_SPAMASSASSIN_CONF
     rm -rf $OSAL_PATH_SPAMASSASSIN_CONF

+ 1 - 1
bin/module/vsftpd/install.inc

@@ -11,7 +11,7 @@ hestia_module_vsftpd_install() {
 
 
     echo "Installing FTP (vsftpd) module..."
     echo "Installing FTP (vsftpd) module..."
 
 
-    osal_service_stop vsftpd
+    osal_service_stop vsftpd > /dev/null 2>&1
     hestia_config_backup 'vsftpd-install' $OSAL_PATH_VSFTPD_CONF
     hestia_config_backup 'vsftpd-install' $OSAL_PATH_VSFTPD_CONF
 
 
     osal_package_preinstall
     osal_package_preinstall

+ 6 - 4
func/osal_debian_based.sh

@@ -17,6 +17,7 @@ OSAL_SERVICE_SPAMASSASSIN=spamassassin
 # Users
 # Users
 OSAL_USER_APACHE_DATA=www-data
 OSAL_USER_APACHE_DATA=www-data
 OSAL_USER_BIND=bind
 OSAL_USER_BIND=bind
+OSAL_USER_CLAMAV=clamav
 OSAL_USER_EXIM=Debian-exim
 OSAL_USER_EXIM=Debian-exim
 OSAL_USER_NOBODY=nobody
 OSAL_USER_NOBODY=nobody
 OSAL_USER_NOGROUP=nogroup
 OSAL_USER_NOGROUP=nogroup
@@ -29,8 +30,8 @@ OSAL_PKG_APACHE=apache2
 OSAL_PKG_APACHE_MOD_RUID2=libapache2-mod-ruid2
 OSAL_PKG_APACHE_MOD_RUID2=libapache2-mod-ruid2
 OSAL_PKG_BIND=bind9
 OSAL_PKG_BIND=bind9
 OSAL_PKG_CLAMAV=clamav-daemon
 OSAL_PKG_CLAMAV=clamav-daemon
-OSAL_PKG_DOVECOT=dovecot-imapd dovecot-pop3d
-OSAL_PKG_EXIM=exim4 exim4-daemon-heavy
+OSAL_PKG_DOVECOT='dovecot-imapd dovecot-pop3d'
+OSAL_PKG_EXIM='exim4 exim4-daemon-heavy'
 OSAL_PKG_PHPMYADMIN=phpmyadmin
 OSAL_PKG_PHPMYADMIN=phpmyadmin
 OSAL_PKG_ROUNDCUBE=roundcube
 OSAL_PKG_ROUNDCUBE=roundcube
 OSAL_PKG_SPAMASSASSIN=spamassassin
 OSAL_PKG_SPAMASSASSIN=spamassassin
@@ -38,7 +39,8 @@ OSAL_PKG_SPAMASSASSIN=spamassassin
 # Paths
 # Paths
 OSAL_PATH_APACHE_CONF=/etc/apache2
 OSAL_PATH_APACHE_CONF=/etc/apache2
 OSAL_PATH_BIND_DATA=/var/cache/bind
 OSAL_PATH_BIND_DATA=/var/cache/bind
-OSAL_PATH_CLAMAV_CONF=/etc/clamav
+OSAL_PATH_CLAMAV_CONF=/etc/clamav/clamd.conf
+OSAL_PATH_CLAMAV_CONF_D=/etc/clamd.d
 OSAL_PATH_DOVECOT_CONF=/etc/dovecot
 OSAL_PATH_DOVECOT_CONF=/etc/dovecot
 OSAL_PATH_EXIM_CONF=/etc/exim4
 OSAL_PATH_EXIM_CONF=/etc/exim4
 OSAL_PATH_LOGROTATE_CONF=/etc/logrotate.d
 OSAL_PATH_LOGROTATE_CONF=/etc/logrotate.d
@@ -64,7 +66,7 @@ osal_package_install() {
 
 
 # package_remoev 'package' 'package' ...
 # package_remoev 'package' 'package' ...
 osal_package_remove() {
 osal_package_remove() {
-    $OSAL_CMD_PACKAGE_MANAGER -y purge "$@"
+    $OSAL_CMD_PACKAGE_MANAGER -y -qq purge "$@"
 }
 }
 
 
 # service_start 'service-name'
 # service_start 'service-name'

+ 5 - 3
func/osal_rhel_based.sh

@@ -17,6 +17,7 @@ OSAL_SERVICE_SPAMASSASSIN=spamassassin
 # Users
 # Users
 OSAL_USER_APACHE_DATA=apache
 OSAL_USER_APACHE_DATA=apache
 OSAL_USER_BIND=named
 OSAL_USER_BIND=named
+OSAL_USER_CLAMAV=clamav
 OSAL_USER_EXIM=exim
 OSAL_USER_EXIM=exim
 OSAL_USER_NOBODY=nobody
 OSAL_USER_NOBODY=nobody
 OSAL_USER_NOGROUP=nobody
 OSAL_USER_NOGROUP=nobody
@@ -28,7 +29,7 @@ OSAL_CMD_PACKAGE_MANAGER=/usr/bin/dnf
 OSAL_PKG_APACHE=httpd
 OSAL_PKG_APACHE=httpd
 OSAL_PKG_APACHE_MOD_RUID2=mod_ruid2
 OSAL_PKG_APACHE_MOD_RUID2=mod_ruid2
 OSAL_PKG_BIND=bind
 OSAL_PKG_BIND=bind
-OSAL_PKG_CLAMAV=clamav clamav-update
+OSAL_PKG_CLAMAV='clamav clamav-update'
 OSAL_PKG_DOVECOT=dovecot
 OSAL_PKG_DOVECOT=dovecot
 OSAL_PKG_EXIM=exim
 OSAL_PKG_EXIM=exim
 OSAL_PKG_PHPMYADMIN=phpMyAdmin
 OSAL_PKG_PHPMYADMIN=phpMyAdmin
@@ -38,7 +39,8 @@ OSAL_PKG_SPAMASSASSIN=spamassassin
 # Paths
 # Paths
 OSAL_PATH_APACHE_CONF=/etc/httpd
 OSAL_PATH_APACHE_CONF=/etc/httpd
 OSAL_PATH_BIND_DATA=/var/named
 OSAL_PATH_BIND_DATA=/var/named
-OSAL_PATH_CLAMAV_CONF=/etc/clamd.conf /etc/clamd.d
+OSAL_PATH_CLAMAV_CONF=/etc/clamd.conf
+OSAL_PATH_CLAMAV_CONF_D=/etc/clamd.d
 OSAL_PATH_DOVECOT_CONF=/etc/dovecot
 OSAL_PATH_DOVECOT_CONF=/etc/dovecot
 OSAL_PATH_EXIM_CONF=/etc/exim
 OSAL_PATH_EXIM_CONF=/etc/exim
 OSAL_PATH_LOGROTATE_CONF=/etc/logrotate.d
 OSAL_PATH_LOGROTATE_CONF=/etc/logrotate.d
@@ -64,7 +66,7 @@ osal_package_install() {
 
 
 # package_remoev 'package' 'package' ...
 # package_remoev 'package' 'package' ...
 osal_package_remove() {
 osal_package_remove() {
-    $OSAL_CMD_PACKAGE_MANAGER -y remove "$@"
+    $OSAL_CMD_PACKAGE_MANAGER -q -y remove "$@"
 }
 }
 
 
 # service_start 'service-name'
 # service_start 'service-name'

+ 1 - 1
install/hst-install-centos.sh

@@ -39,7 +39,7 @@ software=" nginx awstats bc bind bind-libs bind-utils clamav clamav-update
     php-tidy php-xml php-xmlrpc postgresql postgresql-contrib
     php-tidy php-xml php-xmlrpc postgresql postgresql-contrib
     postgresql-server proftpd roundcubemail rrdtool rsyslog screen
     postgresql-server proftpd roundcubemail rrdtool rsyslog screen
     spamassassin sqlite sudo tar telnet unzip hestia hestia-nginx
     spamassassin sqlite sudo tar telnet unzip hestia hestia-nginx
-    hestia-php vim-common vsftpd webalizer which zip wget tar "
+    hestia-php vim-common vsftpd webalizer which zip wget tar langpacks-en glibc-all-langpacks"
 
 
 # Defining help function
 # Defining help function
 help() {
 help() {

+ 1 - 1
install/rhel/clamav/clamd.conf

@@ -7,7 +7,7 @@ LocalSocketGroup clamav
 LocalSocketMode 666
 LocalSocketMode 666
 # TemporaryDirectory is not set to its default /tmp here to make overriding
 # TemporaryDirectory is not set to its default /tmp here to make overriding
 # the default with environment variables TMPDIR/TMP/TEMP possible
 # the default with environment variables TMPDIR/TMP/TEMP possible
-User clamav
+User clam
 # AllowSupplementaryGroups true
 # AllowSupplementaryGroups true
 ScanMail true
 ScanMail true
 ScanArchive true
 ScanArchive true

+ 0 - 12
install/rhel/clamav/clamd.service

@@ -1,12 +0,0 @@
-[Unit]
-Description = clamd scanner (%i) daemon
-After = syslog.target nss-lookup.target network.target
-
-[Service]
-Type = simple
-ExecStart = /usr/sbin/clamd -c /etc/clamd.conf
-Restart = on-failure
-PrivateTmp = true
-
-[Install]
-WantedBy=multi-user.target

+ 1 - 1
install/rhel/clamav/freshclam.conf

@@ -53,7 +53,7 @@
 # By default when started freshclam drops privileges and switches to the
 # By default when started freshclam drops privileges and switches to the
 # "clamav" user. This directive allows you to change the database owner.
 # "clamav" user. This directive allows you to change the database owner.
 # Default: clamav (may depend on installation options)
 # Default: clamav (may depend on installation options)
-#DatabaseOwner clamupdate
+DatabaseOwner clamav
 
 
 # Use DNS to verify virus database version. Freshclam uses DNS TXT records
 # Use DNS to verify virus database version. Freshclam uses DNS TXT records
 # to verify database and software versions. With this directive you can change
 # to verify database and software versions. With this directive you can change

+ 0 - 0
install/rhel/exim/exim4.conf.template → install/rhel/exim/exim.conf.template