Skip to content

Commit fbb49be

Browse files
committed
Update mailscannerinstaller.sh
CLN Compatibility
1 parent 570fc14 commit fbb49be

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

CPScripts/mailscannerinstaller.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ if [ -f /etc/os-release ];then
3939
OS=$(head -1 /etc/os-release)
4040
UBUNTUVERSION=$(sed '6q;d' /etc/os-release)
4141
CENTOSVERSION=$(sed '5q;d' /etc/os-release)
42+
CLNVERSION=$(sed '3q;d' /etc/os-release)
4243
fi
4344

4445
if [ "$CENTOSVERSION" = "VERSION_ID=\"7\"" ];then
@@ -104,6 +105,34 @@ echo "Please install spamassassin through the CyberPanel interface before procee
104105
exit
105106
fi
106107

108+
elif [ "$CLNVERSION" = "ID=\"cloudlinux\"" ];then
109+
110+
setenforce 0
111+
yum install -y perl yum-utils perl-CPAN
112+
yum install -y gcc cpp perl bzip2 zip make patch automake rpm-build perl-Archive-Zip perl-Filesys-Df perl-OLE-Storage_Lite perl-Sys-Hostname-Long perl-Sys-SigAction perl-Net-CIDR perl-DBI perl-MIME-tools perl-DBD-SQLite binutils glibc-devel perl-Filesys-Df zlib unzip zlib-devel wget mlocate clamav "perl(DBD::mysql)"
113+
114+
rpm -Uvh https://forensics.cert.org/centos/cert/7/x86_64/unrar-5.4.0-1.el7.x86_64.rpm
115+
export PERL_MM_USE_DEFAULT=1
116+
curl -L https://cpanmin.us | perl - App::cpanminus
117+
perl -MCPAN -e 'install Encoding::FixLatin'
118+
perl -MCPAN -e 'install Digest::SHA1'
119+
perl -MCPAN -e 'install Geo::IP'
120+
perl -MCPAN -e 'install Razor2::Client::Agent'
121+
perl -MCPAN -e 'install Net::Patricia'
122+
123+
freshclam -v
124+
DIR=/etc/mail/spamassassin
125+
126+
if [ -d "$DIR" ]; then
127+
sa-update
128+
129+
else
130+
131+
echo "Please install spamassassin through the CyberPanel interface before proceeding"
132+
133+
exit
134+
fi
135+
107136
elif [ "$OS" = "NAME=\"Ubuntu\"" ];then
108137

109138
apt-get install -y libmysqlclient-dev
@@ -154,6 +183,10 @@ chown -R postfix:postfix /var/spool/MailScanner
154183
elif [ "$OS" = "NAME=\"CentOS Linux\"" ];then
155184
wget https://github.com/MailScanner/v5/releases/download/5.3.3-1/MailScanner-5.3.3-1.rhel.noarch.rpm
156185
rpm -Uvh *.rhel.noarch.rpm
186+
187+
elif [ "$OS" = "NAME=\"CloudLinux\"" ];then
188+
wget https://github.com/MailScanner/v5/releases/download/5.3.3-1/MailScanner-5.3.3-1.rhel.noarch.rpm
189+
rpm -Uvh *.rhel.noarch.rpm
157190
fi
158191

159192
mkdir /var/spool/MailScanner/spamassassin
@@ -262,6 +295,9 @@ elif [ "$CENTOSVERSION" = "VERSION_ID=\"8\"" ];then
262295
dnf --enablerepo=gf-plus install -y dovecot23-pigeonhole
263296
dnf install -y net-tools postfix-perl-scripts
264297

298+
elif [ "$CLNVERSION" = "ID=\"cloudlinux\"" ];then
299+
300+
yum install -y nano net-tools dovecot-pigeonhole postfix-perl-scripts
265301
fi
266302

267303

@@ -341,6 +377,9 @@ if [ "$OS" = "NAME=\"Ubuntu\"" ];then
341377
elif [ "$OS" = "NAME=\"CentOS Linux\"" ];then
342378
sed -i 's|^spamassassin.*|spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}|g' /etc/postfix/master.cf
343379

380+
elif [ "$OS" = "NAME=\"CloudLinux\"" ];then
381+
sed -i 's|^spamassassin.*|spamassassin unix - n n - - pipe flags=DROhu user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}|g' /etc/postfix/master.cf
382+
344383
fi
345384

346385

0 commit comments

Comments
 (0)