This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Ubuntu :How to setup Spamassassin
#5
RE: Ubuntu :How to setup Spamassassin
HI,

I made (hacked from acid) this script up some time ago to Install PostGrey & Spamassassin for zPanel on Ubuntu 12.04 - I would assume it will work ok with Sentora looking at the tutorial - anyone interested please feel free to give it a go and let me know.

As will all scripts - please take care and backup!

Code:
#!/bin/sh
#
# Script to install postgrey and spamassassin on Ubuntu ZPanel system, arrogantly hacked from Centos 6.4 and ZPanel 10.1.0 script by acid
#
# Designed for ZPanel 10.1.1 & Ubuntu 12.04LTS
#
# Version 1
#
if which postgrey >/dev/null; then
echo "postgrey already exist"
else
echo "Installing postgrey"
apt-get -y install postgrey
sed -i '/^smtpd_recipient_restrictions =/ s/$/ check_policy_service inet:127.0.0.1:10023,/' /etc/zpanel/configs/postfix/main.cf
sed -i 's/POSTGREY_OPTS=\"--inet=10023"/POSTGREY_OPTS=\"--inet=127.0.0.1:10023 --delay=150\"/g' /etc/default/postgrey
service postgrey start
service postfix reload
chkconfig postgrey on
echo "postgrey installed"
fi
# Install Spamassassin
if which spamassassin >/dev/null; then
echo "spamassassin already exist"
else
echo "Installing spamassassin"
apt-get -y install spamassassin spamc
# Enable
sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/spamassassin
# Set Home Directory
sed -i '/OPTIONS=/i \SAHOME="/var/log/spamassassin/"' /etc/default/spamassassin
# Set Options inc log
sed -i 's/OPTIONS="--create-prefs --max-children 5 --helper-home-dir"/OPTIONS="--create-prefs --max-children 2 --username spamd --helper-home-dir ${SAHOME} -s ${SAHOME}spamd.log"/g' /etc/default/spamassassin
# Setup sa user account
groupadd spamd
useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd
mkdir /var/log/spamassassin
chown spamd:spamd /var/log/spamassassin
# Edit local file
sed -i '1s/^/required_hits 5.0\n/' /etc/spamassassin/local.cf
sed -i '2s/^/report_safe 0\n/' /etc/spamassassin/local.cf
sed -i '3s/^/required_score 5\n/' /etc/spamassassin/local.cf
sed -i '4s/^/rewrite_header Subject ***SPAM***\n/' /etc/spamassassin/local.cf
# Update postfix master.cf
sed -i '/^smtp        inet/ s/$/ -o content_filter=spamassassin/' /etc/zpanel/configs/postfix/master.cf
sed -i '/^smtp      inet/ s/$/ -o content_filter=spamassassin/' /etc/zpanel/configs/postfix/master.cf
sed -i '/^smtp    inet/ s/$/ -o content_filter=spamassassin/' /etc/zpanel/configs/postfix/master.cf
sed -i '/^smtp  inet/ s/$/ -o content_filter=spamassassin/' /etc/zpanel/configs/postfix/master.cf
echo "\nspamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f \${sender} \${recipient}\n" >> /etc/zpanel/configs/postfix/master.cf
service postfix restart
service spamassassin restart
echo "SpamAssassin installed, to test it send a mail from outside with the subject: XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X"
echo "Your first email will take about 150 seconds to arrive"
fi

I hope it is of some help.
Reply
Thanks given by:


Messages In This Thread
Ubuntu :How to setup Spamassassin - by Diablo925 - 07-18-2014, 07:35 AM
RE: Ubuntu :How to setup Spamassassin - by ballen - 07-21-2014, 07:11 PM
RE: Ubuntu :How to setup Spamassassin - by TumTum - 07-23-2014, 07:55 AM
RE: Ubuntu :How to setup Spamassassin - by ontheslab - 10-15-2014, 04:25 PM
RE: Ubuntu :How to setup Spamassassin - by ballen - 02-02-2015, 10:44 PM
RE: Ubuntu :How to setup Spamassassin - by Me.B - 02-02-2015, 11:16 PM
RE: Ubuntu :How to setup Spamassassin - by ballen - 02-02-2015, 11:29 PM
RE: Ubuntu :How to setup Spamassassin - by xanaul - 09-29-2015, 01:44 AM
RE: Ubuntu :How to setup Spamassassin - by TGates - 10-30-2015, 05:01 AM
RE: Ubuntu :How to setup Spamassassin - by Bobses - 01-03-2016, 08:11 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
Upgrade to Ubuntu 16.04 from 14.04 HogensHero 7 10,424 10-04-2019, 11:20 AM
Last Post: type-00
Proper CRON setup TGates 9 15,785 05-15-2018, 01:07 AM
Last Post: johnk42
Ubuntu: How to setup TLS on postfix and dovecot Diablo925 28 60,802 02-15-2018, 08:46 PM
Last Post: duane

Forum Jump:


Users browsing this thread: 2 Guest(s)