Update 5.2.1-1 (#410)

* Initial Refactor for 5.1.4-1

* Reorder docs and patch processing

* Explicit targets for copy

* Update install phase of specs

* Disable AutoReqProv

* Update install splash

* Refactor post install

* Update README

* Distinguish rhel and suse rpms in naming
Clarify naming in README
Log ms-configure to /var/log

* Do not automatically enable mailscanner on debian builds
Move notes in packages to end of ms-configure
Alter notes in specs to notify user to run ms-configure

* Correct package name in copy

* Move mtagroup creation back to spec

* patch.diff no longer valid

* Remove patch.diff from spec and build

* Bump to version 5.2.1-1 for major changes

* ATTENTION block added to README

* Cosmetic changes to README

* Tab cleanup of README

* Revert not enabling mailscanner during install

* Explicit destination file for copy on suse builds

* Reorder doc copies for tarballing

* Remove unneeded subdirectory in suse build

* 5.2.1-1 Builds
This commit is contained in:
Shawn Iverson 2019-11-03 18:40:24 -05:00 committed by GitHub
parent 7b5b6443fe
commit 0a87daf349
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 978 additions and 819 deletions

View file

@ -1,10 +1,7 @@
#!/usr/bin/env bash
# Jerry Benton
# 24 APR 2016
#
# Shawn Iverson <shawniverson@efa-project.org>
# 22 OCT 2018
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
#
#
# this Build.debian script should be located in the base
@ -107,16 +104,16 @@ chmod +x $WORK/etc/cron.hourly/*
# create a working dir for package
PKGTMP="/tmp/deb.$$/";
mkdir -p $PKGTMP/MailScanner-${FULLMSVER}
fakeroot dpkg -b $WORK $PKGTMP/MailScanner-${FULLMSVER}/MailScanner-$FULLMSVER-noarch.deb
cp $DEVBASEDIR/debian/install.sh $PKGTMP/MailScanner-${FULLMSVER}
cp $DEVBASEDIR/changelog $PKGTMP/MailScanner-${FULLMSVER}
cp $DEVBASEDIR/LICENSE $PKGTMP/MailScanner-${FULLMSVER}
cp $DEVBASEDIR/README $PKGTMP/MailScanner-${FULLMSVER}
cp $DEVBASEDIR/common/patch/patch.diff $PKGTMP/MailScanner-${FULLMSVER}
chmod +x $PKGTMP/MailScanner-${FULLMSVER}/install.sh
#cp $DEVBASEDIR/debian/install.sh $PKGTMP/MailScanner-${FULLMSVER}
mkdir -p $WORK/usr/share/MailScanner/doc
cp $DEVBASEDIR/changelog $WORK/usr/share/MailScanner/doc/
cp $DEVBASEDIR/LICENSE $WORK/usr/share/MailScanner/doc/
cp $DEVBASEDIR/README $WORK/usr/share/MailScanner/doc/
fakeroot dpkg -b $WORK $PKGTMP/MailScanner-$FULLMSVER-noarch.deb
#chmod +x $PKGTMP/MailScanner-${FULLMSVER}/install.sh
cd $PKGTMP
tar czf MailScanner-${FULLMSVER}.deb.tar.gz *
mv -f MailScanner-${FULLMSVER}.deb.tar.gz $FILEOUT
#tar czf MailScanner-${FULLMSVER}.deb.tar.gz *
mv -f MailScanner-${FULLMSVER}-noarch.deb $FILEOUT
rm -rf $PKGTMP
rm -rf $WORK

View file

@ -1,8 +1,7 @@
#!/bin/bash
# Checked and updated to be more streamlined by
# Jerry Benton
# 3 MAY 2016
# Updated 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
# this Build.tarball script should be located in the base
# directory when run.

View file

@ -1,12 +1,7 @@
#!/usr/bin/env bash
#
# Written by:
# Jerry Benton < mailscanner@mailborder.com >
# 13 FEB 2015
# 18 April 2016 - Updated
#
# Shawn Iverson <shawniverson@efa-project.org>
# 22 October 2018
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
#
# This script will build the latest RPM install
# package and put it in /msbuilds/rpm
@ -127,6 +122,12 @@ chmod +x $WORK/usr/lib/MailScanner/init/*
chmod +x $WORK/etc/cron.daily/*
chmod +x $WORK/etc/cron.hourly/*
# Doc and patches
mkdir -p $WORK/usr/share/MailScanner/doc
cp $DEVBASEDIR/changelog $WORK/usr/share/MailScanner/doc/changelog
cp $DEVBASEDIR/README $WORK/usr/share/MailScanner/doc/README
cp $DEVBASEDIR/LICENSE $WORK/usr/share/MailScanner/doc/LICENSE
# Build the src tarball for RPM construction
cd $WORK
cd ..
@ -135,21 +136,18 @@ tar czf ~/rpmbuild/SOURCES/MailScanner-${MSVERSION}.tgz MailScanner-${MSVERSION}
# return to where i started
cd $THISCURDIR
# create the output dir in $RPMOUT
if [ -d $RPMOUT/MailScanner-$VERSION ]; then
rm -rf $RPMOUT/MailScanner-$VERSION
fi
mkdir -p $RPMOUT/MailScanner-$VERSION
# create the output dir $RPMOUT
# if [ -d $RPMOUT ]; then
# rm -rf $RPMOUT
# fi
# mkdir -p $RPMOUT
# copy some file we need
cp $SRCDIR/install.sh $RPMOUT/MailScanner-$VERSION/
cp $DEVBASEDIR/README $RPMOUT/MailScanner-$VERSION/
cp $DEVBASEDIR/LICENSE $RPMOUT/MailScanner-$VERSION/
cp $DEVBASEDIR/common/patch/patch.diff $RPMOUT/MailScanner-$VERSION/
find $RPMOUT/MailScanner-$VERSION -name 'install.sh' -exec chmod 755 {} \;
find $RPMOUT/MailScanner-$VERSION -name 'LICENSE' -exec chmod 644 {} \;
find $RPMOUT/MailScanner-$VERSION -name 'README' -exec chmod 644 {} \;
find $RPMOUT/MailScanner-$VERSION -name 'patch.diff' -exec chmod 644 {} \;
#cp $SRCDIR/install.sh $RPMOUT/MailScanner-$VERSION/
#find $RPMOUT/MailScanner-$VERSION -name 'install.sh' -exec chmod 755 {} \;
#find $RPMOUT/MailScanner-$VERSION -name 'LICENSE' -exec chmod 644 {} \;
#find $RPMOUT/MailScanner-$VERSION -name 'README' -exec chmod 644 {} \;
#find $RPMOUT/MailScanner-$VERSION -name 'patch.diff' -exec chmod 644 {} \;
# Build the RPM and SRPMS
# extra define statements help make the rpm backwards compatible
@ -157,12 +155,12 @@ find $RPMOUT/MailScanner-$VERSION -name 'patch.diff' -exec chmod 644 {} \;
rpmbuild -ba --define "_binary_filedigest_algorithm 1" --define "_binary_payload 1" ~/rpmbuild/SPECS/mailscanner.spec
# copy the rpm built to the output dir
cp ~/rpmbuild/RPMS/noarch/MailScanner-${VERSION}.noarch.rpm $RPMOUT/MailScanner-$VERSION
cd $RPMOUT
tar czf MailScanner-${VERSION}.rhel.tar.gz MailScanner-$VERSION
rm -rf $RPMOUT/MailScanner-$VERSION
cp ~/rpmbuild/RPMS/noarch/MailScanner-${VERSION}.rhel.noarch.rpm $RPMOUT
#cd $RPMOUT
#tar czf MailScanner-${VERSION}.rhel.tar.gz MailScanner-$VERSION
#rm -rf $RPMOUT/MailScanner-$VERSION
rm -rf $WORK
echo;
echo "Completed: $RPMOUT/MailScanner-${VERSION}.rhel.tar.gz";
echo "Completed: $RPMOUT/MailScanner-${VERSION}.rhel.noarch.rpm";

View file

@ -1,12 +1,7 @@
#!/usr/bin/env bash
#
# Written by:
# Jerry Benton < mailscanner@mailborder.com >
# 3 MAY 2016
#
# Updated by:
# Shawn Iverson <shawniverson@efa-project.org
# 22 OCT 2018
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
#
# This script will build the latest SuSE install
# package and put it in /msbuilds/suse
@ -99,6 +94,7 @@ cp -fr $DEVBASEDIR/suse/etc/* $WORK/etc/
# usr
cp -fr $DEVBASEDIR/common/usr/* $WORK/usr/
cp -fr $DEVBASEDIR/suse/usr/* $WORK/usr/
# Insert the version number we are building
perl -pi -e 's/VersionNumberHere/'$MSVERSION'/;' $WORK/etc/MailScanner/MailScanner.conf
@ -126,6 +122,11 @@ chmod +x $WORK/usr/lib/MailScanner/init/*
chmod +x $WORK/etc/cron.daily/*
chmod +x $WORK/etc/cron.hourly/*
mkdir -p $WORK/usr/share/MailScanner/doc
cp $DEVBASEDIR/changelog $WORK/usr/share/MailScanner/doc/changelog
cp $DEVBASEDIR/README $WORK/usr/share/MailScanner/doc/README
cp $DEVBASEDIR/LICENSE $WORK/usr/share/MailScanner/doc/LICENSE
# Build the src tarball for RPM construction
cd $WORK
cd ..
@ -134,21 +135,12 @@ tar czf ~/rpmbuild/SOURCES/MailScanner-${MSVERSION}.tgz MailScanner-${MSVERSION}
# return to where i started
cd $THISCURDIR
# create the output dir in $RPMOUT
if [ -d $RPMOUT/MailScanner-$VERSION ]; then
rm -rf $RPMOUT/MailScanner-$VERSION
fi
mkdir -p $RPMOUT/MailScanner-$VERSION
# copy some file we need
cp $SRCDIR/install.sh $RPMOUT/MailScanner-$VERSION/
cp $DEVBASEDIR/README $RPMOUT/MailScanner-$VERSION/
cp $DEVBASEDIR/LICENSE $RPMOUT/MailScanner-$VERSION/
cp $DEVBASEDIR/common/patch/patch.diff $RPMOUT/MailScanner-$VERSION/
find $RPMOUT/MailScanner-$VERSION -name 'install.sh' -exec chmod 755 {} \;
find $RPMOUT/MailScanner-$VERSION -name 'LICENSE' -exec chmod 644 {} \;
find $RPMOUT/MailScanner-$VERSION -name 'README' -exec chmod 644 {} \;
find $RPMOUT/MailScanner-$VERSION -name 'patch.diff' -exec chmod 644 {} \;
#cp $SRCDIR/install.sh $RPMOUT/MailScanner-$VERSION/
# find $RPMOUT/MailScanner-$VERSION -name 'install.sh' -exec chmod 755 {} \;
# find $RPMOUT/MailScanner-$VERSION -name 'LICENSE' -exec chmod 644 {} \;
# find $RPMOUT/MailScanner-$VERSION -name 'README' -exec chmod 644 {} \;
# find $RPMOUT/MailScanner-$VERSION -name 'patch.diff' -exec chmod 644 {} \;
# Build the RPM and SRPMS
# extra define statements help make the rpm backwards compatible
@ -156,12 +148,12 @@ find $RPMOUT/MailScanner-$VERSION -name 'patch.diff' -exec chmod 644 {} \;
rpmbuild -ba --define "_binary_filedigest_algorithm 1" --define "_binary_payload 1" ~/rpmbuild/SPECS/mailscanner.spec
# copy the rpm built to the output dir
cp ~/rpmbuild/RPMS/noarch/MailScanner-${VERSION}.noarch.rpm $RPMOUT/MailScanner-$VERSION
cd $RPMOUT
tar czf MailScanner-${VERSION}.suse.tar.gz MailScanner-$VERSION
rm -rf $RPMOUT/MailScanner-$VERSION
cp ~/rpmbuild/RPMS/noarch/MailScanner-${VERSION}.suse.noarch.rpm $RPMOUT
#cd $RPMOUT
# tar czf MailScanner-${VERSION}.suse.tar.gz MailScanner-$VERSION
#rm -rf $RPMOUT/MailScanner-$VERSION
rm -rf $WORK
echo;
echo "Completed: $RPMOUT/MailScanner-${VERSION}.suse.tar.gz";
echo "Completed: $RPMOUT/MailScanner-${VERSION}.suse.noarch.rpm";

95
README
View file

@ -1,11 +1,10 @@
# Welcome to MailScanner!
#
# Current version: 5.1.3-2 Release (5.1.4-1 pending testing)
# Current version: 5.2.1-1
#
# 27 January 2019
# 3 November 2019
# MailScanner Team <https://www.mailscanner.info>
#
#
# MailScanner is an open source email gateway that processes email for
# spam, viruses, phishing, and other malicious content. MailScanner
# leverages other open source software such as ClamAV and
@ -13,47 +12,67 @@
# install packages for popular distributions such as Redhat, Debian, and
# SUSE in addition to any generic NIX package.
#
# Info: https://www.mailscanner.info
# Release: https://www.mailscanner.info/downloads
# Github: https://github.com/MailScanner/v5
# Manual: https://s3.amazonaws.com/msv5/docs/ms-admin-guide.pdf
# Milter: https://github.com/MailScanner/v5/blob/master/doc/MailScanner%20Milter%20Guide.pdf
# Support: http://lists.mailscanner.info/mailman/listinfo/mailscanner
#
# Info: https://www.mailscanner.info
# Release: https://www.mailscanner.info/downloads
# Github: https://github.com/MailScanner/v5
# Manual: https://s3.amazonaws.com/msv5/docs/ms-admin-guide.pdf
# Milter: https://github.com/MailScanner/v5/blob/master/doc/MailScanner%20Milter%20Guide.pdf
# Support: http://lists.mailscanner.info/mailman/listinfo/mailscanner
# ##################### ATTENTION ###################
# # Install and update instructions have changed. #
# # With the exception of the generic *nix package, #
# # MailScanner now installs via deb and rpm first. #
# ##################### ATTENTION ###################
#
# Install
# tar -xvzf MailScanner-5.x.x-x.distro.tar.gz
# cd MailScanner-5.x.x-x
# ./install.sh
# (reboot may be required)
# Install
# Redhat-based
# rpm -ivh MailScanner-5.x.x-x.rhel.noarch.rpm
# /usr/sbin/ms-configure
# Debian-based
# dpkg -i MailScanner-5.x.x.x-x-noarch.deb
# /usr/sbin/ms-configure
# SuSE-based
# rpm -ivh MailScanner-5.x.x.x-x.suse.noarch.rpm
# /usr/sbin/ms-configure
# Other *nix
# tar -xvzf MailScanner-5.x.x-x.nix.tar.gz
# ./install.sh
#
# Update
# tar -xvzf MailScanner-5.x.x-x.distro.tar.gz
# cd MailScanner-5.x.x-x
# ./install.sh --update
# (reboot may be required)
# Update
# Redhat-based
# rpm -Uvh MailScanner-5.x.x-x.rhel.noarch.rpm
# /usr/sbin/ms-configure --update
# Debian-based
# dpkg -i MailScanner-5.x.x.x-x-noarch.deb
# /usr/sbin/ms-configure --update
# SuSE-based
# rpm -Uvh MailScanner-5.x.x-x.suse.noarch.rpm
# /usr/sbin/ms-configure --update
# Other *nix
# tar -xvzf MailScanner-5.x.x-x.nix.tar.gz
# ./install.sh
#
# MTA Guides:
# sendmail - https://www.mailscanner.info/sendmail
# postfix - https://www.mailscanner.info/postfix
# exim - https://www.mailscanner.info/exim
# MTA Guides:
# sendmail - https://www.mailscanner.info/sendmail
# postfix - https://www.mailscanner.info/postfix
# exim - https://www.mailscanner.info/exim
#
# Setup:
# Edit /etc/MailScanner/defaults and set options
# Edit /etc/MailScanner/MailScanner.conf and set options
# service mailscanner start
# Setup:
# Edit /etc/MailScanner/defaults and set options
# Edit /etc/MailScanner/MailScanner.conf and set options
# service mailscanner start
#
# NIX:
# For generic NIX systems, create a symlink for controlling the
# start/stop/restart of the program to:
# NIX:
# For generic NIX systems, create a symlink for controlling the
# start/stop/restart of the program to:
#
# /usr/lib/MailScanner/init/ms-init
# /usr/lib/MailScanner/init/ms-init
#
# * This is not required for RHEL, CentOS, Debian, Ubuntu, SUSE
# * This is not required for RHEL, CentOS, Debian, Ubuntu, SUSE
#
# File Locations:
# /etc/MailScanner
# /usr/share/MailScanner
# /usr/lib/MailScanner
#
# File Locations:
# /etc/MailScanner
# /usr/share/MailScanner
# /usr/lib/MailScanner
#

View file

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJcThVPCRDyhd/lbC6UxQAAAwUQAIjcXMqx/WlD1A81WU6wdXfw
qKeT9zRQONGmMhhDBfAIdXOlRG10ZvylHqhTy9Fc/zgkK7MLZXCn6UV82tg6sfgI
5P0EEpOzsXN0k57bSYmzpoJjaNY+a1QzDX7lYQB0g8wo/hEdj7L2AF3EnF2Leiwx
OLBTaWAsNmRPYTXZXq4xnthr8yI4OsxuNmn5nmrjy6NxdQ6GU4jV/LXU7qYeEvTA
W//n5sdq6P6DE801CzRxouOaYS5d/4c2LnN1q70L05cdoOVHsRgbsNiFwg2QasvH
R2GvJIO/dLuAtJZI4csX62CSmGi6d8xvvyB3m6EYswD+12gOj5m6VjHj/rGe79zm
d+Rfr6Q70xp6ao1V5CtjVx1mJWElu7cMgoiixkUQlprD8jQARVaCd+RIw4qqFI2I
ZIoeERuFcg1d/0yVpkmAoCi7xzM/6KU/Tt8F0Q9LOi37Ts6KxpQgNs43tZJG8YMx
EE/Guexo/8AdNF0RQLpcEHAOIfuD0mhTS2P5tULxYZo/vwbh/B2EgIim+lHQdI07
jnNuliXEzwCE/jDYXCRdkriElE+LMt1cUlykrZYvsyLGWe+Ix3mv7TOFkMTDqUTi
xWS8H9jwrhfFKv3uswHR/xQjhLbJsVHkha7o+9Nnn/2hRr0hpf7+fvkCJFexRv90
kHflRTyJ3+sBxvyOWhj/
=R8fI
-----END PGP SIGNATURE-----

View file

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJcThV0CRDyhd/lbC6UxQAA0VsQAFOxwv4oXCZaeWHhcgpXMKt2
WnpNRnQwExKTjyMPwqE8K+xZOCeAQC6415S47HROhHMVMN93ZqMpkN1pBEE1K7on
FJa+I92Y35EteR7yqnY5emNMxtSG8MmjcPUSzJH/7zVLuJ+zmrPZKzTS2sYdw355
ysmSUpONVTgXVhrW+CfViUHywq4RjvobVi4tuVhZgRKkpc69iK8KTqfdZz0Z0LgX
LWnXcXvbokKl5Myzo96mvx/Oyvywo568WfrMNHDtHNAJE8PIYp5+wSx4S8roEjOy
fcZgoYoUgxaCc2Lr9QQ3GA/Ayxk0DpxjQ9P/71jEqvCA2PedYzVQJMhtK9Ma4DXA
FPQIIUWsyDKuGRIpWbc2x9jPF9WHLSvmgLAesDBZnyM6OgG2fQ1hvH7JJr9wYtaW
7kVOnKkHmmvpKiTH3mrZIXnfgXyQQUmSEnOmODOFRFcaKhRD/619eRb3hk/z01t6
0Ovh1D+aihUFwGdq1lpDXuJpebPfuiEbPcBnnxJk4/6OizTsSGTPPGXM1n1rHkVo
e6zfwUH/tKCUq5A3rFzY1xln2xp5CnzB7IxJSxMCz8hNZXisUM+NSaI9gTsCJ43x
BC+KOb3GjfupvIQMUbGiLjzCeXBDHT5PxHhPQcKMmfmxOGZrLaHadwV/qEb4YC/+
KE9Guv/SEaoAW8SxzJ6x
=UVhS
-----END PGP SIGNATURE-----

View file

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJcThWCCRDyhd/lbC6UxQAA4DYQABu46GLWrREAA7S5tSREK3yg
CSM6h0nUz/2xNpTbixhFZUojxys7P7nsK1R6EKbc23tLEGx+wl6xlPHS8TPAlhRo
Hsq/qYvLSwzIfMJ1o/tH1sLjGTfiFFFEgDoPapIqx99wTDJPFIH1iwC79GTl/wz7
sjhVuN3ELdTAxIwUNVGykm4j8D1CmRejwZ+WuxWWfuuRG9583td1x8QhXHn6SAS9
5BeKPTMEtGRydOvnAvervGnyo/5XV7aX47NJXPqXJpilBDmT8lHgfy3KOF+D0d26
FINzVqCIHnc7NP5zdTjQd1XqQ+THGEyvcbPVWv/5AwDlOZngd8XFgVV76q/KxjO2
Af1f6CP+KuMGMbat/tznZE5Xejf7wtBi99D7iOP3FviB0bZCJSjEbuJ6ikqfpYgO
rIGuCD74hgEmBhr5leg/BHwg8laez7lp/Grpyds8NJV62h9KrnJo9Plf/vULEX/n
6IHstKxQ9mBaxAv2dj1f/VCiZ0DRKNlFsWpiPeq26w0BKnOXvRHgQyigLgTtzoEA
dIew8vkbuytnnjIG1dOcvdg9J7UIWg10CqbVFxjJjU+3AVpKo1RVTK7m/FK3OsfK
t8LkXiTAsvM4LF9s+Hq8LFBrfbFDLLwg8J+YjjgrJ5axkbk0yZDVHwfuebTPH2PQ
HdztUCX96pvbW2QppmZP
=sTcr
-----END PGP SIGNATURE-----

View file

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJcThWRCRDyhd/lbC6UxQAANVIQAE3An/9hGld2M8F0r9PDwIo+
L0nnbthiRHyMRaLDWh4ucdrp+Z70xvm4Yd8j3pOMkIBgIDDDeI330XhNcqdvzgnK
w6CzuLfy0GzZI9sH3STonCnNoLMX5YpsUBpcQ/DNn3VYPVji1VM/nuqBBRjSWshR
dHZ7iUEkPzJHPVqUdLLmzWPPWjgNEN9mxIaWRWxMLUd3RZrG9lRnt32nqhPnzMyC
dQbFv6t9gtpUCS+9UmI3FmmbaeN+ts0WxvgD9IqWMYZee0mGTYDisWw1UcmEkg5Y
ICFkK3ufiE8jR7XgqlA5W6ydIy1rxSXzaLaIei7k+zo8r/BV43ZQjdpdJOxxxJx0
IU+LhnFVTjiaN2ttl0IzkgkZ1kMFxEWMY/8QUErZMGBA5yLnlRjbrp43VFmS2Rpf
kX54pBdwrTo9iQcgjENSVClJwkGWVlN/0LlUifdzluuL9IHuToxP48q9a/3TxkIt
OMaKYpnmYnpMlFAosSfikUbpX0kfZ7pk73iCtFMmRnj2EX3R1g8mj0nJJxUy3Ul0
9SWMc+H1EK+sNgvBM529IAY1JyEL/Iu2aqJSNIM1e5L4Bsm0LiA9v2xDpJVJAJId
Axm2wLGeiJr/Tjo8+qPluBA4KbV4f7phJkCaCZtpm/Vv9DEPpTfI9HM1lO5ZGy7g
WUMHawlbdU2Vql0TD8h1
=05K1
-----END PGP SIGNATURE-----

Binary file not shown.

View file

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJdv10DCRDyhd/lbC6UxQAAG1QQAJYzyf4aaeRoEy/ll6FX+Cfa
JVP033L9bumTaYpCTexxoPch51GxL+2R7oocIHzVHuiw0WMRMWz5qQdM1QO2w11+
cyiOwwGNcbkue3LJnRHo5Q/+GulWfnWQQpnWs5tkIHzlB37XW/8v/++9W3Tr6vxH
4f8gjco0szFqov/8BEr3keXqEsikmEcGFCrk7mNWZ+/SkM/6sF1SE52fYRq68u9o
rvMGBl5jPqYaVpVZee09chgPDFCyl1EVwefVYhcCJAuwqLGpkC2WQszI2wFe+1LS
0yTsX05dK6NaGF8PbM79ogdcAMpcJ8vewOn98jTRMDxCQOk33lpUA+fnX8ERwJdk
p/qVa1aD5Sp7nKHs8c/BlqVON+51G5CRB7erQI7qUux0OSs0qj2pNkcKzqnvEFCr
7QgXIZZT7V3ibRlS+rbx7bD83niObbajBfazvkGMGja+kmNJNUJqnKyiKGIPWXO4
ZnKR2OTvIHJbfN+D/S/CmS6vB5JK3MpFGo9jhjWQsDtF6Qi2IP5wvpfFC3WYRd5X
GjVqRasOyfn5vD+2mlQkynzz+JxwLsN7KCkLtl7VoB7FSBsepDfb0Xcj9xSNrIeR
+gZW4qNhoZI3E7X42j9Di7m/ufpalMRbdrJhrjBFZ9iEOGTvaeXbUH+9CgQYx/AO
M160Ni2jeMwMYQRfWSez
=qGxu
-----END PGP SIGNATURE-----

Binary file not shown.

View file

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJdv1y2CRDyhd/lbC6UxQAAr10QAE48PdGzWmsO7a8cW34kh1Zy
B6CtS6qO08cWL0PpM5aWPCY9XfEuUCDTxbAZn8/t6x3zA6Me83R8e3nR9JeBIAfT
EH7a4LqCm3Sh+TaGp3ej6ZgGxk/GFhBV3jKUCQ8Lkz6NwLc4SXgNzMoG04iX9be4
E2JvwhMSLEePmgmFPX6Pm2IBgL1cfE5iQVKG2IlM55+am0m9DQtcgOCs0UCKuL9X
sUY2wfbn8HYjQyg2c1QrJWCUytEcjHPOPHA6ou8hs84uIHOaBEXalK2O5Gtb6QHZ
byZ7w6zwfQrvyiwh/k7dfVHMYU1O0uYODPHRDvTEWL8eWZAce4sE5bZBj1bfAonI
Mr08oBi1tyLQFj5h52OHJXYipujZxM9XSEfyINCvnl8cPH+lO+QOmmbKN2AQPGco
0+W5VO045RTo6HvmO/9TDeD7TmpBRp/UwKdmlt9ztv1quKORxn7pVAaxobSlXtml
VWUwDlII0jNm4lMVclEvfIC3TUvouSQQ6p1pjyuWJzCEUepD2ErBxJDvw+UbyvSW
rMvuGMBw88tZCZ4xDJgQWINQbyAXLeDy1cmY3ihz9vxvs2K2yro0bQ6bYXdTeaUp
q1NJRCy12zQxchEQGHOYXGrrnRPB6NT8G28525sut6ZPKGi0YMeKAqcr3cC+PUw3
nZ79mmRXz2Boh7GJHRLC
=UMek
-----END PGP SIGNATURE-----

Binary file not shown.

View file

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJdv1zfCRDyhd/lbC6UxQAAof4QAGSzQwrUyRnAeI6+ADmkd1kM
+nrqb2DBTNlXF1jI25YybMG0SOO+kazYgn8hSitVDgxzUwN9IVpYAavFSxnghbxn
QIBch/6ZdPY77Bi9ahe0zYdvRR+9xfM3LlsSgk/vXeIrzzPifhZD7G59EVklArj2
otU76idRXI7SPYu7b4cbmo8QpUXG4SKIZv9v1biFVS5RtTLQMcypmrl02OuzB9y0
4W/w11x1yZDZoOK43o8kOXtK+wTP6yT3kXtwUq2ryCIhx3e8Nw6jbGePsEYflHma
BeS6t8PrYGKNWRWbJfzxd3rneV6RL6t1ZiYtId0P1ZoWmjBjbdW5P563fOz3K3B8
Fzwg20klYoGOfQq+M/L+AQg/LYs8nSIYOgtApCFzSF8f41K2iYWzHrdHJC+ZctzH
ci0MetZcmCCxDu5BnvmvtXqs53CinYsSnCDfAyaVw/AG30JLGnTgO+j5kNH0N/Og
XZQ5RSOmSajk/1DYG8Z0WYU9JRGFyMGtzsZ2l9eQaQsY/oCO8ZxZyiGy/6x7hoHt
3wvK2SoYjHSVYiWkTnv4fTkD08XBso79MDeNwESciRcQ9+L3taXqjt3e/Q6MuSiG
8nStad4GWKpuk7E7HZZPB++RQ2h2vtzIH+qlJfRpmjg+xPdcLQUlEGoIXFfql8B0
/ECtwwY9kkfHdlwIKVTg
=2Dl0
-----END PGP SIGNATURE-----

Binary file not shown.

View file

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
wsFcBAABCAAQBQJdv1zvCRDyhd/lbC6UxQAAp8AQABlG/K/XMOZCKkwarxq0senU
8rJzZSj9cEUyGIjteGWWHZsV+2XG08H7wCaQOJrSrT3xM/OF1FzeWAh/wqdq9jLX
xsfdzBYyBK0x785aM/Nyu9vwgnvUg+P5gwiyetljhCfVUKNRBqSoIJ+H5h7HaqF6
RKlIzi+Ezp12gvTUrmbq3pHiydNjdQyx7lqLqZBXzztZg/IImRG6p7oYB9XQxPBO
26OHQgI6scimLndWDtLcGqcGuV0vh1Kcl+NH52nUlkITYw2xdhAkEVyMDgefHT+Z
9yMuqKYaJKYSKHmwTqpEV4ptL/5fl+R76nZxy7IvYkXqyhnY93vLJiBA0gTIDN3x
tSEPYqc70pwxk6WNN+b9lLMkn5B1HrBIKd48DmcfxumSn106NV+6Tg8484xIMVAN
O1+Iy1hzXt9ul6e2343qDOvXZutq25giP88waYTB6144N2SK6m9O21woNXW2tC+S
dkDeZu1jWbBPu1UeEYIwO5Ftcd5ODZv62fJwQocUBJJZ+G8qHCBty1n7ulvbH9+r
qUMGeamY9eUXJPjwDRCTwA2KBgEHNITpqEaJ4AmVhGrDU4y3x6bUwZM9yE1uMRxO
RN7m1IZO4fhmAYNAMsELftqIXKe9emy8No4UKDZoi9gX29UUQYQSEdXkwiYQa0f3
0G+4QCQVYzC2enwuMMLn
=Z6oq
-----END PGP SIGNATURE-----

View file

@ -1,4 +1,5 @@
1599823de5bdeec2961375c68d13006b MailScanner-5.1.3-2.deb.tar.gz
4205546ec3c05771e1eef702d3cc9974 MailScanner-5.1.3-2.nix.tar.gz
c1d1d2165f1e431d32517e82afdc7b4d MailScanner-5.1.3-2.rhel.tar.gz
66ee42f780f581037a93e4517aafb54b MailScanner-5.1.3-2.suse.tar.gz
a9c8ef25cab12c25dc09efc110c5ddc3 MailScanner-5.2.1-1.rhel.noarch.rpm
161c4f461d00e004089ec709bd6fba18 MailScanner-5.2.1-1.suse.noarch.rpm
be016dc75d7f94fb5b26dc661739c2e9 MailScanner-5.2.1-1-noarch.deb
5cca1b2cb6f89921f34e75e5889db3b1 MailScanner-5.2.1-1.nix.tar.gz

View file

@ -1,4 +1,5 @@
1eae1c4a660e3a645afc94ea830a28a2ec09cd28 MailScanner-5.1.3-2.deb.tar.gz
31a6056672184eababb093fcbcd5d52a666df48d MailScanner-5.1.3-2.nix.tar.gz
281d2bbb4322b371a03aeaf192e9c6444c29fd24 MailScanner-5.1.3-2.rhel.tar.gz
910c47a63f04c8644f1e8ae3a3c51bb747ebff8b MailScanner-5.1.3-2.suse.tar.gz
28350d23738b7fba32006236d6263510797a8f20 MailScanner-5.2.1-1.nix.tar.gz
03f9a25950f3068a1f35f0ea17e5798f543d1945 MailScanner-5.2.1-1-noarch.deb
fc9d20c1f3e4b9805061093f6a28448928f3a9f2 MailScanner-5.2.1-1.rhel.noarch.rpm
2f2369390b64546e8ff3e4a1877dcda24d2b9cbf MailScanner-5.2.1-1.suse.noarch.rpm

View file

@ -1,4 +1,4 @@
8b3e4578c0f15234047b13a3d66bd20ff15441af8fcbb6004ad7899e832e8f1b MailScanner-5.1.3-2.deb.tar.gz
ec507dd3a273139875c9f8955987caf410bb4bfede7edf19a0bee7b30f013e04 MailScanner-5.1.3-2.nix.tar.gz
f2c10cfb16dda12e27f725ad698ba5aa4f00fd21c917e9faf6f0ed7980e7d6d4 MailScanner-5.1.3-2.rhel.tar.gz
65ebb3449d78a52abd06b893088276aef21005a466b283c8ad80c40ba6d666a0 MailScanner-5.1.3-2.suse.tar.gz
22804a93182b2d82c962e08fad7bad97ab4a2dddde6e3b26c38955bbba0e3c37 MailScanner-5.2.1-1.nix.tar.gz
4ef3101fc1b86e78ee58e21a533c0544e4e2918ccc05f8dd93c10b1d1265624a MailScanner-5.2.1-1-noarch.deb
d2d80b60967525db16f1024495bc154862efea0d319b52c549a185ed96f7324e MailScanner-5.2.1-1.rhel.noarch.rpm
b3ad701519d8f0c67c9e307cb39702af9c195c14016377f4a836da7145d8dcff MailScanner-5.2.1-1.suse.noarch.rpm

View file

@ -1,4 +1,4 @@
07/07/2019 Changes in v5.1.4-1
11/03/2019 Changes in v5.2.1-1
==================================
- External message warning support
@ -11,6 +11,7 @@
- Allow scan 7z archives if 'Find Archives By Content = no'
- Use correct callback in debug message in milter
- Honor whitelistmaxrecips in milter
- Refactor to host MailScanner using standard package management
03/03/2019 Changes in v5.1.3-3 (unreleased)
==================================

View file

@ -1,11 +0,0 @@
--- Mail-ClamAV-0.29/Makefile.PL 2009-04-29 19:06:39.000000000 +0000
+++ Mail-ClamAV-0.29/Makefile.PL2 2018-10-23 21:08:58.276867474 +0000
@@ -51,7 +51,7 @@
}
my $clver = get_cl_version();
- return warn_cl_version_bad() if $clver lt $minclversion;
+ # return warn_cl_version_bad() if $clver lt $minclversion;
my $inc = get_cl_inc_paths();
my $libs = get_cl_libs();

129
debian/DEBIAN/postinst vendored
View file

@ -25,43 +25,6 @@ if ! getent group mtagroup >/dev/null 2>&1; then
groupadd -f mtagroup >/dev/null 2>&1
fi
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
usermod -a -G mtagroup clam >/dev/null 2>&1
fi
if id -u clamav >/dev/null 2>&1; then
usermod -a -G mtagroup clamav >/dev/null 2>&1
fi
if id -u clamscan >/dev/null 2>&1; then
usermod -a -G mtagroup clamscan >/dev/null 2>&1
fi
if id -u vscan >/dev/null 2>&1; then
usermod -a -G mtagroup vscan >/dev/null 2>&1
fi
if id -u sophosav >/dev/null 2>&1; then
usermod -a -G mtagroup sophosav >/dev/null 2>&1
fi
if id -u Debian-exim >/dev/null 2>&1; then
usermod -a -G mtagroup Debian-exim >/dev/null 2>&1
fi
if id -u postfix >/dev/null 2>&1; then
usermod -a -G mtagroup postfix >/dev/null 2>&1
fi
if id -u mail >/dev/null 2>&1; then
usermod -a -G mtagroup mail >/dev/null 2>&1
fi
if id -u avast >/dev/null 2>&1; then
usermod -a -G mtagroup avast >/dev/null 2>&1
fi
if [ ! -d '/var/spool/MailScanner/archive' ]; then
mkdir -p /var/spool/MailScanner/archive
chmod 775 /var/spool/MailScanner/archive
@ -92,17 +55,6 @@ if [ ! -d '/var/spool/MailScanner/milterout' ]; then
chown root:mtagroup /var/spool/MailScanner/milterout
fi
if [ -d '/var/spool/exim4.in' ]; then
install -d -oDebian-exim -gmtagroup -m0750 /var/spool/exim4.in
install -d -oDebian-exim -gmtagroup -m0750 /var/spool/exim4.in/db
install -d -oDebian-exim -gmtagroup -m0750 /var/spool/exim4.in/input
install -d -oDebian-exim -gmtagroup -m0750 /var/spool/exim4.in/msglog
fi
if [ ! -d '/var/spool/mqueue.in' ]; then
perl -pi -e 's{Incoming Queue Dir = /var/spool/mqueue.in}{Incoming Queue Dir = /var/spool/mqueue}g;' /etc/MailScanner/MailScanner.conf
fi
# lock down some directory permissions
runasuser="mail"
if [ -x /usr/sbin/ms-peek ]; then
@ -144,11 +96,6 @@ if [ -f '/etc/MailScanner/spam.assassin.prefs.conf' ]; then
mv -f /etc/MailScanner/spam.assassin.prefs.conf /etc/MailScanner/spamassassin.conf
fi
# create symlink for spamasassin
if [ -d '/etc/mail/spamassassin' -a ! -L '/etc/mail/spamassassin/MailScanner.cf' -a -f '/etc/MailScanner/spamassassin.conf' -a ! -f '/etc/mail/spamassassin/MailScanner.cf' ]; then
ln -s /etc/MailScanner/spamassassin.conf /etc/mail/spamassassin/MailScanner.cf
fi
# remove old symlink if present
if [ -L '/etc/init.d/mailscanner' ]; then
rm -f /etc/init.d/mailscanner
@ -234,82 +181,6 @@ if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${OLDTHING}/${NEWTHING}/g" /etc/MailScanner/MailScanner.conf
fi
# fix the clamav wrapper if the user does not exist
if [ -d '/etc/clamav' ]; then
DISTROCAVUSER='ClamUser="clamav"';
DISTROCAVGRP='ClamGroup="clamav"';
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
CAVUSR='ClamUser="clam"';
fi
if id -u clamav >/dev/null 2>&1; then
CAVUSR='ClamUser="clamav"';
fi
if id -u clamscan >/dev/null 2>&1; then
CAVUSR='ClamUser="clamscan"';
fi
if getent group clamav >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamav"';
fi
if getent group clam >/dev/null 2>&1; then
CAVGRP='ClamGroup="clam"';
fi
if getent group clamscan >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamscan"';
fi
if [ -f '/usr/lib/MailScanner/wrapper/clamav-wrapper' ]; then
sed -i "s/${DISTROCAVUSER}/${CAVUSR}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
sed -i "s/${DISTROCAVGRP}/${CAVGRP}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
fi
if [ -f '/etc/apparmor.d/usr.sbin.clamd' ]; then
# add to include for clamd
if [ -f '/etc/apparmor.d/local/usr.sbin.clamd' ]; then
echo '/var/spool/MailScanner/incoming/** krw,' > /etc/apparmor.d/local/usr.sbin.clamd
echo '/var/spool/MailScanner/incoming/** ix,' >> /etc/apparmor.d/local/usr.sbin.clamd
fi
fi
# fix old style clamav Monitors if preset in old mailscanner.conf
CAVOLD='^Monitors for ClamAV Updates.*';
CAVNEW='Monitors for ClamAV Updates = \/usr\/local\/share\/clamav\/\*\.cld \/usr\/local\/share\/clamav\/\*\.cvd \/var\/lib\/clamav\/\*\.inc\/\* \/var\/lib\/clamav\/\*\.\?db \/var\/lib\/clamav\/\*\.cvd';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
fi
# set the correct sock for debian systems
CAVOLD='^Clamd Socket.*';
CAVNEW='Clamd Socket = \/var\/run\/clamav\/clamd\.ctl';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
# set the correct lock file for debian systems
CAVOLD='^Clamd Lock File.*';
CAVNEW='Clamd Lock File =';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
# allow supplementary groups
CAVOLD='^#AllowSupplementaryGroups.*';
CAVNEW='AllowSupplementaryGroups true';
if [ -f '/etc/clamav/clamd.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/clamav/clamd.conf
fi
if [ -f '/lib/systemd/systemd' -o -f '/usr/lib/systemd/systemd' ]; then
systemctl enable mailscanner.service
else

4
debian/changelog vendored
View file

@ -1,5 +1,5 @@
MailScanner (5.1.4-1) stable; urgency=low
MailScanner (5.2.1-1) stable; urgency=low
* Maintenance release
-- MailScanner Team <https://www.mailscanner.info> Sun, 07 July 2019 01:00:00 -0400
-- MailScanner Team <https://www.mailscanner.info> Sun, 03 November 2019 01:00:00 -0400

View file

@ -1,19 +1,13 @@
#!/usr/bin/env bash
#
# MailScanner installation script for Debian based systems
# MailScanner configuration script for Debian based systems
#
# This script installs the required software for
# MailScanner via apt-get and CPAN based on user input.
#
#
# Written by:
# Jerry Benton < mailscanner@mailborder.com >
# 29 APR 2016
# Updated By:
# Manuel Dalla Lana < endelwar@aregar.it >
# Shawn Iverson < shawniverson@gmail.com >
# 22 OCT 2018
# clear the screen. yay!
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
clear
# unattended install: command line parameter parsing
@ -445,11 +439,10 @@ ARMODAFTERSA+=('Mail::SpamAssassin::Plugin::DCC');
ARMODAFTERSA+=('Mail::SpamAssassin::Plugin::Pyzor');
# logging starts here
(
clear
echo;
echo "Installation results are being logged to mailscanner-install.log";
echo "Installation/configuration results are being logged to /var/log/mailscanner-configuration.log";
echo;
timewait 1
@ -594,18 +587,18 @@ if [ ${CPANOPTION} == 1 ]; then
fi
done
# Mail::ClamAV has broken version detection
# Prepare to patch and install
if [ $CAV -eq 1 ]; then
cpan -g Mail::ClamAV
package=$(find -name Mail-ClamAV*gz | tail -n1)
tar xzvf $package
packagedir=$(echo $package | sed -e 's/\.tar\.gz//')
patch -p1 $packagedir/Makefile.PL < patch.diff
cd $packagedir
perl Makefile.PL
make install
fi
# # Mail::ClamAV has broken version detection
# # Prepare to patch and install
# if [ $CAV -eq 1 ]; then
# cpan -g Mail::ClamAV
# package=$(find -name Mail-ClamAV*gz | tail -n1)
# tar xzvf $package
# packagedir=$(echo $package | sed -e 's/\.tar\.gz//')
# patch -p1 $packagedir/Makefile.PL < patch.diff
# cd $packagedir
# perl Makefile.PL
# make install
# fi
# Install MIME::Tools from CPAN even though rpm is present
# Fixes outdated MIME::Tools causing MailScanner to crash
@ -638,23 +631,155 @@ timewait ${PMODWAIT}
clear
echo;
echo "Installing the MailScanner .deb package ... ";
echo "Preparing MailScanner ... ";
# install the mailscanner package
dpkg -i ${CONFFILES} ${NODEPS} "${THISCURRPMDIR}"/MailScanner-*-noarch.deb
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
usermod -a -G mtagroup clam >/dev/null 2>&1
fi
if [ $? -ne 0 ]; then
echo;
echo '----------------------------------------------------------';
echo 'Installation Error'; echo;
echo 'The MailScanner package failed to install. Address the required';
echo 'dependencies and run the installer again.';
echo;
echo 'Note that Perl modules need to be available system-wide. A';
echo 'common issue is that missing modules were installed in a ';
echo 'user specific configuration.';
echo;
else
if id -u clamav >/dev/null 2>&1; then
usermod -a -G mtagroup clamav >/dev/null 2>&1
fi
if id -u clamscan >/dev/null 2>&1; then
usermod -a -G mtagroup clamscan >/dev/null 2>&1
fi
if id -u vscan >/dev/null 2>&1; then
usermod -a -G mtagroup vscan >/dev/null 2>&1
fi
if id -u sophosav >/dev/null 2>&1; then
usermod -a -G mtagroup sophosav >/dev/null 2>&1
fi
if id -u Debian-exim >/dev/null 2>&1; then
usermod -a -G mtagroup Debian-exim >/dev/null 2>&1
fi
if id -u postfix >/dev/null 2>&1; then
usermod -a -G mtagroup postfix >/dev/null 2>&1
fi
if id -u mail >/dev/null 2>&1; then
usermod -a -G mtagroup mail >/dev/null 2>&1
fi
if id -u avast >/dev/null 2>&1; then
usermod -a -G mtagroup avast >/dev/null 2>&1
fi
if [ -d '/var/spool/exim4.in' ]; then
chown Debian-exim:mtagroup /var/spool/exim4.in
chmod 0750 /var/spool/exim4.in
chown Debian-exim:mtagroup /var/spool/exim4.in/db
chmod 0750 /var/spool/exim4.in/db
chown Debian-exim:mtagroup /var/spool/exim4.in/input
chmod 0750 /var/spool/exim4.in/input
chown Debian-exim:mtagroup /var/spool/exim4.in/msglog
chmod 0750 /var/spool/exim4.in/msglog
fi
if [ ! -d '/var/spool/mqueue.in' ]; then
perl -pi -e 's{Incoming Queue Dir = /var/spool/mqueue.in}{Incoming Queue Dir = /var/spool/mqueue}g;' /etc/MailScanner/MailScanner.conf
fi
# create symlink for spamasassin
if [ -d '/etc/mail/spamassassin' -a ! -L '/etc/mail/spamassassin/MailScanner.cf' -a -f '/etc/MailScanner/spamassassin.conf' -a ! -f '/etc/mail/spamassassin/MailScanner.cf' ]; then
ln -s /etc/MailScanner/spamassassin.conf /etc/mail/spamassassin/MailScanner.cf
fi
# fix the clamav wrapper if the user does not exist
if [ -d '/etc/clamav' ]; then
DISTROCAVUSER='ClamUser="clamav"';
DISTROCAVGRP='ClamGroup="clamav"';
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
CAVUSR='ClamUser="clam"';
fi
if id -u clamav >/dev/null 2>&1; then
CAVUSR='ClamUser="clamav"';
fi
if id -u clamscan >/dev/null 2>&1; then
CAVUSR='ClamUser="clamscan"';
fi
if getent group clamav >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamav"';
fi
if getent group clam >/dev/null 2>&1; then
CAVGRP='ClamGroup="clam"';
fi
if getent group clamscan >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamscan"';
fi
if [ -f '/usr/lib/MailScanner/wrapper/clamav-wrapper' ]; then
sed -i "s/${DISTROCAVUSER}/${CAVUSR}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
sed -i "s/${DISTROCAVGRP}/${CAVGRP}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
fi
if [ -f '/etc/apparmor.d/usr.sbin.clamd' ]; then
# add to include for clamd
if [ -f '/etc/apparmor.d/local/usr.sbin.clamd' ]; then
echo '/var/spool/MailScanner/incoming/** krw,' > /etc/apparmor.d/local/usr.sbin.clamd
echo '/var/spool/MailScanner/incoming/** ix,' >> /etc/apparmor.d/local/usr.sbin.clamd
fi
fi
# fix old style clamav Monitors if preset in old mailscanner.conf
CAVOLD='^Monitors for ClamAV Updates.*';
CAVNEW='Monitors for ClamAV Updates = \/usr\/local\/share\/clamav\/\*\.cld \/usr\/local\/share\/clamav\/\*\.cvd \/var\/lib\/clamav\/\*\.inc\/\* \/var\/lib\/clamav\/\*\.\?db \/var\/lib\/clamav\/\*\.cvd';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
fi
# set the correct sock for debian systems
CAVOLD='^Clamd Socket.*';
CAVNEW='Clamd Socket = \/var\/run\/clamav\/clamd\.ctl';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
# set the correct lock file for debian systems
CAVOLD='^Clamd Lock File.*';
CAVNEW='Clamd Lock File =';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
# allow supplementary groups
CAVOLD='^#AllowSupplementaryGroups.*';
CAVNEW='AllowSupplementaryGroups true';
if [ -f '/etc/clamav/clamd.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/clamav/clamd.conf
fi
# # install the mailscanner package
# dpkg -i ${CONFFILES} ${NODEPS} "${THISCURRPMDIR}"/MailScanner-*-noarch.deb
# if [ $? -ne 0 ]; then
# echo;
# echo '----------------------------------------------------------';
# echo 'Installation Error'; echo;
# echo 'The MailScanner package failed to install. Address the required';
# echo 'dependencies and run the installer again.';
# echo;
# echo 'Note that Perl modules need to be available system-wide. A';
# echo 'common issue is that missing modules were installed in a ';
# echo 'user specific configuration.';
# echo;
# else
# create ramdisk
if [ $RAMDISK -eq 1 ]; then
if [ -d '/var/spool/MailScanner/incoming' ]; then
@ -689,16 +814,69 @@ else
ldconfig
echo;
echo '----------------------------------------------------------';
echo 'Installation Complete'; echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo 'Review: Set your preferences in /etc/MailScanner/MailScanner.conf'
echo 'and review /etc/MailScanner/defaults';
echo;
fi
if [[ -n "${arg_update+x}" ]]; then
echo;
echo '----------------------------------------------------------';
echo 'Configuration and module update complete';
echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo To finish updating MailScanner, review the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo Restart MailScanner
echo
echo --SysV Init--
echo service mailscanner restart
echo
echo --Systemd--
echo systemctl restart mailscanner.service
echo
echo Restart MSMilter \(if in use\)
echo
echo --SysV Init--
echo service msmilter restart
echo
echo --Systemd--
echo systemctl restart msmilter.service
echo
else
echo;
echo '----------------------------------------------------------';
echo 'Initial configuration and module installation complete';
echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo To finish configuring MailScanner, edit the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo
echo To activate MailScanner run the following commands:
echo
echo --SysV Init--
echo service mailscanner start
echo
echo --Systemd--
echo systemctl start mailscanner.service
echo
echo To activate MSMilter \(if in use\) run the following commands:
echo
echo --SysV Init--
echo chkconfig msmilter on
echo service msmilter start
echo
echo --Systemd--
echo systemctl enable msmilter.service
echo systemctl start msmilter.service
echo
fi
) 2>&1 | tee mailscanner-install.log
) 2>&1 | tee -a /var/log/mailscanner-configuration.log

View file

@ -10,9 +10,11 @@
# Manual: https://s3.amazonaws.com/msv5/docs/ms-admin-guide.pdf
#
# Support: http://lists.mailscanner.info/mailman/listinfo/mailscanner
#
# Jerry Benton - 3 May 2016
#
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
#
The install for NIX* is very straightforward. It simply copies the files into place. From
there you will need to create the links to get MailScanner to start at boot.

View file

@ -3,9 +3,8 @@
# MailScanner installation script for NIX* based systems
#
#
# Written by:
# Jerry Benton < mailscanner@mailborder.com >
# 3 MAY 2016
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
# clear the screen. yay!
clear

View file

@ -8,7 +8,7 @@
Name: %{name}
Version: %{version}
Release: %{release}
Release: %{release}.rhel
Summary: Email Gateway Virus Scanner with Malware, Phishing, and Spam Detection
Group: System Environment/Daemons
License: GPLv2
@ -20,7 +20,7 @@ Provides: perl(MailScanner), perl(MailScanner::Antiword), perl(MailScanner::
Source: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-root
BuildArchitectures: noarch
AutoReqProv: yes
AutoReqProv: no
Obsoletes: mailscanner
@ -35,7 +35,7 @@ protect it against Denial Of Service attacks.
After installation, you must install one of the supported open source or
commercial antivirus packages if not installed using the MailScanner
installation script.
configuration script.
This has been tested on Red Hat Linux, but should work on other RPM
based Linux distributions.
@ -55,6 +55,7 @@ mkdir -p ${RPM_BUILD_ROOT}/usr/share/MailScanner/reports/{hu,de,se,ca,cy+en,pt_b
mkdir -p ${RPM_BUILD_ROOT}/usr/share/MailScanner/perl/{MailScanner,custom}
mkdir -p ${RPM_BUILD_ROOT}/usr/{lib/MailScanner/wrapper,lib/MailScanner/init,lib/MailScanner/systemd}
mkdir -p ${RPM_BUILD_ROOT}/var/spool/MailScanner/{archive,incoming,quarantine,milterin,milterout}
mkdir -p ${RPM_BUILD_ROOT}/usr/share/MailScanner/doc
### etc
install etc/cron.daily/mailscanner ${RPM_BUILD_ROOT}/etc/cron.daily/
@ -120,7 +121,7 @@ install usr/sbin/ms-update-phishing ${RPM_BUILD_ROOT}/usr/sbin/m
install usr/sbin/ms-update-sa ${RPM_BUILD_ROOT}/usr/sbin/ms-update-sa
install usr/sbin/ms-update-vs ${RPM_BUILD_ROOT}/usr/sbin/ms-update-vs
install usr/sbin/ms-upgrade-conf ${RPM_BUILD_ROOT}/usr/sbin/ms-upgrade-conf
install usr/sbin/ms-configure ${RPM_BUILD_ROOT}/usr/sbin/ms-configure
### usr/share/MailScanner
@ -222,6 +223,15 @@ SpamWhitelist.pm
ZMRouterDirHash.pm
EOF
while read f
do
install usr/share/MailScanner/doc/$f ${RPM_BUILD_ROOT}/usr/share/MailScanner/doc/
done << EOF
changelog
README
LICENSE
EOF
### usr/lib/MailScanner
install usr/lib/MailScanner/init/ms-init ${RPM_BUILD_ROOT}/usr/lib/MailScanner/init/
@ -375,11 +385,9 @@ exit 0
# back up their stuff
SAVEDIR="$HOME/ms_upgrade/saved.$$";
# allow supplementary groups
CAVOLD='^#AllowSupplementaryGroups.*';
CAVNEW='AllowSupplementaryGroups yes';
if [ -f '/etc/clamd.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/clamd.conf
if [ ! -d '/var/spool/MailScanner/archive' ]; then
mkdir -p /var/spool/MailScanner/archive
chmod 775 /var/spool/MailScanner/archive
fi
# group for users to run under
@ -387,44 +395,6 @@ if ! getent group mtagroup >/dev/null 2>&1; then
groupadd -f mtagroup >/dev/null 2>&1
fi
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
usermod -a -G mtagroup clam >/dev/null 2>&1
fi
if id -u clamav >/dev/null 2>&1; then
usermod -a -G mtagroup clamav >/dev/null 2>&1
fi
if id -u clamscan >/dev/null 2>&1; then
usermod -a -G mtagroup clamscan >/dev/null 2>&1
fi
if id -u vscan >/dev/null 2>&1; then
usermod -a -G mtagroup vscan >/dev/null 2>&1
fi
if id -u sophosav >/dev/null 2>&1; then
usermod -a -G mtagroup sophosav >/dev/null 2>&1
fi
if id -u postfix >/dev/null 2>&1; then
usermod -a -G mtagroup postfix >/dev/null 2>&1
fi
if id -u mail >/dev/null 2>&1; then
usermod -a -G mtagroup mail >/dev/null 2>&1
fi
if id -u avast >/dev/null 2>&1; then
usermod -a -G mtagroup avast >/dev/null 2>&1
fi
if [ ! -d '/var/spool/MailScanner/archive' ]; then
mkdir -p /var/spool/MailScanner/archive
chmod 775 /var/spool/MailScanner/archive
fi
if [ $(stat -c "%G" /var/spool/MailScanner/archive) == 'root' ]; then
chgrp mtagroup /var/spool/MailScanner/archive
fi
@ -478,11 +448,6 @@ if [ -f '/etc/MailScanner/spam.assassin.prefs.conf' ]; then
mv -f /etc/MailScanner/spam.assassin.prefs.conf /etc/MailScanner/spamassassin.conf
fi
# create symlink for spamasassin
if [ -d '/etc/mail/spamassassin' -a ! -L '/etc/mail/spamassassin/MailScanner.cf' -a -f '/etc/MailScanner/spamassassin.conf' -a ! -f '/etc/mail/spamassassin/MailScanner.cf' ]; then
ln -s /etc/MailScanner/spamassassin.conf /etc/mail/spamassassin/MailScanner.cf
fi
# check for rpmnew, if present, and move in place for upgrade
if [ -f /etc/MailScanner/MailScanner.conf.rpmnew ]; then
cp -f /etc/MailScanner/MailScanner.conf.rpmnew /etc/MailScanner/MailScanner.conf
@ -519,55 +484,6 @@ if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${OLDTHING}/${NEWTHING}/g" /etc/MailScanner/MailScanner.conf
fi
# fix the clamav wrapper if the user does not exist
if [ -d '/etc/clamav' ]; then
DISTROCAVUSER='ClamUser="clamav"';
DISTROCAVGRP='ClamGroup="clamav"';
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
CAVUSR='ClamUser="clam"';
fi
if id -u clamav >/dev/null 2>&1; then
CAVUSR='ClamUser="clamav"';
fi
if id -u clamscan >/dev/null 2>&1; then
CAVUSR='ClamUser="clamscan"';
fi
if id -u vscan >/dev/null 2>&1; then
CAVUSR='ClamUser="vscan"';
fi
if getent group clamav >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamav"';
fi
if getent group clam >/dev/null 2>&1; then
CAVGRP='ClamGroup="clam"';
fi
if getent group clamscan >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamscan"';
fi
if [ -f '/usr/lib/MailScanner/wrapper/clamav-wrapper' ]; then
sed -i "s/${DISTROCAVUSER}/${CAVUSR}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
sed -i "s/${DISTROCAVGRP}/${CAVGRP}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
fi
# fix old style clamav Monitors if preset in old mailscanner.conf
CAVOLD='^Monitors for ClamAV Updates.*';
CAVNEW='Monitors for ClamAV Updates = \/usr\/local\/share\/clamav\/\*\.cld \/usr\/local\/share\/clamav\/\*\.cvd \/var\/lib\/clamav\/\*\.inc\/\* \/var\/lib\/clamav\/\*\.\?db \/var\/lib\/clamav\/\*\.cvd';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
fi
# softlink for custom functions
if [ -d '/usr/share/MailScanner/perl/custom' -a ! -L '/etc/MailScanner/custom' ]; then
ln -s /usr/share/MailScanner/perl/custom /etc/MailScanner/custom
@ -628,46 +544,13 @@ else
fi
echo
echo To initially configure MailScanner and install necessary modules run:
echo
echo /usr/sbin/ms-configure
echo
echo To configure MailScanner, edit the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo
echo To activate MailScanner run the following commands:
echo
echo --SysV Init--
echo chkconfig mailscanner on
echo service mailscanner start
echo
echo --Systemd--
echo systemctl enable mailscanner.service
echo systemctl start mailscanner.service
echo
echo To activate Sendmail for Mailscanner \(if in use\) run the following commands:
echo
echo --SysV Init--
echo chkconfig sendmail off
echo chkconfig sm-client off
echo chkconfig ms-sendmail on
echo service ms-sendmail start
echo
echo --Systemd--
echo systemctl disable sendmail.service
echo systemctl disable sm-client.service
echo systemctl enable ms-sendmail.service
echo systemctl start ms-sendmail.service
echo
echo To activate MSMilter for Mailscanner \(if in use\) run the following commands:
echo
echo --SysV Init--
echo chkconfig msmilter on
echo service msmilter start
echo
echo --Systemd--
echo systemctl enable msmilter.service
echo systemctl start msmilter.service
echo To update MailScanner and necessary modules run:
echo
echo /usr/sbin/ms-configure --update
echo
exit 0
@ -720,6 +603,7 @@ exit 0
%attr(755,root,root) %dir /usr/lib/MailScanner/init
%attr(755,root,root) %dir /usr/lib/MailScanner/systemd
%attr(755,root,root) %dir /usr/share/MailScanner
%attr(755,root,root) %dir /usr/share/MailScanner/doc
%attr(755,root,root) %dir /usr/share/MailScanner/perl
%attr(755,root,root) %dir /usr/share/MailScanner/perl/custom
%attr(755,root,root) %dir /usr/share/MailScanner/perl/MailScanner
@ -747,6 +631,7 @@ exit 0
%attr(755,root,root) /usr/sbin/ms-update-sa
%attr(755,root,root) /usr/sbin/ms-update-vs
%attr(755,root,root) /usr/sbin/ms-upgrade-conf
%attr(755,root,root) /usr/sbin/ms-configure
%attr(755,root,root) /usr/lib/MailScanner/init/ms-init
%attr(755,root,root) /usr/lib/MailScanner/init/ms-sendmail-init
@ -852,6 +737,10 @@ exit 0
%config(noreplace) /etc/MailScanner/rules/spam.whitelist.rules
%config(noreplace) /etc/MailScanner/rules/external.message.rules
%attr(644,root,root) /usr/share/MailScanner/doc/changelog
%attr(644,root,root) /usr/share/MailScanner/doc/LICENSE
%attr(644,root,root) /usr/share/MailScanner/doc/README
%config(noreplace) /usr/share/MailScanner/reports/en/deleted.content.message.txt
%config(noreplace) /usr/share/MailScanner/reports/en/stored.content.message.txt
%config(noreplace) /usr/share/MailScanner/reports/en/sender.content.report.txt
@ -1334,6 +1223,9 @@ exit 0
%config(noreplace) /usr/share/MailScanner/reports/ca/stored.virus.message.txt
%changelog
* Sat Nov 02 2019 Shawn Iverson <shawniverson@efa-project.org>
- Refactor for standard package management
* Sun Jul 07 2019 Shawn Iverson <shawniverson@efa-project.org>
- Add back directories to files section and test group membership

View file

@ -1,26 +1,21 @@
#!/bin/bash
#
# MailScanner installation script for RPM based systems
# MailScanner Configuration script for RPM based systems
#
# This script installs the required software for
# MailScanner via yum and CPAN based on user input.
#
# Tested distributions: CentOS 5,6,7
# RHEL 6,7
# Fedora 26,27,28
# Tested distributions: CentOS 5,6,7 (8 Pending)
# RHEL 6,7 (8 Pending)
# Fedora 26,27,28 (29-31 Pending)
#
# Written by:
# Jerry Benton < mailscanner@mailborder.com >
# 29 APR 2016
# Updated by:
# Manuel Dalla Lana < endelwar@aregar.it >
# Shawn Iverson < shawniverson@efa-project.org >
# 17 JUN 2018
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
# clear the screen. yay!
clear
# unattended install: command line parameter parsing
# unattended configuration: command line parameter parsing
parsedCommands=0;
while [ $# -gt 0 ]; do
case "$1" in
@ -246,7 +241,7 @@ timewait () {
if [ $(whoami) != "root" ]; then
clear
echo;
echo "Installer must be run as root. Aborting. Use 'su -' to switch to the root environment."; echo;
echo "Configuration must be run as root. Aborting. Use 'su -' to switch to the root environment."; echo;
exit 192
fi
@ -255,7 +250,7 @@ if [ ! -x '/usr/bin/yum' ]; then
clear
echo;
echo "Yum package manager is not installed. You must install this before starting";
echo "the MailScanner installation process. Installation aborted."; echo;
echo "the MailScanner configuration process. Configuration aborted."; echo;
exit 192
else
YUM='/usr/bin/yum';
@ -263,8 +258,8 @@ fi
# confirm the RHEL release is known before continuing
if [ ! -f '/etc/redhat-release' ]; then
# this is mostly to prevent accidental installation on a non redhat based system
echo "Unable to determine distribution release from /etc/redhat-release. Installation aborted."; echo;
# this is mostly to prevent accidental configuration on a non redhat based system
echo "Unable to determine distribution release from /etc/redhat-release. Configuration aborted."; echo;
exit 192
else
# figure out what release is being used
@ -302,15 +297,15 @@ if [ -f /etc/fedora-release ]; then
fi
# user info screen before the install process starts
echo "MailScanner Installation for RPM Based Systems"; echo; echo;
echo "MailScanner Configurataion for RPM Based Systems"; echo; echo;
echo "This will INSTALL or UPGRADE the required software for MailScanner on RPM based systems";
echo "via the Yum package manager. Supported distributions are RHEL 5,6,7 and associated";
echo "variants such as CentOS and Scientific Linux. Internet connectivity is required for";
echo "this installation script to execute. "; echo;
echo "this configurataion script to execute. "; echo;
echo;
echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING";
echo;
echo "You may press CTRL + C at any time to abort the installation. Note that you may see";
echo "You may press CTRL + C at any time to abort the configuration. Note that you may see";
echo "some errors during the perl module installation. You may safely ignore errors regarding";
echo "failed tests if you opt to use CPAN. You may also ignore 'No package available' notices";
echo "during the yum installation of packages."; echo;
@ -749,7 +744,7 @@ MACHINE_TYPE=`uname -m`
(
clear
echo;
echo "Installation results are being logged to mailscanner-install.log";
echo "Installation/configuration results are being logged to /var/log/mailscanner-configuration.log";
echo;
timewait 1
@ -1098,18 +1093,18 @@ if [[ -n "${arg_update+x}" && $AUTOCPAN -ne 0 ]]; then
cpan-outdated -p | cpanm --force --no-interactive
fi
# Mail::ClamAV has broken version detection
# Prepare to patch and install
if [[ $CAV -eq 1 && $CPANOPTION -eq 1 ]]; then
cpan -g Mail::ClamAV
package=$(find -name Mail-ClamAV*gz | tail -n1)
tar xzvf $package
packagedir=$(echo $package | sed -e 's/\.tar\.gz//')
patch -p1 $packagedir/Makefile.PL < patch.diff
cd $packagedir
perl Makefile.PL
make install
fi
# # Mail::ClamAV has broken version detection
# # Prepare to patch and install
# if [[ $CAV -eq 1 && $CPANOPTION -eq 1 ]]; then
# cpan -g Mail::ClamAV
# package=$(find -name Mail-ClamAV*gz | tail -n1)
# tar xzvf $package
# packagedir=$(echo $package | sed -e 's/\.tar\.gz//')
# patch -p1 $packagedir/Makefile.PL < /usr/share/MailScanner/patch/patch.diff
# cd $packagedir
# perl Makefile.PL
# make install
# fi
if [ $CPANOPTION -eq 1 ]; then
# Install MIME::Tools from CPAN even though rpm is present
@ -1154,54 +1149,151 @@ freshclam 2>/dev/null
cd "$THISCURRPMDIR"
clear
# echo;
# echo "Installing the MailScanner RPM ... ";
echo;
echo "Installing the MailScanner RPM ... ";
echo "Preparing MailScanner ..."
# install the mailscanner rpm
ABORT=0
# MailScanner version 4 will trigger an rpmsave during update
# MailScanner version 5 will not due to need to drop in a new MailScanner.conf
# during updating every time for comparison, so the following update process
# will cause MailScanner.conf to get overwritten in v5 if it is not moved first
mv /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.rpmsave >/dev/null 2>&1
# Pass #1 -- without scripts (bypasses prior pre and post uninstall scripts in older versions of mailscanner)
# This resolves two issues
# One is the presence of faulty pre and post scripts in v4 packages
# The second is the presence of a bug in earlier v5 packages during %post
$RPM -Uvh --noscripts $NODEPS MailScanner*noarch.rpm
if [ $? -eq 0 ]; then
# Move rpmsaves around so that scripts can find them
if [[ -e /etc/MailScanner/MailScanner.conf.rpmsave ]]; then
mv /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.rpmnew
mv /etc/MailScanner/MailScanner.conf.rpmsave /etc/MailScanner/MailScanner.conf
fi
if [[ -e /etc/MailScanner/spam.assassin.prefs.conf.rpmsave ]]; then
mv /etc/MailScanner/spam.assassin.prefs.conf.rpmsave /etc/MailScanner/spam.assassin.prefs.conf
fi
# Pass #2 -- with scripts
$RPM -Uvh --force $NODEPS MailScanner*noarch.rpm
[ $? -ne 0 ] && ABORT=1
else
ABORT=1
# allow supplementary groups
CAVOLD='^#AllowSupplementaryGroups.*';
CAVNEW='AllowSupplementaryGroups yes';
if [ -f '/etc/clamd.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/clamd.conf
fi
if [ $ABORT -eq 1 ]; then
echo;
echo '----------------------------------------------------------';
echo 'Installation Error'; echo;
echo 'The MailScanner RPM failed to install. Address the required';
echo 'dependencies and run the installer again. Note that electing';
echo 'to use EPEL and CPAN should resolve dependency errors.';
echo;
echo 'Note that Perl modules need to be available system-wide. A';
echo 'common issue is that missing modules were installed in a ';
echo 'user specific configuration.';
echo;
else
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
usermod -a -G mtagroup clam >/dev/null 2>&1
fi
if id -u clamav >/dev/null 2>&1; then
usermod -a -G mtagroup clamav >/dev/null 2>&1
fi
if id -u clamscan >/dev/null 2>&1; then
usermod -a -G mtagroup clamscan >/dev/null 2>&1
fi
if id -u vscan >/dev/null 2>&1; then
usermod -a -G mtagroup vscan >/dev/null 2>&1
fi
if id -u sophosav >/dev/null 2>&1; then
usermod -a -G mtagroup sophosav >/dev/null 2>&1
fi
if id -u postfix >/dev/null 2>&1; then
usermod -a -G mtagroup postfix >/dev/null 2>&1
fi
if id -u mail >/dev/null 2>&1; then
usermod -a -G mtagroup mail >/dev/null 2>&1
fi
if id -u avast >/dev/null 2>&1; then
usermod -a -G mtagroup avast >/dev/null 2>&1
fi
# create symlink for spamasassin
if [ -d '/etc/mail/spamassassin' -a ! -L '/etc/mail/spamassassin/MailScanner.cf' -a -f '/etc/MailScanner/spamassassin.conf' -a ! -f '/etc/mail/spamassassin/MailScanner.cf' ]; then
ln -s /etc/MailScanner/spamassassin.conf /etc/mail/spamassassin/MailScanner.cf
fi
# fix the clamav wrapper if the user does not exist
if [ -d '/etc/clamav' ]; then
DISTROCAVUSER='ClamUser="clamav"';
DISTROCAVGRP='ClamGroup="clamav"';
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
CAVUSR='ClamUser="clam"';
fi
if id -u clamav >/dev/null 2>&1; then
CAVUSR='ClamUser="clamav"';
fi
if id -u clamscan >/dev/null 2>&1; then
CAVUSR='ClamUser="clamscan"';
fi
if id -u vscan >/dev/null 2>&1; then
CAVUSR='ClamUser="vscan"';
fi
if getent group clamav >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamav"';
fi
if getent group clam >/dev/null 2>&1; then
CAVGRP='ClamGroup="clam"';
fi
if getent group clamscan >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamscan"';
fi
if [ -f '/usr/lib/MailScanner/wrapper/clamav-wrapper' ]; then
sed -i "s/${DISTROCAVUSER}/${CAVUSR}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
sed -i "s/${DISTROCAVGRP}/${CAVGRP}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
fi
# fix old style clamav Monitors if preset in old mailscanner.conf
CAVOLD='^Monitors for ClamAV Updates.*';
CAVNEW='Monitors for ClamAV Updates = \/usr\/local\/share\/clamav\/\*\.cld \/usr\/local\/share\/clamav\/\*\.cvd \/var\/lib\/clamav\/\*\.inc\/\* \/var\/lib\/clamav\/\*\.\?db \/var\/lib\/clamav\/\*\.cvd';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
fi
# # install the mailscanner rpm
# ABORT=0
# # MailScanner version 4 will trigger an rpmsave during update
# # MailScanner version 5 will not due to need to drop in a new MailScanner.conf
# # during updating every time for comparison, so the following update process
# # will cause MailScanner.conf to get overwritten in v5 if it is not moved first
# mv /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.rpmsave >/dev/null 2>&1
# # Pass #1 -- without scripts (bypasses prior pre and post uninstall scripts in older versions of mailscanner)
# # This resolves two issues
# # One is the presence of faulty pre and post scripts in v4 packages
# # The second is the presence of a bug in earlier v5 packages during %post
# $RPM -Uvh --noscripts $NODEPS MailScanner*noarch.rpm
# if [ $? -eq 0 ]; then
# # Move rpmsaves around so that scripts can find them
# if [[ -e /etc/MailScanner/MailScanner.conf.rpmsave ]]; then
# mv /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.rpmnew
# mv /etc/MailScanner/MailScanner.conf.rpmsave /etc/MailScanner/MailScanner.conf
# fi
# if [[ -e /etc/MailScanner/spam.assassin.prefs.conf.rpmsave ]]; then
# mv /etc/MailScanner/spam.assassin.prefs.conf.rpmsave /etc/MailScanner/spam.assassin.prefs.conf
# fi
# # Pass #2 -- with scripts
# $RPM -Uvh --force $NODEPS MailScanner*noarch.rpm
# [ $? -ne 0 ] && ABORT=1
# else
# ABORT=1
# fi
# if [ $ABORT -eq 1 ]; then
# echo;
# echo '----------------------------------------------------------';
# echo 'Installation Error'; echo;
# echo 'The MailScanner RPM failed to install. Address the required';
# echo 'dependencies and run the installer again. Note that electing';
# echo 'to use EPEL and CPAN should resolve dependency errors.';
# echo;
# echo 'Note that Perl modules need to be available system-wide. A';
# echo 'common issue is that missing modules were installed in a ';
# echo 'user specific configuration.';
# echo;
#else
# create ramdisk
if [ $RAMDISK -eq 1 ]; then
if [ -d '/var/spool/MailScanner/incoming' ]; then
@ -1242,15 +1334,92 @@ else
ldconfig
echo;
echo '----------------------------------------------------------';
echo 'Installation Complete'; echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo 'Review: Set your preferences in /etc/MailScanner/MailScanner.conf'
echo 'and review /etc/MailScanner/defaults';
fi
if [[ -n "${arg_update+x}" ]]; then
echo;
echo '----------------------------------------------------------';
echo 'Configuration and module update complete';
echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo To finish updating MailScanner, review the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo Restart MailScanner
echo
echo --SysV Init--
echo service mailscanner restart
echo
echo --Systemd--
echo systemctl restart mailscanner.service
echo
echo Restart Sendmail for Mailscanner \(if in use\)
echo
echo --SysV Init--
echo service ms-sendmail restart
echo
echo --Systemd--
echo systemctl restart ms-sendmail.service
echo
echo Restart MSMilter \(if in use\)
echo
echo --SysV Init--
echo service msmilter restart
echo
echo --Systemd--
echo systemctl restart msmilter.service
echo
else
echo;
echo '----------------------------------------------------------';
echo 'Initial configuration and module installation complete';
echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo To finish configuring MailScanner, edit the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo To activate MailScanner run the following commands:
echo
echo --SysV Init--
echo chkconfig mailscanner on
echo service mailscanner start
echo
echo --Systemd--
echo systemctl enable mailscanner.service
echo systemctl start mailscanner.service
echo
echo To activate Sendmail for Mailscanner \(if in use\) run the following commands:
echo
echo --SysV Init--
echo chkconfig sendmail off
echo chkconfig sm-client off
echo chkconfig ms-sendmail on
echo service ms-sendmail start
echo
echo --Systemd--
echo systemctl disable sendmail.service
echo systemctl disable sm-client.service
echo systemctl enable ms-sendmail.service
echo systemctl start ms-sendmail.service
echo
echo To activate MSMilter for Mailscanner \(if in use\) run the following commands:
echo
echo --SysV Init--
echo chkconfig msmilter on
echo service msmilter start
echo
echo --Systemd--
echo systemctl enable msmilter.service
echo systemctl start msmilter.service
echo
fi
) 2>&1 | tee mailscanner-install.log
) 2>&1 | tee -a /var/log/mailscanner-configuration.log

View file

@ -8,7 +8,7 @@
Name: %{name}
Version: %{version}
Release: %{release}
Release: %{release}.suse
Summary: Email Gateway Virus Scanner with Malware, Phishing, and Spam Detection
Group: System Environment/Daemons
License: GPLv2
@ -20,7 +20,7 @@ Provides: perl(MailScanner), perl(MailScanner::Antiword), perl(MailScanner:
Source: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-root
BuildArchitectures: noarch
AutoReqProv: yes
AutoReqProv: no
Obsoletes: mailscanner
@ -35,7 +35,7 @@ protect it against Denial Of Service attacks.
After installation, you must install one of the supported open source or
commercial antivirus packages if not installed using the MailScanner
installation script.
configuration script.
This has been tested on Red Hat Linux, but should work on other RPM
based Linux distributions.
@ -55,6 +55,7 @@ mkdir -p ${RPM_BUILD_ROOT}/usr/share/MailScanner/reports/{hu,de,se,ca,cy+en,pt_b
mkdir -p ${RPM_BUILD_ROOT}/usr/share/MailScanner/perl/{MailScanner,custom}
mkdir -p ${RPM_BUILD_ROOT}/usr/{lib/MailScanner/wrapper,lib/MailScanner/init,lib/MailScanner/systemd}
mkdir -p ${RPM_BUILD_ROOT}/var/spool/MailScanner/{archive,incoming,quarantine,milterin,milterout}
mkdir -p ${RPM_BUILD_ROOT}/usr/share/MailScanner/doc
### etc
install etc/cron.daily/mailscanner ${RPM_BUILD_ROOT}/etc/cron.daily/
@ -103,24 +104,24 @@ EOF
### usr/sbin
install usr/sbin/MailScanner ${RPM_BUILD_ROOT}/usr/sbin/MailScanner
install usr/sbin/MSMilter ${RPM_BUILD_ROOT}/usr/sbin/MSMilter
install usr/sbin/ms-check ${RPM_BUILD_ROOT}/usr/sbin/ms-check
install usr/sbin/ms-clean-quarantine ${RPM_BUILD_ROOT}/usr/sbin/ms-clean-quarantine
install usr/sbin/MailScanner ${RPM_BUILD_ROOT}/usr/sbin/MailScanner
install usr/sbin/MSMilter ${RPM_BUILD_ROOT}/usr/sbin/MSMilter
install usr/sbin/ms-check ${RPM_BUILD_ROOT}/usr/sbin/ms-check
install usr/sbin/ms-clean-quarantine ${RPM_BUILD_ROOT}/usr/sbin/ms-clean-quarantine
install usr/sbin/ms-create-locks ${RPM_BUILD_ROOT}/usr/sbin/ms-create-locks
install usr/sbin/ms-cron ${RPM_BUILD_ROOT}/usr/sbin/ms-cron
install usr/sbin/ms-d2mbox ${RPM_BUILD_ROOT}/usr/sbin/ms-d2mbox
install usr/sbin/ms-df2mbox ${RPM_BUILD_ROOT}/usr/sbin/ms-df2mbox
install usr/sbin/ms-msg-alert ${RPM_BUILD_ROOT}/usr/sbin/ms-msg-alert
install usr/sbin/ms-cron ${RPM_BUILD_ROOT}/usr/sbin/ms-cron
install usr/sbin/ms-d2mbox ${RPM_BUILD_ROOT}/usr/sbin/ms-d2mbox
install usr/sbin/ms-df2mbox ${RPM_BUILD_ROOT}/usr/sbin/ms-df2mbox
install usr/sbin/ms-msg-alert ${RPM_BUILD_ROOT}/usr/sbin/ms-msg-alert
install usr/sbin/ms-peek ${RPM_BUILD_ROOT}/usr/sbin/ms-peek
install usr/sbin/ms-perl-check ${RPM_BUILD_ROOT}/usr/sbin/ms-perl-check
install usr/sbin/ms-perl-check ${RPM_BUILD_ROOT}/usr/sbin/ms-perl-check
install usr/sbin/ms-sa-cache ${RPM_BUILD_ROOT}/usr/sbin/ms-sa-cache
install usr/sbin/ms-update-bad-emails ${RPM_BUILD_ROOT}/usr/sbin/ms-update-bad-emails
install usr/sbin/ms-update-phishing ${RPM_BUILD_ROOT}/usr/sbin/ms-update-phishing
install usr/sbin/ms-update-sa ${RPM_BUILD_ROOT}/usr/sbin/ms-update-sa
install usr/sbin/ms-update-vs ${RPM_BUILD_ROOT}/usr/sbin/ms-update-vs
install usr/sbin/ms-update-bad-emails ${RPM_BUILD_ROOT}/usr/sbin/ms-update-bad-emails
install usr/sbin/ms-update-phishing ${RPM_BUILD_ROOT}/usr/sbin/ms-update-phishing
install usr/sbin/ms-update-sa ${RPM_BUILD_ROOT}/usr/sbin/ms-update-sa
install usr/sbin/ms-update-vs ${RPM_BUILD_ROOT}/usr/sbin/ms-update-vs
install usr/sbin/ms-upgrade-conf ${RPM_BUILD_ROOT}/usr/sbin/ms-upgrade-conf
install usr/sbin/ms-configure ${RPM_BUILD_ROOT}/usr/sbin/ms-configure
### usr/share/MailScanner
@ -222,6 +223,15 @@ SpamWhitelist.pm
ZMRouterDirHash.pm
EOF
while read f
do
install usr/share/MailScanner/doc/$f ${RPM_BUILD_ROOT}/usr/share/MailScanner/doc/
done << EOF
changelog
README
LICENSE
EOF
### usr/lib/MailScanner
install usr/lib/MailScanner/init/ms-init ${RPM_BUILD_ROOT}/usr/lib/MailScanner/init/
@ -351,25 +361,9 @@ exit 0
# back up their stuff
SAVEDIR="$HOME/ms_upgrade/saved.$$";
# set the correct sock for suse systems
CAVOLD='^Clamd Socket.*';
CAVNEW='Clamd Socket = \/var\/run\/clamav\/clamd-socket';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
# set the correct lock file for suse systems
CAVOLD='^Clamd Lock File.*';
CAVNEW='Clamd Lock File = \/var\/run\/clamav\/clamd\.pid';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
# allow supplementary groups
CAVOLD='^#AllowSupplementaryGroups.*';
CAVNEW='AllowSupplementaryGroups yes';
if [ -f '/etc/clamd.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/clamd.conf
if [ ! -d '/var/spool/MailScanner/archive' ]; then
mkdir -p /var/spool/MailScanner/archive
chmod 775 /var/spool/MailScanner/archive
fi
# group for users to run under
@ -377,44 +371,6 @@ if ! getent group mtagroup >/dev/null 2>&1; then
groupadd -f mtagroup >/dev/null 2>&1
fi
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
usermod -a -G mtagroup clam >/dev/null 2>&1
fi
if id -u clamav >/dev/null 2>&1; then
usermod -a -G mtagroup clamav >/dev/null 2>&1
fi
if id -u clamscan >/dev/null 2>&1; then
usermod -a -G mtagroup clamscan >/dev/null 2>&1
fi
if id -u vscan >/dev/null 2>&1; then
usermod -a -G mtagroup vscan >/dev/null 2>&1
fi
if id -u sophosav >/dev/null 2>&1; then
usermod -a -G mtagroup sophosav >/dev/null 2>&1
fi
if id -u postfix >/dev/null 2>&1; then
usermod -a -G mtagroup postfix >/dev/null 2>&1
fi
if id -u mail >/dev/null 2>&1; then
usermod -a -G mtagroup mail >/dev/null 2>&1
fi
if id -u avast >/dev/null 2>&1; then
usermod -a -G mtagroup avast >/dev/null 2>&1
fi
if [ ! -d '/var/spool/MailScanner/archive' ]; then
mkdir -p /var/spool/MailScanner/archive
chmod 775 /var/spool/MailScanner/archive
fi
if [ $(stat -c "%G" /var/spool/MailScanner/archive) == 'root' ]; then
chgrp mtagroup /var/spool/MailScanner/archive
fi
@ -472,11 +428,6 @@ if [ -f '/etc/MailScanner/spam.assassin.prefs.conf' ]; then
mv -f /etc/MailScanner/spam.assassin.prefs.conf /etc/MailScanner/spamassassin.conf
fi
# create symlink for spamasassin
if [ -d '/etc/mail/spamassassin' -a ! -L '/etc/mail/spamassassin/MailScanner.cf' -a -f '/etc/MailScanner/spamassassin.conf' -a ! -f '/etc/mail/spamassassin/MailScanner.cf' ]; then
ln -s /etc/MailScanner/spamassassin.conf /etc/mail/spamassassin/MailScanner.cf
fi
# upgrade the old config
if [ -f /etc/MailScanner/MailScanner.conf.original -a -f /etc/MailScanner/MailScanner.conf ]; then
cp -f /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.dist
@ -507,55 +458,6 @@ if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${OLDTHING}/${NEWTHING}/g" /etc/MailScanner/MailScanner.conf
fi
# fix the clamav wrapper if the user does not exist
if [ -d '/etc/clamav' ]; then
DISTROCAVUSER='ClamUser="clamav"';
DISTROCAVGRP='ClamGroup="clamav"';
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
CAVUSR='ClamUser="clam"';
fi
if id -u clamav >/dev/null 2>&1; then
CAVUSR='ClamUser="clamav"';
fi
if id -u clamscan >/dev/null 2>&1; then
CAVUSR='ClamUser="clamscan"';
fi
if id -u vscan >/dev/null 2>&1; then
CAVUSR='ClamUser="vscan"';
fi
if getent group clamav >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamav"';
fi
if getent group clam >/dev/null 2>&1; then
CAVGRP='ClamGroup="clam"';
fi
if getent group clamscan >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamscan"';
fi
if [ -f '/usr/lib/MailScanner/wrapper/clamav-wrapper' ]; then
sed -i "s/${DISTROCAVUSER}/${CAVUSR}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
sed -i "s/${DISTROCAVGRP}/${CAVGRP}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
fi
# fix old style clamav Monitors if preset in old mailscanner.conf
CAVOLD='^Monitors for ClamAV Updates.*';
CAVNEW='Monitors for ClamAV Updates = \/usr\/local\/share\/clamav\/\*\.cld \/usr\/local\/share\/clamav\/\*\.cvd \/var\/lib\/clamav\/\*\.inc\/\* \/var\/lib\/clamav\/\*\.\?db \/var\/lib\/clamav\/\*\.cvd';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
fi
# softlink for custom functions
if [ -d '/usr/share/MailScanner/perl/custom' -a ! -L '/etc/MailScanner/custom' ]; then
ln -s /usr/share/MailScanner/perl/custom/ /etc/MailScanner/custom
@ -589,32 +491,13 @@ elif [ -d '/etc/init.d' -a ! -L '/etc/init.d/mailscanner' -a -f '/usr/lib/MailSc
fi
echo
echo To initially configure MailScanner and install necessary modules run:
echo
echo /usr/sbin/ms-configure
echo
echo To configure MailScanner, edit the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo
echo To activate MailScanner run the following commands:
echo
echo --SysV Init--
echo chkconfig mailscanner on
echo service mailscanner start
echo
echo --Systemd--
echo systemctl enable mailscanner.service
echo systemctl start mailscanner.service
echo
echo To activate MSMilter \(if in use\) run the following commands:
echo
echo --SysV Init--
echo chkconfig msmilter on
echo service msmilter start
echo
echo --Systemd--
echo systemctl enable msmilter.service
echo systemctl start msmilter.service
echo To update MailScanner and necessary modules run:
echo
echo /usr/sbin/ms-configure --update
echo
%preun
@ -654,6 +537,7 @@ exit 0
%attr(755,root,root) %dir /usr/lib/MailScanner/init
%attr(755,root,root) %dir /usr/lib/MailScanner/systemd
%attr(755,root,root) %dir /usr/share/MailScanner
%attr(755,root,root) %dir /usr/share/MailScanner/doc
%attr(755,root,root) %dir /usr/share/MailScanner/perl
%attr(755,root,root) %dir /usr/share/MailScanner/perl/custom
%attr(755,root,root) %dir /usr/share/MailScanner/perl/MailScanner
@ -681,6 +565,7 @@ exit 0
%attr(755,root,root) /usr/sbin/ms-update-sa
%attr(755,root,root) /usr/sbin/ms-update-vs
%attr(755,root,root) /usr/sbin/ms-upgrade-conf
%attr(755,root,root) /usr/sbin/ms-configure
%attr(755,root,root) /usr/lib/MailScanner/init/ms-init
%attr(755,root,root) /usr/lib/MailScanner/init/msmilter-init
@ -781,6 +666,10 @@ exit 0
%config(noreplace) /etc/MailScanner/rules/spam.whitelist.rules
%config(noreplace) /etc/MailScanner/rules/external.message.rules
%attr(644,root,root) /usr/share/MailScanner/doc/changelog
%attr(644,root,root) /usr/share/MailScanner/doc/LICENSE
%attr(644,root,root) /usr/share/MailScanner/doc/README
%config(noreplace) /usr/share/MailScanner/reports/en/deleted.content.message.txt
%config(noreplace) /usr/share/MailScanner/reports/en/stored.content.message.txt
%config(noreplace) /usr/share/MailScanner/reports/en/sender.content.report.txt
@ -1263,6 +1152,9 @@ exit 0
%config(noreplace) /usr/share/MailScanner/reports/ca/stored.virus.message.txt
%changelog
* Sat Nov 02 2019 Shawn Iverson <shawniverson@efa-project.org>
- Refactor for standard package management
* Sun Jul 07 2019 Shawn Iverson <shawniverson@efa-project.org>
- Add back directories to files section and test group membership

View file

@ -1,24 +1,19 @@
#!/usr/bin/env bash
#
# MailScanner installation script for SUSE based systems
# MailScanner configuration script for SUSE based systems
#
# This script installs the required software for
# MailScanner via zypper and CPAN based on user input.
#
# Tested distributions: OpenSUSE 13.2-42.3
# Tested distributions: OpenSUSE 13.2-42.3 (Leap 15.1 Pending)
#
# Written by:
# Jerry Benton < mailscanner@mailborder.com >
# 3 MAY 2016
# Updated by:
# Manuel Dalla Lana < endelwar@aregar.it >
# Shawn Iverson < shawniverson@efa-project.org >
# 17 JUN 2018
# Updated: 2 Nov 2019
# MailScanner Team <https://www.mailscanner.info>
# clear the screen. yay!
clear
# unattended install: command line parameter parsing
# unattended configuration: command line parameter parsing
parsedCommands=0;
while [ $# -gt 0 ]; do
case "$1" in
@ -95,7 +90,7 @@ while [ $# -gt 0 ]; do
;;
--help)
printf "MailScanner Installation for SuSE Based Systems\n\n"
printf "MailScanner configuration for SuSE Based Systems\n\n"
printf "Usage: %s [--update] [--MTA=sendmail|postfix|exim|none] [--installClamav=Y|N] [--installCPAN=Y|N] [--ignoreDeps=Y|N] [--ramdiskSize=value]\n\n" "$0"
printf -- "--update Perform an update on an existing install using the following options (can be overridden):\n"
printf " --MTA=none (assumed already installed)\n"
@ -142,7 +137,7 @@ timewait () {
if [ $(whoami) != "root" ]; then
clear
echo;
echo "Installer must be run as root. Aborting. Use 'su -' to switch to the root environment."; echo;
echo "Configuration must be run as root. Aborting. Use 'su -' to switch to the root environment."; echo;
exit 192
fi
@ -151,7 +146,7 @@ if [ ! -x '/usr/bin/zypper' ]; then
clear
echo;
echo "Zypper package manager is not installed. You must install this before starting";
echo "the MailScanner installation process. Installation aborted."; echo;
echo "the MailScanner configuration process. Configuration aborted."; echo;
exit 192
else
ZYPPER='/usr/bin/zypper';
@ -160,19 +155,19 @@ fi
# confirm the RHEL release is known before continuing
if [ -f '/etc/redhat-release' ]; then
# this is mostly to prevent accidental installation on a non redhat based system
echo "This appears to be a Red Hat based system. This installer is for SuSE. Installation aborted."; echo;
echo "This appears to be a Red Hat based system. This configuration tool is for SuSE. Configuration aborted."; echo;
exit 192
fi
# user info screen before the install process starts
echo "MailScanner Installation for SUSE Based Systems"; echo; echo;
echo "MailScanner Configuration for SUSE Based Systems"; echo; echo;
echo "This will INSTALL or UPGRADE the required software for MailScanner on SuSE based systems";
echo "via the zypper package manager. Tested distributions are openSUSE 13.2 and associated";
echo "variants. Internet connectivity is required for this installation script to execute.";
echo "via the zypper package manager. Tested distributions are openSUSE 13.2+ and associated";
echo "variants. Internet connectivity is required for this configuration script to execute.";
echo;
echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING";
echo;
echo "You may press CTRL + C at any time to abort the installation. Note that you may see";
echo "You may press CTRL + C at any time to abort the configuration. Note that you may see";
echo "some errors during the perl module installation. You may safely ignore errors regarding";
echo "failed tests if you opt to use CPAN. You may also ignore 'No package available' notices";
echo "during the zypper installation of packages."; echo;
@ -316,7 +311,7 @@ if [ $CPANOPTION -ne 1 ]; then
clear
echo;
echo "Do you want to ignore MailScanner dependencies?"; echo;
echo "This will force install the MailScanner RPM package regardless of missing";
echo "This will force configure the MailScanner RPM package regardless of missing";
echo "dependencies. It is highly recommended that you DO NOT do this unless you";
echo "are debugging.";
echo;
@ -446,7 +441,7 @@ fi
(
clear
echo;
echo "Installation results are being logged to mailscanner-install.log";
echo "Installation/configuration results are being logged to /var/log/mailscanner-configuration.log";
echo;
timewait 1
@ -595,16 +590,16 @@ fi
# Mail::ClamAV has broken version detection
# Prepare to patch and install
if [[ $CAV -eq 1 && $CPANOPTION -eq 1 ]]; then
cpan -g Mail::ClamAV
package=$(find -name Mail-ClamAV*gz | tail -n1)
tar xzvf $package
packagedir=$(echo $package | sed -e 's/\.tar\.gz//')
patch -p1 $packagedir/Makefile.PL < patch.diff
cd $packagedir
perl Makefile.PL
make install
fi
# if [[ $CAV -eq 1 && $CPANOPTION -eq 1 ]]; then
# cpan -g Mail::ClamAV
# package=$(find -name Mail-ClamAV*gz | tail -n1)
# tar xzvf $package
# packagedir=$(echo $package | sed -e 's/\.tar\.gz//')
# patch -p1 $packagedir/Makefile.PL < /usr/share/MailScanner/patch/patch.diff
# cd $packagedir
# perl Makefile.PL
# make install
# fi
if [ $CPANOPTION -eq 1 ]; then
# Install MIME::Tools from CPAN even though rpm is present
@ -634,26 +629,134 @@ fi
clear
echo;
echo "Installing the MailScanner RPM ... ";
echo "Preparing MailScanner ... ";
# using --force option to reinstall the rpm if the same version is
# already installed. this will not overwrite configuration files
# as they are protected in the rpm spec file
$RPM -Uvh $NODEPS MailScanner*noarch.rpm
# set the correct sock for suse systems
CAVOLD='^Clamd Socket.*';
CAVNEW='Clamd Socket = \/var\/run\/clamav\/clamd-socket';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
if [ $? -ne 0 ]; then
echo;
echo '----------------------------------------------------------';
echo 'Installation Error'; echo;
echo 'The MailScanner RPM failed to install. Address the required';
echo 'dependencies and run the installer again. Note that electing';
echo 'to use CPAN should resolve dependency errors.';
echo;
echo 'Note that Perl modules need to be available system-wide. A';
echo 'common issue is that missing modules were installed in a ';
echo 'user specific configuration.';
echo;
else
# set the correct lock file for suse systems
CAVOLD='^Clamd Lock File.*';
CAVNEW='Clamd Lock File = \/var\/run\/clamav\/clamd\.pid';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
# allow supplementary groups
CAVOLD='^#AllowSupplementaryGroups.*';
CAVNEW='AllowSupplementaryGroups yes';
if [ -f '/etc/clamd.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/clamd.conf
fi
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
usermod -a -G mtagroup clam >/dev/null 2>&1
fi
if id -u clamav >/dev/null 2>&1; then
usermod -a -G mtagroup clamav >/dev/null 2>&1
fi
if id -u clamscan >/dev/null 2>&1; then
usermod -a -G mtagroup clamscan >/dev/null 2>&1
fi
if id -u vscan >/dev/null 2>&1; then
usermod -a -G mtagroup vscan >/dev/null 2>&1
fi
if id -u sophosav >/dev/null 2>&1; then
usermod -a -G mtagroup sophosav >/dev/null 2>&1
fi
if id -u postfix >/dev/null 2>&1; then
usermod -a -G mtagroup postfix >/dev/null 2>&1
fi
if id -u mail >/dev/null 2>&1; then
usermod -a -G mtagroup mail >/dev/null 2>&1
fi
if id -u avast >/dev/null 2>&1; then
usermod -a -G mtagroup avast >/dev/null 2>&1
fi
# create symlink for spamasassin
if [ -d '/etc/mail/spamassassin' -a ! -L '/etc/mail/spamassassin/MailScanner.cf' -a -f '/etc/MailScanner/spamassassin.conf' -a ! -f '/etc/mail/spamassassin/MailScanner.cf' ]; then
ln -s /etc/MailScanner/spamassassin.conf /etc/mail/spamassassin/MailScanner.cf
fi
# fix the clamav wrapper if the user does not exist
if [ -d '/etc/clamav' ]; then
DISTROCAVUSER='ClamUser="clamav"';
DISTROCAVGRP='ClamGroup="clamav"';
# check for common users and add to the mtagroup
if id -u clam >/dev/null 2>&1; then
CAVUSR='ClamUser="clam"';
fi
if id -u clamav >/dev/null 2>&1; then
CAVUSR='ClamUser="clamav"';
fi
if id -u clamscan >/dev/null 2>&1; then
CAVUSR='ClamUser="clamscan"';
fi
if id -u vscan >/dev/null 2>&1; then
CAVUSR='ClamUser="vscan"';
fi
if getent group clamav >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamav"';
fi
if getent group clam >/dev/null 2>&1; then
CAVGRP='ClamGroup="clam"';
fi
if getent group clamscan >/dev/null 2>&1; then
CAVGRP='ClamGroup="clamscan"';
fi
if [ -f '/usr/lib/MailScanner/wrapper/clamav-wrapper' ]; then
sed -i "s/${DISTROCAVUSER}/${CAVUSR}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
sed -i "s/${DISTROCAVGRP}/${CAVGRP}/g" /usr/lib/MailScanner/wrapper/clamav-wrapper
fi
# fix old style clamav Monitors if preset in old mailscanner.conf
CAVOLD='^Monitors for ClamAV Updates.*';
CAVNEW='Monitors for ClamAV Updates = \/usr\/local\/share\/clamav\/\*\.cld \/usr\/local\/share\/clamav\/\*\.cvd \/var\/lib\/clamav\/\*\.inc\/\* \/var\/lib\/clamav\/\*\.\?db \/var\/lib\/clamav\/\*\.cvd';
if [ -f '/etc/MailScanner/MailScanner.conf' ]; then
sed -i "s/${CAVOLD}/${CAVNEW}/g" /etc/MailScanner/MailScanner.conf
fi
fi
# # using --force option to reinstall the rpm if the same version is
# # already installed. this will not overwrite configuration files
# # as they are protected in the rpm spec file
# $RPM -Uvh $NODEPS MailScanner*noarch.rpm
# if [ $? -ne 0 ]; then
# echo;
# echo '----------------------------------------------------------';
# echo 'Installation Error'; echo;
# echo 'The MailScanner RPM failed to install. Address the required';
# echo 'dependencies and run the installer again. Note that electing';
# echo 'to use CPAN should resolve dependency errors.';
# echo;
# echo 'Note that Perl modules need to be available system-wide. A';
# echo 'common issue is that missing modules were installed in a ';
# echo 'user specific configuration.';
# echo;
# else
# create ramdisk
if [ $RAMDISK -eq 1 ]; then
if [ -d '/var/spool/MailScanner/incoming' ]; then
@ -697,15 +800,71 @@ else
ldconfig
echo;
echo '----------------------------------------------------------';
echo 'Installation Complete'; echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo 'Review: Set your preferences in /etc/MailScanner/MailScanner.conf'
echo 'and review /etc/MailScanner/defaults';
fi
if [[ -n "${arg_update+x}" ]]; then
echo;
echo '----------------------------------------------------------';
echo 'Configuration and module update complete';
echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo To finish updating MailScanner, review the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo Restart MailScanner
echo
echo --SysV Init--
echo service mailscanner restart
echo
echo --Systemd--
echo systemctl restart mailscanner.service
echo
echo Restart MSMilter \(if in use\)
echo
echo --SysV Init--
echo service msmilter restart
echo
echo --Systemd--
echo systemctl restart msmilter.service
echo
else
echo;
echo '----------------------------------------------------------';
echo 'Initial configuration and module installation complete';
echo;
echo 'See http://www.mailscanner.info for more information and '
echo 'support via the MailScanner mailing list.'
echo;
echo;
echo To finish configuring MailScanner, edit the following files:
echo
echo /etc/MailScanner/defaults
echo /etc/MailScanner/MailScanner.conf
echo
echo
echo To activate MailScanner run the following commands:
echo
echo --SysV Init--
echo chkconfig mailscanner on
echo service mailscanner start
echo
echo --Systemd--
echo systemctl enable mailscanner.service
echo systemctl start mailscanner.service
echo
echo To activate MSMilter \(if in use\) run the following commands:
echo
echo --SysV Init--
echo chkconfig msmilter on
echo service msmilter start
echo
echo --Systemd--
echo systemctl enable msmilter.service
echo systemctl start msmilter.service
echo
fi
) 2>&1 | tee mailscanner-install.log
) 2>&1 | tee -a /var/log/mailscanner-configuration.log