From 0ff27906cc64405e039b6de2fd69b3cf07da72d0 Mon Sep 17 00:00:00 2001 From: "b.waal" Date: Sun, 1 Sep 2019 16:34:30 +0200 Subject: [PATCH] Update 'installer.sh' --- installer.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/installer.sh b/installer.sh index 705bdea..844829f 100644 --- a/installer.sh +++ b/installer.sh @@ -311,6 +311,65 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$bra sievec /etc/dovecot/sieve/default.sieve chown vmail:vmail /etc/dovecot/sieve/ -R +##------------------## +# Spamassassin # +##------------------## +apt install spamassassin razor pyzor -y +echo "" >> /etc/spamassassin/local.cf +echo "#pyzor" >> /etc/spamassassin/local.cf +echo "use_pyzor 1" >> /etc/spamassassin/local.cf +echo "pyzor_path /usr/bin/pyzor" >> /etc/spamassassin/local.cf +echo "pyzor_add_header 1" >> /etc/spamassassin/local.cf +echo "" >> /etc/spamassassin/local.cf +echo "#razor" >> /etc/spamassassin/local.cf +echo "use_razor2 1" >> /etc/spamassassin/local.cf +echo "razor_config /etc/razor/razor-agent.conf" >> /etc/spamassassin/local.cf +echo "" >> /etc/spamassassin/local.cf +echo "#bayes" >> /etc/spamassassin/local.cf +echo "use_bayes 1" >> /etc/spamassassin/local.cf +echo "use_bayes_rules 1" >> /etc/spamassassin/local.cf +echo "bayes_auto_learn 1" >> /etc/spamassassin/local.cf + +##------------## +# ClamAV # +##------------## +apt install clamav clamav-daemon clamsmtp -y + +##------------## +# Amavis # +##------------## +apt install amavisd-new -y +apt install zip lrzip liblz4-tool lhasa arj unzip bzip2 nomarch cpio lzop cabextract arc apt-listchanges libauthen-sasl-perl libdbd-mysql-perl libdbi-perl libmail-dkim-perl ripole p7zip p7zip-full p7zip-rar rpm unrar unrar-free altermime libsnmp-perl libnet-ldap-perl libnet-ph-perl libnet-snpp-perl libnet-telnet-perl -y +sed -i -e 's/@bypass/'@bypass'/' -e 's/ / /' /etc/amavis/conf.d/15-content_filter_mode +adduser clamav amavis +sed -i 's/clamd.conf/'clamd.conf'/g' /etc/clamav/freshclam.conf +echo "#Pipe incoming mail trough Amavis" >> /etc/postfix/main.cf +postconf -e 'content_filter = amavis:[127.0.0.1]:10024' +postconf -e 'receive_override_options = no_address_mappings' +echo "#Pipe incoming mail trough Amavis" >> /etc/postfix/master.cf +echo "amavis unix - - - - 2 smtp" >> /etc/postfix/master.cf +echo " -o smtp_data_done_timeout=1200" >> /etc/postfix/master.cf +echo " -o smtp_send_xforward_command=yes" >> /etc/postfix/master.cf +echo "127.0.0.1:10025 inet n - - - - smtpd" >> /etc/postfix/master.cf +echo " -o content_filter=" >> /etc/postfix/master.cf +echo " -o local_recipient_maps=" >> /etc/postfix/master.cf +echo " -o relay_recipient_maps=" >> /etc/postfix/master.cf +echo " -o smtpd_restriction_classes=" >> /etc/postfix/master.cf +echo " -o smtpd_client_restrictions=" >> /etc/postfix/master.cf +echo " -o smtpd_helo_restrictions=" >> /etc/postfix/master.cf +echo " -o smtpd_sender_restrictions=" >> /etc/postfix/master.cf +echo " -o smtpd_recipient_restrictions=permit_mynetworks,reject" >> /etc/postfix/master.cf +echo " -o mynetworks=127.0.0.0/8" >> /etc/postfix/master.cf +echo " -o strict_rfc821_envelopes=yes" >> /etc/postfix/master.cf +echo " -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks" >> /etc/postfix/master.cf +echo " -o smtpd_bind_address=127.0.0.1" >> /etc/postfix/master.cf + + + + + + + ##--------------## # Rainloop # ##--------------## @@ -333,9 +392,9 @@ systemctl restart fail2ban ##-----------------------## # Enabling Services # ##-----------------------## -systemctl enable postfix.service postfix@-.service dovecot.service fail2ban.service clamav.service clamsmtp.service spamassassin.service +systemctl enable postfix postfix@- dovecot fail2ban clamav clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-new amavisd-snmp-subagent amavis-mc amavis amavis-snmp-subagent ##-----------------------## # Starting Services # ##-----------------------## -systemctl restart postfix.service postfix@-.service dovecot.service fail2ban.service clamav.service clamsmtp.service spamassassin.service \ No newline at end of file +systemctl restart postfix postfix@- dovecot fail2ban clamav clamav-daemon clamav-freshclam clamsmtp spamassassin amavisd-new amavisd-snmp-subagent amavis-mc amavis amavis-snmp-subagent \ No newline at end of file