From 295651bec3ddd028ecadce8d31e3f1f34bb9aa4f Mon Sep 17 00:00:00 2001 From: "b.waal" Date: Sun, 1 Sep 2019 00:58:59 +0200 Subject: [PATCH] Update 'installer.sh' --- installer.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/installer.sh b/installer.sh index ba7e954..52d2c9e 100644 --- a/installer.sh +++ b/installer.sh @@ -335,12 +335,41 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$bra sed -i 's/root@localhost/'$email'/g' /etc/fail2ban/jail.conf systemctl restart fail2ban +##-------------------------------## +# SpamAssassin Installation # +##-------------------------------## +apt install spamassassin spamc -y + +##--------------------------------## +# SpamAssassin Configuration # +##--------------------------------## +echo "Listen: 127.0.0.1:10025" >> /etc/clamsmtpd.conf +echo "OutAddress: 10026" >> /etc/clamsmtpd.conf +echo "# A header to add to all scanned email" >> /etc/clamsmtpd.conf +echo "Header: X-AV-Checked: ClamAV using ClamSMTP" >> /etc/clamsmtpd.conf +echo "# interface to spamassassin." >> /etc/postfix/master.cf +echo "spamassassin unix - n n - - pipe" >> /etc/postfix/master.cf +echo " user=nobody argv=/usr/bin/spamc -f -e" >> /etc/postfix/master.cf +echo " /usr/sbin/sendmail -oi -f ${sender} ${recipient}" >> /etc/postfix/master.cf + +##-------------------------## +# ClamAV Installation # +##-------------------------## +apt install clamav clamsmtp -y + +##--------------------------## +# ClamAV Configuration # +##--------------------------## +echo "# virus scanning" >> /etc/postfix/master.cf +echo "content_filter = scan:127.0.0.1:10025" >> /etc/postfix/master.cf +echo "receive_override_options = no_address_mappings" >> /etc/postfix/master.cf + ##-----------------------## # Enabling Services # ##-----------------------## -systemctl enable postfix.service postfix@-.service dovecot.service fail2ban.service +systemctl enable postfix.service postfix@-.service dovecot.service fail2ban.service clamav.service clamsmtp.service spamassassin.service ##-----------------------## # Starting Services # ##-----------------------## -systemctl restart postfix.service postfix@-.service dovecot.service fail2ban.service \ No newline at end of file +systemctl restart postfix.service postfix@-.service dovecot.service fail2ban.service clamav.service clamsmtp.service spamassassin.service \ No newline at end of file