SpamAssassin 4 and latest OSes (#643)

* Rewrite of ms-configure for each os category to allow SA4 cpan install as non-root with sudo and with proper modules
* Keep old perl modules on list, for backward compatibility
* Hosting of new msv5 content over on efa-project.org mirrors (was AWS)
This commit is contained in:
Shawn Iverson 2023-02-24 14:25:00 -05:00 committed by GitHub
parent bbe5f1ee4e
commit dc51a77b19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 905 additions and 596 deletions

View file

@ -6,7 +6,7 @@
# MailScanner via apt-get and CPAN based on user input. # MailScanner via apt-get and CPAN based on user input.
# #
# #
# Updated: 14 Nov 2021 # Updated: 17 Feb 2023
# MailScanner Team <https://www.mailscanner.info> # MailScanner Team <https://www.mailscanner.info>
clear clear
@ -25,7 +25,7 @@ while [ $# -gt 0 ]; do
arg_MTA="none"; arg_MTA="none";
arg_installClamav=0; arg_installClamav=0;
arg_installCPAN=1; arg_installCPAN=1;
arg_ignoreDeps=0; arg_installUnrar=0;
arg_ramdiskSize=0; arg_ramdiskSize=0;
arg_update=1; arg_update=1;
((parsedCommands++)); ((parsedCommands++));
@ -69,15 +69,15 @@ while [ $# -gt 0 ]; do
fi fi
;; ;;
--ignoreDeps=*) --installUnrar=*)
if [[ ${1#*=} =~ ^([yY])$ ]]; then if [[ ${1#*=} =~ ^([yY])$ ]]; then
arg_ignoreDeps=1; arg_installUnrar=1;
((parsedCommands++)); ((parsedCommands++));
elif [[ ${1#*=} =~ ^([nN])$ ]]; then elif [[ ${1#*=} =~ ^([nN])$ ]]; then
arg_ignoreDeps=0; arg_installUnrar=0;
((parsedCommands++)); ((parsedCommands++));
else else
printf "Error: Invalid value for ignoreDeps: only Y or N values are accepted.\n" printf "Error: Invalid value for installUnrar: only Y or N values are accepted.\n"
exit 1 exit 1
fi fi
;; ;;
@ -101,15 +101,15 @@ while [ $# -gt 0 ]; do
printf " --installCPAN=Y\n" printf " --installCPAN=Y\n"
printf " --ignoreDeps=N\n" printf " --ignoreDeps=N\n"
printf " --ramdiskSize=0 (assumed already configured)\n\n" printf " --ramdiskSize=0 (assumed already configured)\n\n"
printf -- "--MTA=value Select the Mail Transfer Agent (MTA) to be installed (sendmail|postfix|exim|none)\n" printf -- "--MTA=value Select the Mail Transfer Agent (MTA) to be installed (sendmail|postfix|exim|none)\n"
printf " Recommended: sendmail\n\n" printf " Recommended: sendmail\n\n"
printf -- "--installClamav=Y|N Install or update ClamAV during installation (Y or N)\n" printf -- "--installClamav=Y|N Install or update ClamAV during installation (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--installCPAN=Y|N Install missing perl modules via CPAN (Y or N)\n" printf -- "--installCPAN=Y|N Install missing perl modules via CPAN (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--ignoreDeps=Y|N Force .deb package install regardless of missing dependencies (Y or N)\n" printf -- "--installUnrar=Y|N Install unrar via dpkg (Y or N)\n"
printf " Recommended: N (no)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--ramdiskSize=value Create a RAMDISK for incoming spool directory (integer value or 0 for none)\n" printf -- "--ramdiskSize=value Create a RAMDISK for incoming spool directory (integer value or 0 for none)\n"
printf " Suggestions:\n"; printf " Suggestions:\n";
printf " None 0\n"; printf " None 0\n";
printf " Small 256\n"; printf " Small 256\n";
@ -163,6 +163,10 @@ echo "such as Ubuntu. Internet connectivity is required for this installation sc
echo; echo;
echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING"; echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING";
echo; echo;
echo "To install SpamAssassin 4.0, an unprivileged user 'sabuild' will be created and granted";
echo "temporary sudo privileges. This is necessary to obtain a successful build. sudo privileges";
echo "will be removed after install, and you can optionally remove the 'sabuild' user at any time";
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 installation. Note that you may see";
echo "some errors during the perl module installation. You may safely ignore errors regarding"; echo "some errors during the perl module installation. You may safely ignore errors regarding";
echo "failed tests for optional packages."; echo; echo "failed tests for optional packages."; echo;
@ -289,32 +293,29 @@ else
fi fi
fi fi
# ask if the user wants to ignore dependencies. they are automatically ignored # ask if the user wants to install unrar by RPM if missing
# if the user elected the CPAN option as explained above
clear clear
echo; echo;
echo "Do you want to ignore MailScanner dependencies?"; echo; echo "Do you want to install unrar via dpkg if missing?"; echo;
echo "This will force install the MailScanner .deb package regardless of missing"; echo "I will attempt to install unrar via the apt Package Manager, but if not found I can ";
echo "dependencies. It is highly recommended that you DO NOT do this unless you"; echo "install this from an deb provided by MailScanner Community Project. unrar allows";
echo "are debugging."; echo "MailScanner to handle archives compressed with rar.";
echo; echo;
echo "Recommended: N (no)"; echo; echo "Recommended: Y (yes)"; echo;
if [ -z "${arg_ignoreDeps+x}" ]; then if [ -z "${arg_installUnrar+x}" ]; then
read -r -p "Ignore MailScanner dependencies (nodeps)? [y/N] : " response read -r -p "Install missing unrar via RPM? [n/Y] : " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
# user wants to ignore deps # user wants to use RPM for missing unrar
NODEPS='--force-depends' UNRAROPTION=1
elif [ -z $response ]; then
# user wants to use RPM for missing unrar
UNRAROPTION=1
else else
# requiring deps # user does not want to use RPM
NODEPS= UNRAROPTION=0
fi fi
else else
if [ ${arg_ignoreDeps} -eq 1 ]; then UNRAROPTION=${arg_installUnrar}
NODEPS='--force-depends'
else
NODEPS=
fi
fi fi
# ask if the user wants to add a ramdisk # ask if the user wants to add a ramdisk
@ -363,80 +364,172 @@ fi
# base system packages # base system packages
BASEPACKAGES=(); BASEPACKAGES=();
BASEPACKAGES+=('perl-doc'); BASEPACKAGES+=('libmailtools-perl'); BASEPACKAGES+=('re2c'); BASEPACKAGES+=('perl-doc'); BASEPACKAGES+=('re2c'); BASEPACKAGES+=('curl');
BASEPACKAGES+=('curl'); BASEPACKAGES+=('libnet-cidr-lite-perl'); BASEPACKAGES+=('libmime-tools-perl'); BASEPACKAGES+=('wget'); BASEPACKAGES+=('tar'); BASEPACKAGES+=('binutils');
BASEPACKAGES+=('wget'); BASEPACKAGES+=('libtest-manifest-perl'); BASEPACKAGES+=('libnet-cidr-perl'); BASEPACKAGES+=('unrar'); BASEPACKAGES+=('perl-modules'); BASEPACKAGES+=('gcc');
BASEPACKAGES+=('tar'); BASEPACKAGES+=('libdata-dump-perl'); BASEPACKAGES+=('libsys-syslog-perl'); BASEPACKAGES+=('make'); BASEPACKAGES+=('patch'); BASEPACKAGES+=('libc6-dev');
BASEPACKAGES+=('binutils'); BASEPACKAGES+=('libbusiness-isbn-perl'); BASEPACKAGES+=('libio-stringy-perl'); BASEPACKAGES+=('antiword'); BASEPACKAGES+=('pyzor'); BASEPACKAGES+=('razor');
BASEPACKAGES+=('unrar'); BASEPACKAGES+=('libdbd-mysql-perl'); BASEPACKAGES+=('perl-modules'); BASEPACKAGES+=('tnef'); BASEPACKAGES+=('gzip'); BASEPACKAGES+=('unzip');
BASEPACKAGES+=('gcc'); BASEPACKAGES+=('libconvert-tnef-perl'); BASEPACKAGES+=('libdbd-mysql-perl'); BASEPACKAGES+=('openssl'); BASEPACKAGES+=('perl'); BASEPACKAGES+=('p7zip-full');
BASEPACKAGES+=('make'); BASEPACKAGES+=('libdbd-sqlite3-perl'); BASEPACKAGES+=('libencode-detect-perl'); BASEPACKAGES+=('arj'); BASEPACKAGES+=('lhasa'); BASEPACKAGES+=('bzip2');
BASEPACKAGES+=('patch'); BASEPACKAGES+=('libfilesys-df-perl'); BASEPACKAGES+=('libc6-dev'); BASEPACKAGES+=('cabextract'); BASEPACKAGES+=('cpio'); BASEPACKAGES+=('file');
BASEPACKAGES+=('antiword'); BASEPACKAGES+=('libarchive-zip-perl'); BASEPACKAGES+=('libconfig-yaml-perl'); BASEPACKAGES+=('gzip'); BASEPACKAGES+=('nomarch'); BASEPACKAGES+=('pax');
BASEPACKAGES+=('pyzor'); BASEPACKAGES+=('libole-storage-lite-perl'); BASEPACKAGES+=('libsys-sigaction-perl'); BASEPACKAGES+=('unrar'); BASEPACKAGES+=('unzip'); BASEPACKAGES+=('libidn2-dev');
BASEPACKAGES+=('razor'); BASEPACKAGES+=('libinline-perl'); BASEPACKAGES+=('libmail-imapclient-perl'); BASEPACKAGES+=('zip'); BASEPACKAGES+=('libdb-dev'); BASEPACKAGES+=('sudo');
BASEPACKAGES+=('tnef'); BASEPACKAGES+=('libmail-spf-perl'); BASEPACKAGES+=('libtest-pod-coverage-perl'); BASEPACKAGES+=('cpanminus'); BASEPACKAGES+=('libmaxminddb-dev');
BASEPACKAGES+=('gzip'); BASEPACKAGES+=('libnetaddr-ip-perl'); BASEPACKAGES+=('libfile-sharedir-install-perl');
BASEPACKAGES+=('unzip'); BASEPACKAGES+=('libnet-ldap-perl'); BASEPACKAGES+=('libsys-hostname-long-perl');
BASEPACKAGES+=('openssl'); BASEPACKAGES+=('libmail-dkim-perl'); BASEPACKAGES+=('libhtml-tokeparser-simple-perl'); # Look for perl modules that may exist in repositories, missing/non-existant packages will be skipped
BASEPACKAGES+=('perl'); BASEPACKAGES+=('libbusiness-isbn-data-perl'); BASEPACKAGES+=('libnet-dns-resolver-programmable-perl'); EXTRAPACKAGES=();
BASEPACKAGES+=('p7zip-full'); BASEPACKAGES+=('libgeo-ip-perl'); BASEPACKAGES+=('libnet-patricia-perl'); EXTRAPACKAGES+=('libarchive-tar-perl'); EXTRAPACKAGES+=('libarchive-zip-perl'); EXTRAPACKAGES+=('libbignum-perl');
BASEPACKAGES+=('arj'); BASEPACKAGES+=('lhasa'); BASEPACKAGES+=('bzip2'); EXTRAPACKAGES+=('libcarp-perl'); EXTRAPACKAGES+=('libcompress-zlib-perl'); EXTRAPACKAGES+=('libcompress-raw-zlib-perl');
BASEPACKAGES+=('cabextract'); BASEPACKAGES+=('cpio'); BASEPACKAGES+=('file'); EXTRAPACKAGES+=('libconvert-binhex-perl'); EXTRAPACKAGES+=('libconvert-tnef-perl'); EXTRAPACKAGES+=('libdata-dumper-perl');
BASEPACKAGES+=('gzip'); BASEPACKAGES+=('nomarch'); BASEPACKAGES+=('pax'); EXTRAPACKAGES+=('libdata-perse-perl'); EXTRAPACKAGES+=('libdbd-sqlite3-perl'); EXTRAPACKAGES+=('libdbi-perl');
BASEPACKAGES+=('rar'); BASEPACKAGES+=('unrar'); BASEPACKAGES+=('unzip'); EXTRAPACKAGES+=('libdigest-hmac-perl'); EXTRAPACKAGES+=('libdigest-md5-perl'); EXTRAPACKAGES+=('libdigest-sha1-perl');
BASEPACKAGES+=('zip'); BASEPACKAGES+=('zoo'); BASEPACKAGES+=('libsendmail-pmilter-perl'); EXTRAPACKAGES+=('libdirhandle-perl'); EXTRAPACKAGES+=('libextutils-makemaker-perl'); EXTRAPACKAGES+=('libfcntl-perl');
BASEPACKAGES+=('libdb-dev'); BASEPACKAGES+=('libmime-tools-perl'); BASEPACKAGES+=('libtest-deep-perl'); EXTRAPACKAGES+=('libfile-basename-perl'); EXTRAPACKAGES+=('libfile-copy-perl'); EXTRAPACKAGES+=('libfile-path-perl');
BASEPACKAGES+=('cpanminus'); BASEPACKAGES+=('libmath-int64-perl'); BASEPACKAGES+=('libpath-class-perl'); EXTRAPACKAGES+=('libfile-spec-perl'); EXTRAPACKAGES+=('libfile-temp-perl'); EXTRAPACKAGES+=('libfilehandle-perl');
BASEPACKAGES+=('libtest-fatal-perl'); BASEPACKAGES+=('libnamespace-autoclean-perl'); BASEPACKAGES+=('librole-tiny-perl'); EXTRAPACKAGES+=('libfilesys-df-perl'); EXTRAPACKAGES+=('libgetopt-long-perl'); EXTRAPACKAGES+=('libinline-c-perl');
BASEPACKAGES+=('libdata-dumper-concise-perl'); BASEPACKAGES+=('libdatetime-perl'); BASEPACKAGES+=('libtest-warnings-perl'); EXTRAPACKAGES+=('libio-perl'); EXTRAPACKAGES+=('libio-file-perl'); EXTRAPACKAGES+=('libio-pipe-perl');
BASEPACKAGES+=('libautodie-perl'); BASEPACKAGES+=('libtest-requires-perl'); BASEPACKAGES+=('libclone-pp-perl'); EXTRAPACKAGES+=('libio-stringy-perl'); EXTRAPACKAGES+=('libhtml-entities-perl'); EXTRAPACKAGES+=('libhtml-parser-perl');
BASEPACKAGES+=('libfile-homedir-perl'); BASEPACKAGES+=('libsort-naturally-perl'); BASEPACKAGES+=('libjson-maybexs-perl'); EXTRAPACKAGES+=('libhtml-tagset-perl'); EXTRAPACKAGES+=('libhtml-tokeparser-perl'); EXTRAPACKAGES+=('libmail-field-perl');
BASEPACKAGES+=('libtest-leaktrace-perl'); BASEPACKAGES+=('libthrowable-perl'); BASEPACKAGES+=('libmaxminddb-dev'); EXTRAPACKAGES+=('libmail-header-perl'); EXTRAPACKAGES+=('libmail-imapclient-perl'); EXTRAPACKAGES+=('libmail-internet-perl');
EXTRAPACKAGES+=('libmath-bigint-perl'); EXTRAPACKAGES+=('libmath-bigrat-perl'); EXTRAPACKAGES+=('libmime-base64-perl');
EXTRAPACKAGES+=('libmime-decoder-perl'); EXTRAPACKAGES+=('libmime-decorder-uu-perl'); EXTRAPACKAGES+=('libmime-head-perl');
EXTRAPACKAGES+=('libmime-parser-perl'); EXTRAPACKAGES+=('libmime-quotedprint-perl'); EXTRAPACKAGES+=('libmime-tools-perl');
EXTRAPACKAGES+=('libmime-worddecoder-perl'); EXTRAPACKAGES+=('libnet-cidr-perl'); EXTRAPACKAGES+=('libnet-dns-perl');
EXTRAPACKAGES+=('libnet-ip-perl'); EXTRAPACKAGES+=('libole-storage-lite-perl'); EXTRAPACKAGES+=('libpod-escapes-perl');
EXTRAPACKAGES+=('libpod-simple-perl'); EXTRAPACKAGES+=('libposix-perl'); EXTRAPACKAGES+=('libscalar-util-perl');
EXTRAPACKAGES+=('libsocket-perl'); EXTRAPACKAGES+=('libstorable-perl'); EXTRAPACKAGES+=('libtest-harness-perl');
EXTRAPACKAGES+=('libtest-pod-perl'); EXTRAPACKAGES+=('libtest-simple-perl'); EXTRAPACKAGES+=('libtime-hires-perl');
EXTRAPACKAGES+=('libtime-localtime-perl'); EXTRAPACKAGES+=('libsys-hostname-long-perl'); EXTRAPACKAGES+=('libsys-sigaction-perl');
EXTRAPACKAGES+=('libsys-syslog-perl'); EXTRAPACKAGES+=('libenv-perl'); EXTRAPACKAGES+=('libtest-fatal-perl');
EXTRAPACKAGES+=('libdata-dump-perl'); EXTRAPACKAGES+=('libdb-file-perl'); EXTRAPACKAGES+=('libnamespace-autoclean-perl');
EXTRAPACKAGES+=('libmailtools-perl'); EXTRAPACKAGES+=('libdigest-perl'); EXTRAPACKAGES+=('libencode-detect-perl');
EXTRAPACKAGES+=('liberror-perl'); EXTRAPACKAGES+=('libextutils-cbuilder-perl'); EXTRAPACKAGES+=('libextutils-parsexs-perl');
EXTRAPACKAGES+=('libgetopt-long-perl'); EXTRAPACKAGES+=('libinline-perl'); EXTRAPACKAGES+=('libio-string-perl');
EXTRAPACKAGES+=('libio-zlib-perl'); EXTRAPACKAGES+=('libip-country-perl'); EXTRAPACKAGES+=('libmail-spf-perl');
EXTRAPACKAGES+=('libmail-spf-query-perl'); EXTRAPACKAGES+=('libmodule-build-perl'); EXTRAPACKAGES+=('libnet-cidr-lite-perl');
EXTRAPACKAGES+=('libnet-dns-perl'); EXTRAPACKAGES+=('libnet-ldap-perl'); EXTRAPACKAGES+=('libnet-dns-resolver-programmable-perl');
EXTRAPACKAGES+=('libnetaddr-ip-perl'); EXTRAPACKAGES+=('libparse-recdescent-perl'); EXTRAPACKAGES+=('libtest-harness-perl');
EXTRAPACKAGES+=('libtest-manifest-perl'); EXTRAPACKAGES+=('libtext-balanced-perl'); EXTRAPACKAGES+=('liburi-perl');
EXTRAPACKAGES+=('libversion-perl'); EXTRAPACKAGES+=('libio-compress-bzip2-perl'); EXTRAPACKAGES+=('libsendmail-pmilter-perl');
EXTRAPACKAGES+=('libmath-int64-perl'); EXTRAPACKAGES+=('libip-country-db-file-perl'); EXTRAPACKAGES+=('libnamespace-autoclean-perl');
EXTRAPACKAGES+=('libdata-ieee754-perl'); EXTRAPACKAGES+=('libdata-printer-perl'); EXTRAPACKAGES+=('libdata-validate-ip-perl');
EXTRAPACKAGES+=('liblist-allutils-perl'); EXTRAPACKAGES+=('liblist-someutils-perl'); EXTRAPACKAGES+=('libtest-tester-perl');
EXTRAPACKAGES+=('liblist-utilsby-perl'); EXTRAPACKAGES+=('libmaxmind-db-metadata-perl'); EXTRAPACKAGES+=('libmaxmind-db-reader-perl');
EXTRAPACKAGES+=('libmodule-runtime-perl'); EXTRAPACKAGES+=('libmoo-perl'); EXTRAPACKAGES+=('libmoox-strictconstructor-perl');
EXTRAPACKAGES+=('librole-tiny-perl'); EXTRAPACKAGES+=('libstrictures-perl'); EXTRAPACKAGES+=('libmaxmind-db-reader-xs-perl');
EXTRAPACKAGES+=('libsub-quote-perl'); EXTRAPACKAGES+=('libmath-int128-perl'); EXTRAPACKAGES+=('libnet-works-network-perl');
EXTRAPACKAGES+=('libhttp-date-perl'); EXTRAPACKAGES+=('libbusiness-isbn-perl'); EXTRAPACKAGES+=('libdbd-mysql-perl');
EXTRAPACKAGES+=('libconfig-yaml-perl'); EXTRAPACKAGES+=('libtest-pod-coverage-perl'); EXTRAPACKAGES+=('libfile-sharedir-install-perl');
EXTRAPACKAGES+=('libmail-dkim-perl'); EXTRAPACKAGES+=('libbusiness-isbn-data-perl'); EXTRAPACKAGES+=('libhtml-tokeparser-simple-perl');
EXTRAPACKAGES+=('libgeo-ip-perl'); EXTRAPACKAGES+=('libnet-patricia-perl'); EXTRAPACKAGES+=('libtest-deep-perl');
EXTRAPACKAGES+=('libpath-class-perl'); EXTRAPACKAGES+=('libdata-dumper-concise-perl'); EXTRAPACKAGES+=('libautodie-perl');
EXTRAPACKAGES+=('libtest-requires-perl'); EXTRAPACKAGES+=('libclone-pp-perl'); EXTRAPACKAGES+=('libfile-homedir-perl');
EXTRAPACKAGES+=('libsort-naturally-perl'); EXTRAPACKAGES+=('libjson-maybexs-perl'); EXTRAPACKAGES+=('libdatetime-perl');
EXTRAPACKAGES+=('libtest-warnings-perl'); EXTRAPACKAGES+=('libtest-leaktrace-perl'); EXTRAPACKAGES+=('libthrowable-perl');
EXTRAPACKAGES+=('libalgorithm-diff-perl'); EXTRAPACKAGES+=('libalien-build-perl'); EXTRAPACKAGES+=('libalien-build-plugin-download-gitlab-perl');
EXTRAPACKAGES+=('libalien-libxml2-perl'); EXTRAPACKAGES+=('libb-keywords-perl'); EXTRAPACKAGES+=('libbsd-resource-perl');
EXTRAPACKAGES+=('libcapture-tiny-perl'); EXTRAPACKAGES+=('libconfig-tiny-perl'); EXTRAPACKAGES+=('libdbix-simple-perl');
EXTRAPACKAGES+=('libdevel-cycle-perl'); EXTRAPACKAGES+=('libdevel-hide-perl'); EXTRAPACKAGES+=('libemail-abstract-perl');
EXTRAPACKAGES+=('libemail-address-xs-perl'); EXTRAPACKAGES+=('libemail-date-format-perl'); EXTRAPACKAGES+=('libemail-mime-perl');
EXTRAPACKAGES+=('libemail-mime-encodings-perl');EXTRAPACKAGES+=('libemail-messageid-perl'); EXTRAPACKAGES+=('libemail-mime-contenttype-perl');
EXTRAPACKAGES+=('libemail-sender-perl'); EXTRAPACKAGES+=('libemail-simple-perl'); EXTRAPACKAGES+=('libffi-checklib-perl');
EXTRAPACKAGES+=('libfile-copy-recursive-perl'); EXTRAPACKAGES+=('libfile-chdir-perl'); EXTRAPACKAGES+=('libhook-lexwrap-perl');
EXTRAPACKAGES+=('libio-socket-inet6-perl'); EXTRAPACKAGES+=('libimporter-perl'); EXTRAPACKAGES+=('liblingua-en-inflect-perl');
EXTRAPACKAGES+=('libmime-charset-perl'); EXTRAPACKAGES+=('libmime-types-perl'); EXTRAPACKAGES+=('libmail-dmarc-perl');
EXTRAPACKAGES+=('libmodule-pluggable-perl'); EXTRAPACKAGES+=('libmoox-types-mooselike-perl');EXTRAPACKAGES+=('libmozilla-ca-perl');
EXTRAPACKAGES+=('libnet-idn-encode-perl'); EXTRAPACKAGES+=('libnet-imap-simple-perl'); EXTRAPACKAGES+=('libnet-libidn2-perl');
EXTRAPACKAGES+=('libnet-smtps-perl'); EXTRAPACKAGES+=('libppi-perl'); EXTRAPACKAGES+=('libppix-quotelike-perl');
EXTRAPACKAGES+=('libppix-regexp-perl'); EXTRAPACKAGES+=('libppix-utilities-perl'); EXTRAPACKAGES+=('libperl-critic-perl');
EXTRAPACKAGES+=('libperl-tidy-perl'); EXTRAPACKAGES+=('libpod-spell-perl'); EXTRAPACKAGES+=('libperl-critic-policy-perlsecret-perl');
EXTRAPACKAGES+=('libreadonly-xs-perl'); EXTRAPACKAGES+=('libregexp-common-perl'); EXTRAPACKAGES+=('libscope-guard-perl');
EXTRAPACKAGES+=('libstring-format-perl'); EXTRAPACKAGES+=('libsub-info-perl'); EXTRAPACKAGES+=('libsub-uplevel-perl');
EXTRAPACKAGES+=('libtask-weaken-perl'); EXTRAPACKAGES+=('libterm-size-any-perl'); EXTRAPACKAGES+=('libterm-size-perl-perl');
EXTRAPACKAGES+=('libterm-table-perl'); EXTRAPACKAGES+=('libtest-exception-perl'); EXTRAPACKAGES+=('libtest-failwarnings-perl');
EXTRAPACKAGES+=('libtest-file-perl'); EXTRAPACKAGES+=('libtest-file-sharedir-perl'); EXTRAPACKAGES+=('libtest-nowarnings-perl');
EXTRAPACKAGES+=('libtest-object-perl'); EXTRAPACKAGES+=('libtest-output-perl'); EXTRAPACKAGES+=('libtest-regexp-perl');
EXTRAPACKAGES+=('libtest-subcalls-perl'); EXTRAPACKAGES+=('libtest2-suite-perl'); EXTRAPACKAGES+=('libtext-diff-perl');
EXTRAPACKAGES+=('libtext-unidecode-perl'); EXTRAPACKAGES+=('libunicode-linebreak-perl'); EXTRAPACKAGES+=('libxml-libxml-perl');
EXTRAPACKAGES+=('libxml-namespacesupport-perl');EXTRAPACKAGES+=('libxml-sax-perl'); EXTRAPACKAGES+=('libxml-sax-base-perl');
EXTRAPACKAGES+=('libtest-perl-critic-perl');
# the array of perl modules needed # the array of perl modules needed
ARMOD=(); ARMOD=();
ARMOD+=('Archive::Tar'); ARMOD+=('Archive::Zip'); ARMOD+=('bignum'); ARMOD+=('Archive::Tar'); ARMOD+=('Archive::Zip'); ARMOD+=('bignum');
ARMOD+=('Carp'); ARMOD+=('Compress::Zlib'); ARMOD+=('Compress::Raw::Zlib'); ARMOD+=('Carp'); ARMOD+=('Compress::Zlib'); ARMOD+=('Compress::Raw::Zlib');
ARMOD+=('Convert::BinHex'); ARMOD+=('Convert::TNEF'); ARMOD+=('Data::Dumper'); ARMOD+=('Convert::BinHex'); ARMOD+=('Convert::TNEF'); ARMOD+=('Data::Dumper');
ARMOD+=('Date::Parse'); ARMOD+=('DBD::SQLite'); ARMOD+=('DBI'); ARMOD+=('Date::Parse'); ARMOD+=('DBD::SQLite'); ARMOD+=('DBI');
ARMOD+=('Digest::HMAC'); ARMOD+=('Digest::MD5'); ARMOD+=('Digest::SHA1'); ARMOD+=('Digest::HMAC'); ARMOD+=('Digest::MD5'); ARMOD+=('Digest::SHA1');
ARMOD+=('DirHandle'); ARMOD+=('ExtUtils::MakeMaker'); ARMOD+=('Fcntl'); ARMOD+=('DirHandle'); ARMOD+=('ExtUtils::MakeMaker'); ARMOD+=('Fcntl');
ARMOD+=('File::Basename'); ARMOD+=('File::Copy'); ARMOD+=('File::Path'); ARMOD+=('File::Basename'); ARMOD+=('File::Copy'); ARMOD+=('File::Path');
ARMOD+=('File::Spec'); ARMOD+=('File::Temp'); ARMOD+=('FileHandle'); ARMOD+=('File::Spec'); ARMOD+=('File::Temp'); ARMOD+=('FileHandle');
ARMOD+=('Filesys::Df'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline::C'); ARMOD+=('Filesys::Df'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline::C');
ARMOD+=('IO'); ARMOD+=('IO::File'); ARMOD+=('IO::Pipe'); ARMOD+=('IO'); ARMOD+=('IO::File'); ARMOD+=('IO::Pipe');
ARMOD+=('IO::Stringy'); ARMOD+=('HTML::Entities'); ARMOD+=('HTML::Parser'); ARMOD+=('IO::Stringy'); ARMOD+=('HTML::Entities'); ARMOD+=('HTML::Parser');
ARMOD+=('HTML::Tagset'); ARMOD+=('HTML::TokeParser'); ARMOD+=('Mail::Field'); ARMOD+=('HTML::Tagset'); ARMOD+=('HTML::TokeParser'); ARMOD+=('Mail::Field');
ARMOD+=('Mail::Header'); ARMOD+=('Mail::IMAPClient'); ARMOD+=('Mail::Internet'); ARMOD+=('Mail::Header'); ARMOD+=('Mail::IMAPClient'); ARMOD+=('Mail::Internet');
ARMOD+=('Math::BigInt'); ARMOD+=('Math::BigRat'); ARMOD+=('MIME::Base64'); ARMOD+=('Math::BigInt'); ARMOD+=('Math::BigRat'); ARMOD+=('MIME::Base64');
ARMOD+=('MIME::Decoder'); ARMOD+=('MIME::Decoder::UU'); ARMOD+=('MIME::Head'); ARMOD+=('MIME::Decoder'); ARMOD+=('MIME::Decoder::UU'); ARMOD+=('MIME::Head');
ARMOD+=('MIME::Parser'); ARMOD+=('MIME::QuotedPrint'); ARMOD+=('MIME::Tools'); ARMOD+=('MIME::Parser'); ARMOD+=('MIME::QuotedPrint'); ARMOD+=('MIME::Tools');
ARMOD+=('MIME::WordDecoder'); ARMOD+=('Net::CIDR'); ARMOD+=('Net::DNS'); ARMOD+=('MIME::WordDecoder'); ARMOD+=('Net::CIDR'); ARMOD+=('Net::DNS');
ARMOD+=('Net::IP'); ARMOD+=('OLE::Storage_Lite'); ARMOD+=('Pod::Escapes'); ARMOD+=('Net::IP'); ARMOD+=('OLE::Storage_Lite'); ARMOD+=('Pod::Escapes');
ARMOD+=('Pod::Simple'); ARMOD+=('POSIX'); ARMOD+=('Scalar::Util'); ARMOD+=('Pod::Simple'); ARMOD+=('POSIX'); ARMOD+=('Scalar::Util');
ARMOD+=('Socket'); ARMOD+=('Storable'); ARMOD+=('Test::Harness'); ARMOD+=('Socket'); ARMOD+=('Storable'); ARMOD+=('Test::Harness');
ARMOD+=('Test::Pod'); ARMOD+=('Test::Simple'); ARMOD+=('Time::HiRes'); ARMOD+=('Test::Pod'); ARMOD+=('Test::Simple'); ARMOD+=('Time::HiRes');
ARMOD+=('Time::localtime'); ARMOD+=('Sys::Hostname::Long'); ARMOD+=('Sys::SigAction'); ARMOD+=('Time::localtime'); ARMOD+=('Sys::Hostname::Long'); ARMOD+=('Sys::SigAction');
ARMOD+=('Sys::Syslog'); ARMOD+=('Env'); ARMOD+=('bignum'); ARMOD+=('Sys::Syslog'); ARMOD+=('Env'); ARMOD+=('Test::Fatal');
ARMOD+=('Data::Dump'); ARMOD+=('DB_File'); ARMOD+=('DBD::SQLite'); ARMOD+=('Data::Dump'); ARMOD+=('DB_File'); ARMOD+=('namespace::autoclean');
ARMOD+=('DBI'); ARMOD+=('Digest'); ARMOD+=('Encode::Detect'); ARMOD+=('MailTools'); ARMOD+=('Digest'); ARMOD+=('Encode::Detect');
ARMOD+=('Error'); ARMOD+=('ExtUtils::CBuilder'); ARMOD+=('ExtUtils::ParseXS'); ARMOD+=('Error'); ARMOD+=('ExtUtils::CBuilder'); ARMOD+=('ExtUtils::ParseXS');
ARMOD+=('Getopt::Long'); ARMOD+=('Inline'); ARMOD+=('IO::String'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline'); ARMOD+=('IO::String');
ARMOD+=('IO::Zlib'); ARMOD+=('IP::Country'); ARMOD+=('Mail::SPF'); ARMOD+=('IO::Zlib'); ARMOD+=('IP::Country'); ARMOD+=('Mail::SPF');
ARMOD+=('Mail::SPF::Query'); ARMOD+=('Module::Build'); ARMOD+=('Net::CIDR::Lite'); ARMOD+=('Mail::SPF::Query'); ARMOD+=('Module::Build'); ARMOD+=('Net::CIDR::Lite');
ARMOD+=('Net::DNS'); ARMOD+=('Net::LDAP'); ARMOD+=('Net::DNS::Resolver::Programmable'); ARMOD+=('Net::DNS'); ARMOD+=('Net::LDAP'); ARMOD+=('Net::DNS::Resolver::Programmable');
ARMOD+=('NetAddr::IP'); ARMOD+=('Parse::RecDescent'); ARMOD+=('Test::Harness'); ARMOD+=('NetAddr::IP'); ARMOD+=('Parse::RecDescent'); ARMOD+=('Test::Harness');
ARMOD+=('Test::Manifest'); ARMOD+=('Text::Balanced'); ARMOD+=('URI'); ARMOD+=('Test::Manifest'); ARMOD+=('Text::Balanced'); ARMOD+=('URI');
ARMOD+=('version'); ARMOD+=('IO::Compress::Bzip2'); ARMOD+=('Sendmail::PMilter'); ARMOD+=('version'); ARMOD+=('IO::Compress::Bzip2'); ARMOD+=('Sendmail::PMilter');
ARMOD+=('Math::Int64'); ARMOD+=('IP::Country::DB_File'); ARMOD+=('namespace::autoclean'); ARMOD+=('Math::Int64'); ARMOD+=('IP::Country::DB_File'); ARMOD+=('namespace::autoclean');
ARMOD+=('Data::IEEE754'); ARMOD+=('Data::Printer'); ARMOD+=('Data::Validate::IP'); ARMOD+=('Data::IEEE754'); ARMOD+=('Data::Printer'); ARMOD+=('Data::Validate::IP');
ARMOD+=('List::AllUtils'); ARMOD+=('List::SomeUtils'); ARMOD+=('Test::Tester'); ARMOD+=('List::AllUtils'); ARMOD+=('List::SomeUtils'); ARMOD+=('Test::Tester');
ARMOD+=('List::UtilsBy'); ARMOD+=('MaxMind::DB::Metadata'); ARMOD+=('MaxMind::DB::Reader'); ARMOD+=('List::UtilsBy'); ARMOD+=('MaxMind::DB::Metadata'); ARMOD+=('MaxMind::DB::Reader');
ARMOD+=('Module::Runtime'); ARMOD+=('Moo'); ARMOD+=('MooX::StrictConstructor'); ARMOD+=('Module::Runtime'); ARMOD+=('Moo'); ARMOD+=('MooX::StrictConstructor');
ARMOD+=('Role::Tiny'); ARMOD+=('strictures'); ARMOD+=('MaxMind::DB::Reader::XS'); ARMOD+=('Role::Tiny'); ARMOD+=('strictures'); ARMOD+=('MaxMind::DB::Reader::XS');
ARMOD+=('Sub::Quote'); ARMOD+=('Math::Int128'); ARMOD+=('Net::Works::Network'); ARMOD+=('Sub::Quote'); ARMOD+=('Math::Int128'); ARMOD+=('Net::Works::Network');
ARMOD+=('HTTP::Date'); ARMOD+=('HTTP::Date'); ARMOD+=('Business::ISBN'); ARMOD+=('DBD::mysql');
ARMOD+=('Config::YAML'); ARMOD+=('Test::Pod::Coverage'); ARMOD+=('File::ShareDir::Install');
ARMOD+=('Mail::DKIM'); ARMOD+=('Business::ISBN::Data'); ARMOD+=('HTML::TokeParser::Simple');
ARMOD+=('Geo::IP'); ARMOD+=('Net::Patricia'); ARMOD+=('Test::Deep');
ARMOD+=('Path::Class'); ARMOD+=('Data::Dumper::Concise'); ARMOD+=('autodie');
ARMOD+=('Test::Requires'); ARMOD+=('Clone::PP'); ARMOD+=('File::HomeDir');
ARMOD+=('Sort::Naturally'); ARMOD+=('JSON::MaybeXS'); ARMOD+=('DateTime');
ARMOD+=('Test::Warnings'); ARMOD+=('Test::LeakTrace'); ARMOD+=('Throwable');
ARMOD+=('Algorithm::Diff'); ARMOD+=('Alien::Build'); ARMOD+=('Alien::Build::Plugin::Download::GitLab');
ARMOD+=('Alien::Libxml2'); ARMOD+=('B::Keywords'); ARMOD+=('BSD::Resource');
ARMOD+=('Capture::Tiny'); ARMOD+=('Config::Tiny'); ARMOD+=('DBIx::Simple');
ARMOD+=('Devel::Cycle'); ARMOD+=('Devel::Hide'); ARMOD+=('Email::Abstract');
ARMOD+=('Email::Address::XS'); ARMOD+=('Email::Date::Format'); ARMOD+=('Email::MIME');
ARMOD+=('Email::MIME::Encodings'); ARMOD+=('Email::MessageID'); ARMOD+=('Email::MIME::ContentType');
ARMOD+=('Email::Sender'); ARMOD+=('Email::Simple'); ARMOD+=('FFI::CheckLib');
ARMOD+=('File::Copy::Recursive'); ARMOD+=('File::chdir'); ARMOD+=('Hook::LexWrap');
ARMOD+=('IO::Socket::INET6'); ARMOD+=('Importer'); ARMOD+=('Lingua::EN::Inflect');
ARMOD+=('MIME::Charset'); ARMOD+=('MIME::Types'); ARMOD+=('Mail::DMARC');
ARMOD+=('Module::Pluggable'); ARMOD+=('MooX::Types::MooseLike'); ARMOD+=('Mozilla::CA');
ARMOD+=('Net::IDN::Encode'); ARMOD+=('Net::IMAP::Simple'); ARMOD+=('Net::LibIDN2');
ARMOD+=('Net::SMTPS'); ARMOD+=('PPI'); ARMOD+=('PPIx::QuoteLike');
ARMOD+=('PPIx::Regexp'); ARMOD+=('PPIx::Utilities'); ARMOD+=('Perl::Critic');
ARMOD+=('Perl::Tidy'); ARMOD+=('Pod::Spell'); ARMOD+=('Perl::Critic::Policy::Perlsecret');
ARMOD+=('Readonly::XS'); ARMOD+=('Regexp::Common'); ARMOD+=('Scope::Guard');
ARMOD+=('String::Format'); ARMOD+=('Sub::Info'); ARMOD+=('Sub::Uplevel');
ARMOD+=('Task::Weaken'); ARMOD+=('Term::Size::Any'); ARMOD+=('Term::Size::Perl');
ARMOD+=('Term::Table'); ARMOD+=('Test::Exception'); ARMOD+=('Test::FailWarnings');
ARMOD+=('Test::File'); ARMOD+=('Test::File::ShareDir'); ARMOD+=('Test::NoWarnings');
ARMOD+=('Test::Object'); ARMOD+=('Test::Output'); ARMOD+=('Test::Regexp');
ARMOD+=('Test::SubCalls'); ARMOD+=('Test2::Suite'); ARMOD+=('Text::Diff');
ARMOD+=('Text::Unidecode'); ARMOD+=('Unicode::LineBreak'); ARMOD+=('XML::LibXML');
ARMOD+=('XML::NamespaceSupport'); ARMOD+=('XML::SAX'); ARMOD+=('XML::SAX::Base');
ARMOD+=('Test::Perl::Critic');
# additional spamassassin plugins # additional spamassassin plugins
SAMOD=(); SAMOD=();
@ -458,9 +551,6 @@ timewait 2
# install required perl and base packages that are available via apt # install required perl and base packages that are available via apt
# #
# some items may not be available depending on the distribution
# release but those items will be checked after this and installed
# via cpan if the user elected to do so.
$APTGET update $APTGET update
for i in "${BASEPACKAGES[@]}" for i in "${BASEPACKAGES[@]}"
@ -468,6 +558,15 @@ do
$APTGET -yf install $i $APTGET -yf install $i
done done
# Look for packaged perl modules and install them via apt
# some items may not be available depending on the distribution
# release but those items will be checked after this and installed
# via cpan if the user elected to do so.
for i in "${EXTRAPACKAGES[@]}"
do
$APTGET -yf install $i
done
# install this separate in case it conflicts # install this separate in case it conflicts
if [ "x$MTAOPTION" != "x" ]; then if [ "x$MTAOPTION" != "x" ]; then
$APTGET -yf install $MTAOPTION $APTGET -yf install $MTAOPTION
@ -503,6 +602,30 @@ else
CURL='/usr/bin/curl'; CURL='/usr/bin/curl';
fi fi
# install missing unrar if the user elected to do so
if [ $UNRAROPTION -eq 1 ]; then
# user elected to use unrar RPM option
if [ ! -x '/usr/bin/unrar' ]; then
cd /tmp
rm -f unrar-6.2.5*
clear
echo;
echo "unrar missing. Installing via dpkg ..."; echo;
$CURL -LO https://mirrors.efa-project.org/msv5/DEB/unrar_6.2.5-1_amd64.deb
if [ -f 'unrar_6.2.5-1_amd64.deb' ]; then
/usr/bin/dpkg -i unrar_6.2.5-1_amd64.deb
else
echo "NOTICE: I cannot find a suitable deb to install unrar";
timewait 5
fi
# back to where i started
rm -f unrar-6.2.5*
cd "$THISCURRPMDIR"
fi
fi
# create the cpan config if there isn't one and the user # create the cpan config if there isn't one and the user
# elected to use CPAN # elected to use CPAN
if [ $CPANOPTION -eq 1 ]; then if [ $CPANOPTION -eq 1 ]; then
@ -512,7 +635,7 @@ if [ $CPANOPTION -eq 1 ]; then
echo "CPAN config missing. Creating one ..."; echo; echo "CPAN config missing. Creating one ..."; echo;
mkdir -p /root/.cpan/CPAN mkdir -p /root/.cpan/CPAN
cd /root/.cpan/CPAN cd /root/.cpan/CPAN
$CURL -O https://s3.amazonaws.com/msv5/CPAN/MyConfig.pm $CURL -LO https://mirrors.efa-project.org/msv5/CPAN/DEB/root/MyConfig.pm
cd $THISCURRPMDIR cd $THISCURRPMDIR
timewait 1 timewait 1
perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit' perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
@ -557,28 +680,69 @@ if [ ${CPANOPTION} -eq 1 ]; then
fi fi
fi fi
done done
fi
#Install SpamAssassin modules function install_sa() {
for i in "${SAMOD[@]}" # Create sabuild user and set up for sudo build (SA 4.0+)
do useradd -m -s /usr/sbin/nologin sabuild &>/dev/null
perldoc -l ${i} >/dev/null 2>&1 id -u sabuild &>/dev/null
if [ $? -ne 0 ]; then if [ $? -eq 0 ]; then
clear echo "sabuild ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sabuild
echo "${i} is missing. Installing via CPAN ..."; echo; if [ ! -f '/home/sabuild/.cpan/CPAN/MyConfig.pm' ]; then
timewait 1 echo;
if [ $AUTOCPAN -eq 0 ]; then echo "CPAN config missing. Creating one ..."; echo;
perl -MCPAN -e "CPAN::Shell->force(qw(install ${i} ));" mkdir -p /home/sabuild/.cpan/CPAN
else cd /home/sabuild/.cpan/CPAN
cpanm --force --no-interactive $i $CURL -LO https://mirrors.efa-project.org/msv5/CPAN/DEB/sabuild/MyConfig.pm
fi chown -R sabuild:sabuild /home/sabuild/.cpan
cd "$THISCURRPMDIR"
fi fi
done
# Update perl modules for i in "${SAMOD[@]}"
if [[ -n "${arg_update+x}" && $AUTOCPAN -ne 0 ]]; then do
cpanm App::cpanoutdated perldoc -l $i >/dev/null 2>&1
cpan-outdated -p | cpanm --force --no-interactive if [[ $? -ne 0 || $1 == "update" ]]; then
if [ $CPANOPTION -eq 1 ]; then
clear
echo "$i is missing or needs updated. Installing via CPAN ..."; echo;
timewait 1
su - sabuild -s /bin/bash -c "echo \"\\\n\" | perl -MCPAN -e \"CPAN::Shell->force(qw(install $i ));\""
else
echo "WARNING: $i is missing. You should fix this.";
PMODWAIT=5
fi
else
echo "$i => OK";
fi
done
# Cleanup, just revoke sudo privs
rm -f /etc/sudoers.d/sabuild
else
echo "Unable to create sabuild user, cannot install spamassassin"
echo "You should fix this."
fi fi
}
install_sa
# Update perl modules
if [[ -n "${arg_update+x}" && $AUTOCPAN -ne 0 ]]; then
cpanm App::cpanoutdated
for i in $(cpan-outdated -p); do
if [ "$i" == "Mail::SpamAssassin" ]; then
# Check for spamassassin apt and notify user
/usr/bin/dpkg-query -W libmail-spamassassin-perl &>/dev/null
if [ $? -eq 0 ]; then
echo "Spamassassin detected installed via apt. To update spamassassin use your package manager."
timewait 1
else
install_sa "update"
fi
else
cpanm --force --no-interactive $i
fi
done
fi fi
# check and notify of any missing modules # check and notify of any missing modules

View file

@ -5,11 +5,10 @@
# This script installs the required software for # This script installs the required software for
# MailScanner via yum and CPAN based on user input. # MailScanner via yum and CPAN based on user input.
# #
# Tested distributions: CentOS 6,7,8 # Tested distributions: CentOS 7,8,9 or equivalent
# RHEL 6,7,8 # Fedora 37
# Fedora 29,30,31
# #
# Updated: 14 Nov 2021 # Updated: 17 Feb 2023
# MailScanner Team <https://www.mailscanner.info> # MailScanner Team <https://www.mailscanner.info>
# clear the screen. yay! # clear the screen. yay!
@ -30,13 +29,12 @@ while [ $# -gt 0 ]; do
arg_installClamav=0; arg_installClamav=0;
arg_configClamav=0; arg_configClamav=0;
arg_installCPAN=1; arg_installCPAN=1;
arg_ignoreDeps=0;
arg_ramdiskSize=0 arg_ramdiskSize=0
arg_installEPEL=0; arg_installEPEL=0;
arg_installPowerTools=0; arg_installPowerTools=0;
arg_installTNEF=0; arg_installTNEF=0;
arg_installUnrar=0; arg_installUnrar=0;
arg_installDf=0; arg_installidn=0;
arg_SELPermissive=0; arg_SELPermissive=0;
arg_update=1; arg_update=1;
((parsedCommands++)); ((parsedCommands++));
@ -93,19 +91,6 @@ while [ $# -gt 0 ]; do
fi fi
;; ;;
--ignoreDeps=*)
if [[ ${1#*=} =~ ^([yY])$ ]]; then
arg_ignoreDeps=1;
((parsedCommands++));
elif [[ ${1#*=} =~ ^([nN])$ ]]; then
arg_ignoreDeps=0;
((parsedCommands++));
else
printf "Error: Invalid value for ignoreDeps: only Y or N values are accepted.\n"
exit 1
fi
;;
--ramdiskSize=*) --ramdiskSize=*)
if [[ ${1#*=} =~ ^-?[0-9]+$ ]]; then if [[ ${1#*=} =~ ^-?[0-9]+$ ]]; then
arg_ramdiskSize="${1#*=}"; arg_ramdiskSize="${1#*=}";
@ -168,15 +153,15 @@ while [ $# -gt 0 ]; do
fi fi
;; ;;
--installDf=*) --installidn=*)
if [[ ${1#*=} =~ ^([yY])$ ]]; then if [[ ${1#*=} =~ ^([yY])$ ]]; then
arg_installDf=1; arg_installidn=1;
((parsedCommands++)); ((parsedCommands++));
elif [[ ${1#*=} =~ ^([nN])$ ]]; then elif [[ ${1#*=} =~ ^([nN])$ ]]; then
arg_installDf=0; arg_installidn=0;
((parsedCommands++)); ((parsedCommands++));
else else
printf "Error: Invalid value for installDf: only Y or N values are accepted.\n" printf "Error: Invalid value for installidn: only Y or N values are accepted.\n"
exit 1 exit 1
fi fi
;; ;;
@ -206,9 +191,7 @@ while [ $# -gt 0 ]; do
printf " --installTNEF=N (assumed already installed)\n" printf " --installTNEF=N (assumed already installed)\n"
printf " --installUnrar=N (assumed already installed)\n" printf " --installUnrar=N (assumed already installed)\n"
printf " --installCPAN=Y\n" printf " --installCPAN=Y\n"
printf " --installDf=N (assumed already installed)\n"
printf " --SELPermissive=N (assumed already configured)\n" printf " --SELPermissive=N (assumed already configured)\n"
printf " --ignoreDeps=N\n"
printf " --ramdiskSize=0 (assumed already configured)\n\n" printf " --ramdiskSize=0 (assumed already configured)\n\n"
printf -- "--MTA=value Select the Mail Transfer Agent (MTA) to be installed (sendmail|postfix|exim|none)\n" printf -- "--MTA=value Select the Mail Transfer Agent (MTA) to be installed (sendmail|postfix|exim|none)\n"
printf " Recommended: sendmail\n\n" printf " Recommended: sendmail\n\n"
@ -218,20 +201,18 @@ while [ $# -gt 0 ]; do
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--installClamav=Y|N Install or update ClamAV during installation (requires EPEL) (Y or N)\n" printf -- "--installClamav=Y|N Install or update ClamAV during installation (requires EPEL) (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--configClamav=Y|N Configure ClamAV (CentOS 7 only) (Y or N)\n" printf -- "--configClamav=Y|N Configure ClamAV (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--installTNEF=Y|N Install tnef via RPM (Y or N)\n" printf -- "--installTNEF=Y|N Install tnef via RPM (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--installUnrar=Y|N Install unrar via RPM (Y or N)\n" printf -- "--installUnrar=Y|N Install unrar via RPM (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--installCPAN=Y|N Install missing perl modules via CPAN (Y or N)\n" printf -- "--installidn=Y|N Install perl-Net-LibIDN via RPM (EL 9 Only) (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--installDf=Y|N Install perl-Filesys-Df and perl-Sys-Hostname-Long (CentOS 7) (Y or N)\n" printf -- "--installCPAN=Y|N Install missing perl modules via CPAN (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--SELPermissive=Y|N Set SELinux to Permissive mode (Y or N)\n" printf -- "--SELPermissive=Y|N Set SELinux to Permissive mode (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--ignoreDeps=Y|N Force .rpm package install regardless of missing dependencies (Y or N)\n"
printf " Recommended: N (no)\n\n"
printf -- "--ramdiskSize=value Create a RAMDISK for incoming spool directory (integer value or 0 for none)\n" printf -- "--ramdiskSize=value Create a RAMDISK for incoming spool directory (integer value or 0 for none)\n"
printf " Suggestions:\n"; printf " Suggestions:\n";
printf " None 0\n"; printf " None 0\n";
@ -279,40 +260,37 @@ else
fi fi
# confirm the RHEL release is known before continuing # confirm the RHEL release is known before continuing
FEDORA=
RHEL=
if [ ! -f '/etc/redhat-release' ]; then if [ ! -f '/etc/redhat-release' ]; then
# this is mostly to prevent accidental configuration on a non redhat based system # 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; echo "Unable to determine distribution release from /etc/redhat-release or /etc/fedora-release. Configuration aborted."; echo;
exit 192 exit 192
else else
# figure out what release is being used # figure out what release is being used
if grep -qs 'release 6' /etc/redhat-release ; then if grep -qs 'release 7' /etc/redhat-release ; then
# RHEL 6
RHEL=6
elif grep -qs 'release 7' /etc/redhat-release ; then
# RHEL 7 # RHEL 7
RHEL=7 RHEL=7
elif grep -qs 'release 8' /etc/redhat-release ; then elif grep -qs 'release 8' /etc/redhat-release ; then
# RHEL 8 # RHEL 8
RHEL=8 RHEL=8
elif grep -qs 'release 9' /etc/redhat-release ; then
# RHEL 8
RHEL=9
else else
# No supported release match # No supported release match
RHEL=0 RHEL=0
fi fi
fi fi
FEDORA= # maybe it is fedora
# Is this a Fedora System? # Is this a Fedora System?
if [ -f /etc/fedora-release ]; then if [ -f /etc/fedora-release ]; then
if grep -qs 'release 29' /etc/fedora-release ; then if grep -qs 'release 37' /etc/fedora-release ; then
# Fedora 29 # Fedora 29
FEDORA=29 FEDORA=37
elif grep -qs 'release 30' /etc/fedora-release ; then else
# Fedora 30
FEDORA=30
elif grep -qs 'release 31' /etc/fedora-release ; then
# Fedora 31
FEDORA=31
else
# Unsupported release # Unsupported release
FEDORA=0 FEDORA=0
fi fi
@ -321,12 +299,16 @@ fi
# user info screen before the install process starts # user info screen before the install process starts
echo "MailScanner Configuration for RPM Based Systems"; echo; echo; echo "MailScanner Configuration for RPM Based Systems"; echo; echo;
echo "This will INSTALL or UPGRADE the required software for MailScanner on RPM based systems"; 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 6,7,8 and associated"; echo "via the Yum package manager. Supported distributions are CentOS 7,8,9 and associated";
echo "variants such as CentOS and Fedora. Internet connectivity is required for"; echo "variants. Internet connectivity is required for";
echo "this configuration script to execute. "; echo; echo "this configuration script to execute. "; echo;
echo; echo;
echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING"; echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING";
echo; echo;
echo "To install SpamAssassin 4.0, an unprivileged user 'sabuild' will be created and granted";
echo "temporary sudo privileges. This is necessary to obtain a successful build. sudo privileges";
echo "will be removed after install, and you can optionally remove the 'sabuild' user at any time";
echo;
echo "You may press CTRL + C at any time to abort the configuration. 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 "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 "failed tests if you opt to use CPAN. You may also ignore 'No package available' notices";
@ -382,6 +364,8 @@ fi
SA=1 SA=1
SAOPTION="spamassassin" SAOPTION="spamassassin"
EPEL=0
EPELOPTION=
if [ -z $FEDORA ]; then if [ -z $FEDORA ]; then
# ask if the user wants to install EPEL # ask if the user wants to install EPEL
clear clear
@ -389,7 +373,7 @@ if [ -z $FEDORA ]; then
echo "Do you want to install EPEL? (Extra Packages for Enterprise Linux)"; echo; echo "Do you want to install EPEL? (Extra Packages for Enterprise Linux)"; echo;
echo "Installing EPEL will make more yum packages available, such as extra perl modules"; echo "Installing EPEL will make more yum packages available, such as extra perl modules";
echo "and ClamAV, which is recommended. This will also reduce the number of Perl modules"; echo "and ClamAV, which is recommended. This will also reduce the number of Perl modules";
echo "installed via CPAN. Note that EPEL is considered a third party repository."; echo "installed via CPAN. Note that EPEL is considered a third party repository. On RHEL 9, the CRB repository will also be enabled.";
echo; echo;
echo "Recommended: Y (yes)"; echo; echo "Recommended: Y (yes)"; echo;
if [ -z "${arg_installEPEL+x}" ]; then if [ -z "${arg_installEPEL+x}" ]; then
@ -415,7 +399,8 @@ if [ -z $FEDORA ]; then
fi fi
fi fi
if [[ -z $FEDORA && $RHEL -eq 8 ]]; then
if [[ $RHEL -eq 8 ]]; then
# ask if the user wants to install PowerTools # ask if the user wants to install PowerTools
clear clear
echo; echo;
@ -445,7 +430,7 @@ if [[ -z $FEDORA && $RHEL -eq 8 ]]; then
fi fi
fi fi
# ask if the user wants ClamAV installed if they selected EPEL or if this is a Fedora Server # ask if the user wants ClamAV installed if they selected EPEL
if [[ $EPEL -eq 1 || -n $FEDORA ]]; then if [[ $EPEL -eq 1 || -n $FEDORA ]]; then
clear clear
echo; echo;
@ -479,7 +464,7 @@ if [[ $EPEL -eq 1 || -n $FEDORA ]]; then
fi fi
fi fi
else else
# user did not select EPEL or is not on Fedora Server so clamav is not available via yum # user did not select EPEL so clamav is not available via yum
CAV=0 CAV=0
CAVOPTION= CAVOPTION=
fi fi
@ -513,55 +498,88 @@ fi
# ask if the user wants to install tnef by RPM if missing # ask if the user wants to install tnef by RPM if missing
TNEF="tnef"; TNEF="tnef";
clear TNEFOPTION=0
echo; if [ -z $FEDORA ]; then
echo "Do you want to install tnef via RPM if missing?"; echo; clear
echo "I will attempt to install tnef via the Yum Package Manager, but if not found I can "; echo;
echo "install this from an RPM provided by the MailScanner Community Project. Tnef allows"; echo "Do you want to install tnef via RPM if missing?"; echo;
echo "MailScanner to handle Microsoft specific winmail.dat files."; echo "I will attempt to install tnef via the Yum Package Manager, but if not found I can ";
echo; echo "install this from an RPM provided by the MailScanner Community Project. Tnef allows";
echo "Recommended: Y (yes)"; echo; echo "MailScanner to handle Microsoft specific winmail.dat files.";
if [ -z "${arg_installTNEF+x}" ]; then echo;
read -r -p "Install missing tnef via RPM? [n/Y] : " response echo "Recommended: Y (yes)"; echo;
if [ -z "${arg_installTNEF+x}" ]; then
read -r -p "Install missing tnef via RPM? [n/Y] : " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
# user wants to use RPM for missing tnef # user wants to use RPM for missing tnef
TNEFOPTION=1 TNEFOPTION=1
elif [ -z $response ]; then elif [ -z $response ]; then
# user wants to use RPM for missing tnef # user wants to use RPM for missing tnef
TNEFOPTION=1 TNEFOPTION=1
else
# user does not want to use RPM
TNEFOPTION=0
fi
else else
# user does not want to use RPM TNEFOPTION=${arg_installTNEF}
TNEFOPTION=0
fi fi
else
TNEFOPTION=${arg_installTNEF}
fi fi
# ask if the user wants to install unrar by RPM if missing if [ -z $FEDORA ]; then
clear # ask if the user wants to install unrar by RPM if missing
echo; clear
echo "Do you want to install unrar via RPM if missing?"; echo; echo;
echo "I will attempt to install unrar via the Yum Package Manager, but if not found I can "; echo "Do you want to install unrar via RPM if missing?"; echo;
echo "install this from an RPM provided by MailScanner Community Project. unrar allows"; echo "I will attempt to install unrar via the Yum Package Manager, but if not found I can ";
echo "MailScanner to handle archives compressed with rar."; echo "install this from an RPM provided by MailScanner Community Project. unrar allows";
echo; echo "MailScanner to handle archives compressed with rar.";
echo "Recommended: Y (yes)"; echo; echo;
if [ -z "${arg_installUnrar+x}" ]; then echo "Recommended: Y (yes)"; echo;
read -r -p "Install missing unrar via RPM? [n/Y] : " response if [ -z "${arg_installUnrar+x}" ]; then
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then read -r -p "Install missing unrar via RPM? [n/Y] : " response
# user wants to use RPM for missing unrar if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
UNRAROPTION=1 # user wants to use RPM for missing unrar
elif [ -z $response ]; then UNRAROPTION=1
# user wants to use RPM for missing unrar elif [ -z $response ]; then
UNRAROPTION=1 # user wants to use RPM for missing unrar
UNRAROPTION=1
else
# user does not want to use RPM
UNRAROPTION=0
fi
else else
# user does not want to use RPM UNRAROPTION=${arg_installUnrar}
UNRAROPTION=0
fi fi
else
UNRAROPTION=${arg_installUnrar}
fi fi
if [ $RHEL -eq 9 ]; then
# ask if the user wants to install perl-Net-LibIDN by RPM if missing
clear
echo;
echo "Do you want to install perl-Net-LibIDN via RPM if missing?"; echo;
echo "I will attempt to install perl-Net-LibIDN via the Yum Package Manager, but if not found I can ";
echo "install this from an RPM provided by MailScanner Community Project. perl-Net-LibIDN allows";
echo "SpamAssassin to handle internationalized domain names.";
echo;
echo "Recommended: Y (yes)"; echo;
if [ -z "${arg_installidn+x}" ]; then
read -r -p "Install missing perl-Net-LibIDN via RPM? [n/Y] : " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
# user wants to use RPM for missing perl-Net-LibIDN
IDNOPTION=1
elif [ -z $response ]; then
# user wants to use RPM for missing perl-Net-LibIDN
IDNOPTION=1
else
# user does not want to use RPM
IDNOPTION=0
fi
else
IDNOPTION=${arg_installidn}
fi
fi
# ask if the user wants missing modules installed via CPAN # ask if the user wants missing modules installed via CPAN
clear clear
echo; echo;
@ -576,88 +594,13 @@ if [ -z "${arg_installCPAN+x}" ]; then
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
# user wants to use CPAN for missing modules # user wants to use CPAN for missing modules
CPANOPTION=1 CPANOPTION=1
# rpm install will fail if the modules were not installed via RPM
# so i am setting the --nodeps flag here since the user elected to
# use CPAN to remediate the modules
NODEPS='--nodeps';
elif [ -z $response ]; then elif [ -z $response ]; then
# user wants to use CPAN for missing modules # user wants to use CPAN for missing modules
CPANOPTION=1 CPANOPTION=1
# rpm install will fail if the modules were not installed via RPM
# so i am setting the --nodeps flag here since the user elected to
# use CPAN to remediate the modules
NODEPS='--nodeps';
else else
# user does not want to use CPAN # user does not want to use CPAN
CPANOPTION=0 CPANOPTION=0
fi fi
else
CPANOPTION=${arg_installCPAN}
if [ $CPANOPTION -eq 1 ]; then
NODEPS='--nodeps';
fi
fi
# ask if the user wants to install 3rd party rpms for missing
# perl-Filesys-Df and perl-Sys-Hostname-Long
DFOPTION=0
if [ $RHEL -eq 7 ]; then
clear
echo;
echo "Do you want to install perl-Filesys-Df and perl-Sys-Hostname-Long via RPM if missing?"; echo;
echo "perl-Filesys-Df and perl-Sys-Hostname-Long and known to be missing from the Yum base and the";
echo "EPEL repo for RHEL7 at the release of this installer. I will try to install them from the";
echo "official Yum base and EPEL repo first. (If you elected the EPEL option.) If they are still ";
echo "missing I can attempt to install these two missing RPMs with 3rd party RPM packages. If they";
echo "are still missing and you selected the CPAN remediation I will try to install them from CPAN.";
echo;
echo "Recommended: Y (yes)"; echo;
if [ -z "${arg_installDf+x}" ]; then
read -r -p "Install these missing items via RPM? [n/Y] : " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
# user wants to use RPM for missing stuff
DFOPTION=1
elif [ -z $response ]; then
# user wants to use RPM for missing stuff
DFOPTION=1
else
# user does not want to use RPM
DFOPTION=0
fi
else
DFOPTION=${arg_installDf}
fi
fi
# ask if the user wants to ignore dependencies. they are automatically ignored
# if the user elected the CPAN option as explained above
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 "dependencies. It is highly recommended that you DO NOT do this unless you";
echo "are debugging.";
echo;
echo "Recommended: N (no)"; echo;
if [ -z "${arg_ignoreDeps+x}" ]; then
read -r -p "Ignore MailScanner dependencies (nodeps)? [y/N] : " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
# user wants to ignore deps
NODEPS='--nodeps --force'
else
# requiring deps
NODEPS=
fi
else
if [ ${arg_ignoreDeps} -eq 1 ]; then
NODEPS='--nodeps --force'
else
NODEPS=
fi
fi
fi fi
# ask about setting permissive mode for SeLinux # ask about setting permissive mode for SeLinux
@ -733,59 +676,152 @@ else
fi fi
# base system packages # base system packages
BASEPACKAGES="binutils gcc glibc-devel libaio make man-pages man-pages-overrides patch rpm tar time unzip which zip libtool-ltdl perl curl wget openssl openssl-devel bzip2-devel"; BASEPACKAGES="
binutils gcc glibc-devel
libaio make man-pages
man-pages-overrides patch rpm
tar time unzip
which zip libtool-ltdl
perl curl wget
openssl openssl-devel bzip2-devel
libmaxminddb-devel libidn-devel libidn2-devel
pyzor re2c unrar
tnef p7zip p7zip-plugins
sudo
"
# Packages available in the yum base of RHEL 5,6,7 # Packages (maybe) available in the yum base of RHEL 7,8,9
# and EPEL. If the user elects not to use EPEL or if the # and EPEL. If the user elects not to use EPEL or if the
# package is not available for their distro release it # package is not available for their distro release it
# will be ignored during the install. # will be ignored during the install.
# #
MOREPACKAGES="perl-Archive-Tar perl-Archive-Zip perl-Compress-Raw-Zlib perl-Compress-Zlib perl-Convert-BinHex perl-CPAN perl-Data-Dump perl-DBD-SQLite perl-DBI perl-Digest-HMAC perl-Digest-SHA1 perl-Env perl-ExtUtils-MakeMaker perl-File-ShareDir-Install perl-File-Temp perl-Filesys-Df perl-Getopt-Long perl-IO-String perl-IO-stringy perl-HTML-Parser perl-HTML-Tagset perl-Inline perl-IO-Zlib perl-Mail-DKIM perl-Mail-IMAPClient perl-Mail-SPF perl-MailTools perl-Net-CIDR perl-Net-DNS perl-Net-DNS-Resolver-Programmable perl-MIME-tools perl-Convert-TNEF perl-Net-IP perl-OLE-Storage_Lite perl-Pod-Escapes perl-Pod-Simple perl-Scalar-List-Utils perl-Storable perl-Pod-Escapes perl-Pod-Simple perl-Razor-Agent perl-Sys-Hostname-Long perl-Sys-SigAction perl-Test-Manifest perl-Test-Pod perl-Time-HiRes perl-TimeDate perl-URI perl-YAML pyzor re2c unrar tnef perl-Encode-Detect perl-LDAP perl-IO-Compress-Bzip2 p7zip p7zip-plugins perl-LWP-Protocol-https perl-Test-Simple perl-Math-Int64 perl-Path-Class perl-Test-Fatal perl-Test-Number-Delta perl-namespace-autoclean perl-Role-Tiny perl-Data-Dumper-Concise perl-DateTime perl-Test-Warnings perl-autodie perl-Test-Requires perl-Test-Tester perl-Clone-PP perl-File-HomeDir perl-Sort-Naturally perl-JSON-MaybeXS perl-Test-LeakTrace perl-Throwable libmaxminddb-devel"; MOREPACKAGES="
perl-Archive-Tar perl-Archive-Zip perl-bignum
perl-Carp perl-Compress-Zlib perl-Compress-Raw-Zlib
perl-Convert-BinHex perl-Convert-TNEF perl-Data-Dumper
perl-Date-Parse perl-DBD-SQLite perl-DBI
perl-Digest-HMAC perl-Digest-MD5 perl-Digest-SHA1
perl-DirHandle perl-ExtUtils-MakeMaker perl-Fcntl
perl-File-Basename perl-File-Copy perl-File-Path
perl-File-Spec perl-File-Temp perl-FileHandle
perl-Filesys-Df perl-Getopt-Long perl-Inline-C
perl-IO perl-IO-File perl-IO-Pipe
perl-IO-stringy perl-HTML-Entities perl-HTML-Parser
perl-HTML-Tagset perl-HTML-TokeParser perl-Mail-Field
perl-Mail-Header perl-Mail-IMAPClient perl-Mail-Internet
perl-Math-BigInt perl-Math-BigRat perl-MIME-Base64
perl-MIME-Decoder perl-MIME-Decoder-UU perl-MIME-Head
perl-MIME-Parser perl-MIME-QuotedPrint perl-MIME-tools
perl-MIME-WordDecoder perl-Net-CIDR perl-Net-DNS
perl-Net-IP perl-OLE-Storage_Lite perl-Pod-Escapes
perl-Pod-Simple perl-POSIX perl-Scalar-Util
perl-Socket perl-Storable perl-Test-Harness
perl-Test-Pod perl-Test-Simple perl-Time-HiRes
perl-Time-localtime perl-Sys-Hostname-Long perl-Sys-SigAction
perl-Sys-Syslog perl-Env perl-Filesys-Df
perl-IO-Wrap perl-CPAN perl-Data-Dump
perl-DB_File perl-Razor2-Client-Agent perl-File-ShareDir-Install
perl-Digest perl-Encode-Detect perl-Error
perl-ExtUtils-CBuilder perl-ExtUtils-ParseXS perl-Inline
perl-IO-String perl-IO-Zlib perl-IP-Country
perl-Mail-SPF perl-Mail-SPF-Query perl-Module-Build
perl-Net-CIDR-Lite perl-Mail-DKIM perl-Net-LDAP
perl-NetAddr-IP perl-Parse-RecDescent perl-MailTools
perl-Test-Manifest perl-Text-Balanced perl-URI
perl-version perl-IO-Compress-Bzip2 perl-Sendmail-PMilter
perl-Math-Int64 perl-IP-Country-DB_File perl-namespace-autoclean
perl-Data-IEEE754 perl-Data-Printer perl-Data-Validate-IP
perl-List-AllUtils perl-List-SomeUtils perl-Net-DNS-Nameserver
perl-List-UtilsBy perl-MaxMind-DB-Metadata perl-MaxMind-DB-Reader
perl-Module-Runtime perl-Moo perl-MooX-StrictConstructor
perl-Role-Tiny perl-strictures perl-DBD-mysql
perl-Sub-Quote perl-Math-Int128 perl-Net-Works-Network
perl-MaxMind-DB-Reader-XS perl-Geo-IP perl-GeoIP2-Database-Reader
perl-HTTP-Date perl-LWP-Protocol-https perl-Net-DNS-Resolver-Programmable
perl-Net-LibIDN perl-Net-LibIDN2 perl-Test-Perl-Critic
perl-Devel-Cycle perl-Perl-Critic-Policy perl-Perl-Critic-Policy-TestingAndDebugging-ProhibitNoStrict
perl-TimeDate perl-YAML perl-Perl-Critic-Policy-Perlsecret
perl-Path-Class perl-Test-Fatal perl-Test-Number-Delta
perl-Data-Dumper-Concise perl-DateTime perl-Test-Warnings
perl-autodie perl-Test-Requires perl-Test-Tester
perl-Clone-PP perl-File-HomeDir perl-Sort-Naturally
perl-JSON-MaybeXS perl-Test-LeakTrace perl-Throwable
perl-Alien-Build perl-Alien-Libxml2 perl-Alien-Build-Plugin-Download-GitLab
perl-BSD-Resource perl-DBIx-Simple perl-Email-Abstract
perl-Email-Address-XS perl-Email-Date-Format perl-Email-MessageID
perl-Email-MIME perl-Email-MIME-ContentType perl-Email-MIME-Encodings
perl-Email-Sender perl-Email-Simple perl-FFI-CheckLib
perl-File-chdir perl-IO-Socket-INET6 perl-Mail-DMARC
perl-MIME-Types perl-MooX-Types-MooseLike perl-Net-IDN-Encode
perl-Net-IMAP-Simple perl-Net-Patricia perl-Net-SMTPS
perl-Regexp-Common perl-Test-Exception perl-Test-Output
perl-Test-Regexp perl-XML-LibXML perl-XML-NamespaceSupport
perl-XML-SAX perl-XML-SAX-Base
"
# the array of perl modules needed # the array of perl modules needed
ARMOD=(); ARMOD=();
ARMOD+=('Archive::Tar'); ARMOD+=('Archive::Zip'); ARMOD+=('bignum'); ARMOD+=('Archive::Tar'); ARMOD+=('Archive::Zip'); ARMOD+=('bignum');
ARMOD+=('Carp'); ARMOD+=('Compress::Zlib'); ARMOD+=('Compress::Raw::Zlib'); ARMOD+=('Carp'); ARMOD+=('Compress::Zlib'); ARMOD+=('Compress::Raw::Zlib');
ARMOD+=('Convert::BinHex'); ARMOD+=('Convert::TNEF'); ARMOD+=('Data::Dumper'); ARMOD+=('Convert::BinHex'); ARMOD+=('Convert::TNEF'); ARMOD+=('Data::Dumper');
ARMOD+=('Date::Parse'); ARMOD+=('DBD::SQLite'); ARMOD+=('DBI'); ARMOD+=('Date::Parse'); ARMOD+=('DBD::SQLite'); ARMOD+=('DBI');
ARMOD+=('Digest::HMAC'); ARMOD+=('Digest::MD5'); ARMOD+=('Digest::SHA1'); ARMOD+=('Digest::HMAC'); ARMOD+=('Digest::MD5'); ARMOD+=('Digest::SHA1');
ARMOD+=('DirHandle'); ARMOD+=('ExtUtils::MakeMaker'); ARMOD+=('Fcntl'); ARMOD+=('DirHandle'); ARMOD+=('ExtUtils::MakeMaker'); ARMOD+=('Fcntl');
ARMOD+=('File::Basename'); ARMOD+=('File::Copy'); ARMOD+=('File::Path'); ARMOD+=('File::Basename'); ARMOD+=('File::Copy'); ARMOD+=('File::Path');
ARMOD+=('File::Spec'); ARMOD+=('File::Temp'); ARMOD+=('FileHandle'); ARMOD+=('File::Spec'); ARMOD+=('File::Temp'); ARMOD+=('FileHandle');
ARMOD+=('Filesys::Df'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline::C'); ARMOD+=('Filesys::Df'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline::C');
ARMOD+=('IO'); ARMOD+=('IO::File'); ARMOD+=('IO::Pipe'); ARMOD+=('IO'); ARMOD+=('IO::File'); ARMOD+=('IO::Pipe');
ARMOD+=('IO::Stringy'); ARMOD+=('HTML::Entities'); ARMOD+=('HTML::Parser'); ARMOD+=('IO::Stringy'); ARMOD+=('HTML::Entities'); ARMOD+=('HTML::Parser');
ARMOD+=('HTML::Tagset'); ARMOD+=('HTML::TokeParser'); ARMOD+=('Mail::Field'); ARMOD+=('HTML::Tagset'); ARMOD+=('HTML::TokeParser'); ARMOD+=('Mail::Field');
ARMOD+=('Mail::Header'); ARMOD+=('Mail::IMAPClient'); ARMOD+=('Mail::Internet'); ARMOD+=('Mail::Header'); ARMOD+=('Mail::IMAPClient'); ARMOD+=('Mail::Internet');
ARMOD+=('Math::BigInt'); ARMOD+=('Math::BigRat'); ARMOD+=('MIME::Base64'); ARMOD+=('Math::BigInt'); ARMOD+=('Math::BigRat'); ARMOD+=('MIME::Base64');
ARMOD+=('MIME::Decoder'); ARMOD+=('MIME::Decoder::UU'); ARMOD+=('MIME::Head'); ARMOD+=('MIME::Decoder'); ARMOD+=('MIME::Decoder::UU'); ARMOD+=('MIME::Head');
ARMOD+=('MIME::Parser'); ARMOD+=('MIME::QuotedPrint'); ARMOD+=('MIME::Tools'); ARMOD+=('MIME::Parser'); ARMOD+=('MIME::QuotedPrint'); ARMOD+=('MIME::Tools');
ARMOD+=('MIME::WordDecoder'); ARMOD+=('Net::CIDR'); ARMOD+=('Net::DNS'); ARMOD+=('MIME::WordDecoder'); ARMOD+=('Net::CIDR'); ARMOD+=('Net::DNS');
ARMOD+=('Net::IP'); ARMOD+=('OLE::Storage_Lite'); ARMOD+=('Pod::Escapes'); ARMOD+=('Net::IP'); ARMOD+=('OLE::Storage_Lite'); ARMOD+=('Pod::Escapes');
ARMOD+=('Pod::Simple'); ARMOD+=('POSIX'); ARMOD+=('Scalar::Util'); ARMOD+=('Pod::Simple'); ARMOD+=('POSIX'); ARMOD+=('Scalar::Util');
ARMOD+=('Socket'); ARMOD+=('Storable'); ARMOD+=('Test::Harness'); ARMOD+=('Socket'); ARMOD+=('Storable'); ARMOD+=('Test::Harness');
ARMOD+=('Test::Pod'); ARMOD+=('Test::Simple'); ARMOD+=('Time::HiRes'); ARMOD+=('Test::Pod'); ARMOD+=('Test::Simple'); ARMOD+=('Time::HiRes');
ARMOD+=('Time::localtime'); ARMOD+=('Sys::Hostname::Long'); ARMOD+=('Sys::SigAction'); ARMOD+=('Time::localtime'); ARMOD+=('Sys::Hostname::Long'); ARMOD+=('Sys::SigAction');
ARMOD+=('Sys::Syslog'); ARMOD+=('Env'); ARMOD+=('Filesys::Df'); ARMOD+=('Sys::Syslog'); ARMOD+=('Env'); ARMOD+=('Filesys::Df');
ARMOD+=('IO::Wrap'); ARMOD+=('bignum'); ARMOD+=('Data::Dump'); ARMOD+=('IO::Wrap'); ARMOD+=('CPAN'); ARMOD+=('Data::Dump');
ARMOD+=('DB_File'); ARMOD+=('DBD::SQLite'); ARMOD+=('DBI'); ARMOD+=('DB_File'); ARMOD+=('Razor2::Client::Agent'); ARMOD+=('File::ShareDir::Install');
ARMOD+=('Digest'); ARMOD+=('Encode::Detect'); ARMOD+=('Error'); ARMOD+=('Digest'); ARMOD+=('Encode::Detect'); ARMOD+=('Error');
ARMOD+=('ExtUtils::CBuilder'); ARMOD+=('ExtUtils::ParseXS'); ARMOD+=('Inline'); ARMOD+=('ExtUtils::CBuilder'); ARMOD+=('ExtUtils::ParseXS'); ARMOD+=('Inline');
ARMOD+=('IO::String'); ARMOD+=('IO::Zlib'); ARMOD+=('IP::Country'); ARMOD+=('IO::String'); ARMOD+=('IO::Zlib'); ARMOD+=('IP::Country');
ARMOD+=('Mail::SPF'); ARMOD+=('Mail::SPF::Query'); ARMOD+=('Module::Build'); ARMOD+=('Mail::SPF'); ARMOD+=('Mail::SPF::Query'); ARMOD+=('Module::Build');
ARMOD+=('Net::CIDR::Lite'); ARMOD+=('Net::DNS'); ARMOD+=('Net::LDAP'); ARMOD+=('Net::CIDR::Lite'); ARMOD+=('Mail::DKIM'); ARMOD+=('Net::LDAP');
ARMOD+=('NetAddr::IP'); ARMOD+=('Parse::RecDescent'); ARMOD+=('Test::Harness'); ARMOD+=('NetAddr::IP'); ARMOD+=('Parse::RecDescent'); ARMOD+=('MailTools');
ARMOD+=('Test::Manifest'); ARMOD+=('Text::Balanced'); ARMOD+=('URI'); ARMOD+=('Test::Manifest'); ARMOD+=('Text::Balanced'); ARMOD+=('URI');
ARMOD+=('version'); ARMOD+=('IO::Compress::Bzip2'); ARMOD+=('Sendmail::PMilter'); ARMOD+=('version'); ARMOD+=('IO::Compress::Bzip2'); ARMOD+=('Sendmail::PMilter');
ARMOD+=('Math::Int64'); ARMOD+=('IP::Country::DB_File'); ARMOD+=('namespace::autoclean'); ARMOD+=('Math::Int64'); ARMOD+=('IP::Country::DB_File'); ARMOD+=('namespace::autoclean');
ARMOD+=('Data::IEEE754'); ARMOD+=('Data::Printer'); ARMOD+=('Data::Validate::IP'); ARMOD+=('Data::IEEE754'); ARMOD+=('Data::Printer'); ARMOD+=('Data::Validate::IP');
ARMOD+=('List::AllUtils'); ARMOD+=('List::SomeUtils'); ARMOD+=('Net::DNS::Nameserver'); ARMOD+=('List::AllUtils'); ARMOD+=('List::SomeUtils'); ARMOD+=('Net::DNS::Nameserver');
ARMOD+=('List::UtilsBy'); ARMOD+=('MaxMind::DB::Metadata'); ARMOD+=('MaxMind::DB::Reader'); ARMOD+=('List::UtilsBy'); ARMOD+=('MaxMind::DB::Metadata'); ARMOD+=('MaxMind::DB::Reader');
ARMOD+=('Module::Runtime'); ARMOD+=('Moo'); ARMOD+=('MooX::StrictConstructor'); ARMOD+=('Module::Runtime'); ARMOD+=('Moo'); ARMOD+=('MooX::StrictConstructor');
ARMOD+=('Role::Tiny'); ARMOD+=('strictures'); ARMOD+=('DBD::mysql'); ARMOD+=('Role::Tiny'); ARMOD+=('strictures'); ARMOD+=('DBD::mysql');
ARMOD+=('Sub::Quote'); ARMOD+=('Math::Int128'); ARMOD+=('Net::Works::Network'); ARMOD+=('Sub::Quote'); ARMOD+=('Math::Int128'); ARMOD+=('Net::Works::Network');
ARMOD+=('MaxMind::DB::Reader::XS'); ARMOD+=('Geo::IP'); ARMOD+=('GeoIP2::Database::Reader'); ARMOD+=('MaxMind::DB::Reader::XS'); ARMOD+=('Geo::IP'); ARMOD+=('GeoIP2::Database::Reader');
ARMOD+=('Net::DNS::Resolver::Programmable'); ARMOD+=('HTTP::Date'); ARMOD+=('HTTP::Date'); ARMOD+=('LWP::Protocol::https'); ARMOD+=('Net::DNS::Resolver::Programmable');
ARMOD+=('Net::LibIDN'); ARMOD+=('Net::LibIDN2'); ARMOD+=('Test::Perl::Critic');
ARMOD+=('Devel::Cycle'); ARMOD+=('Perl::Critic::Policy'); ARMOD+=('Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict');
ARMOD+=('TimeDate'); ARMOD+=('YAML'); ARMOD+=('Perl::Critic::Policy::Perlsecret');
ARMOD+=('Path::Class'); ARMOD+=('Test::Fatal'); ARMOD+=('Test::Number::Delta');
ARMOD+=('Data::Dumper::Concise'); ARMOD+=('DateTime'); ARMOD+=('Test::Warnings');
ARMOD+=('autodie'); ARMOD+=('Test::Requires'); ARMOD+=('Test::Tester');
ARMOD+=('Clone::PP'); ARMOD+=('File::HomeDir'); ARMOD+=('Sort::Naturally');
ARMOD+=('JSON::MaybeXS'); ARMOD+=('Test::LeakTrace'); ARMOD+=('Throwable');
ARMOD+=('Alien::Build'); ARMOD+=('Alien::Libxml2'); ARMOD+=('Alien::Build::Plugin::Download::GitLab');
ARMOD+=('BSD::Resource'); ARMOD+=('DBIx::Simple'); ARMOD+=('Email::Abstract');
ARMOD+=('Email::Address::XS'); ARMOD+=('Email::Date::Format'); ARMOD+=('Email::MessageID');
ARMOD+=('Email::MIME'); ARMOD+=('Email::MIME::ContentType'); ARMOD+=('Email::MIME::Encodings');
ARMOD+=('Email::Sender'); ARMOD+=('Email::Simple'); ARMOD+=('FFI::CheckLib');
ARMOD+=('File::chdir'); ARMOD+=('IO::Socket::INET6'); ARMOD+=('Mail::DMARC');
ARMOD+=('MIME::Types'); ARMOD+=('MooX::Types::MooseLike'); ARMOD+=('Net::IDN::Encode');
ARMOD+=('Net::IMAP::Simple'); ARMOD+=('Net::Patricia'); ARMOD+=('Net::SMTPS');
ARMOD+=('Regexp::Common'); ARMOD+=('Test::Exception'); ARMOD+=('Test::Output');
ARMOD+=('Test::Regexp'); ARMOD+=('XML::LibXML'); ARMOD+=('XML::NamespaceSupport');
ARMOD+=('XML::SAX'); ARMOD+=('XML::SAX::Base');
# SA and plugins # SA and plugins
SAMOD=(); SAMOD=();
@ -794,9 +830,6 @@ SAMOD+=('Mail::SpamAssassin::Plugin::Rule2XSBody');
SAMOD+=('Mail::SpamAssassin::Plugin::DCC'); SAMOD+=('Mail::SpamAssassin::Plugin::DCC');
SAMOD+=('Mail::SpamAssassin::Plugin::Pyzor'); SAMOD+=('Mail::SpamAssassin::Plugin::Pyzor');
# 32 or 64 bit
MACHINE_TYPE=`uname -m`
# logging starts here # logging starts here
( (
clear clear
@ -812,7 +845,16 @@ echo;
timewait 2 timewait 2
# install base packages # install base packages
$YUM -y --skip-broken install $BASEPACKAGES $EPELOPTION $POWERTOOLSOPTION if [ -n "$EPELOPTION" ]; then
$YUM -y install $EPELOPTION
if [ $RHEL -eq 9 ]; then
dnf config-manager --set-enabled crb
fi
fi
if [ -n "$POWERTOOLSOPTION" ]; then
$YUM -y install $POWERTOOLSOPTION
fi
$YUM -y --skip-broken install $BASEPACKAGES
# install this separate in case it conflicts # install this separate in case it conflicts
if [ "x$MTAOPTION" != "x" ]; then if [ "x$MTAOPTION" != "x" ]; then
@ -863,7 +905,7 @@ if [ $CPANOPTION -eq 1 ]; then
echo "CPAN config missing. Creating one ..."; echo; echo "CPAN config missing. Creating one ..."; echo;
mkdir -p /root/.cpan/CPAN mkdir -p /root/.cpan/CPAN
cd /root/.cpan/CPAN cd /root/.cpan/CPAN
$CURL -O https://s3.amazonaws.com/msv5/CPAN/MyConfig.pm $CURL -LO https://mirrors.efa-project.org/msv5/CPAN/RHEL/root/MyConfig.pm
cd "$THISCURRPMDIR" cd "$THISCURRPMDIR"
fi fi
AUTOCPAN=1 AUTOCPAN=1
@ -900,35 +942,33 @@ if [ $TNEFOPTION -eq 1 ]; then
# user elected to use tnef RPM option # user elected to use tnef RPM option
if [ ! -x '/usr/bin/tnef' ]; then if [ ! -x '/usr/bin/tnef' ]; then
cd /tmp cd /tmp
rm -f tnef-1.4.12* rm -f tnef-1.4.18*
clear clear
echo; echo;
echo "Tnef missing. Installing via RPM ..."; echo; echo "Tnef missing. Installing via RPM ..."; echo;
if [ $MACHINE_TYPE == 'x86_64' ]; then
# 64-bit stuff here if [ $RHEL -eq 9 ]; then
$CURL -O https://s3.amazonaws.com/msv5/rpm/tnef-1.4.12-1.x86_64.rpm $CURL -LO https://mirrors.efa-project.org/msv5/EL9/tnef-1.4.18-1.el9.x86_64.rpm
if [ -f 'tnef-1.4.12-1.x86_64.rpm' ]; then if [ -f 'tnef-1.4.18-1.el9.x86_64.rpm' ]; then
$RPM -Uvh tnef-1.4.12-1.x86_64.rpm $RPM -Uvh tnef-1.4.18-1.el9.x86_64.rpm
fi fi
elif [ $MACHINE_TYPE == 'i686' ]; then elif [ $RHEL -eq 8 ]; then
# i686 stuff here $CURL -LO https://mirrors.efa-project.org/msv5/EL8/tnef-1.4.18-1.el8.x86_64.rpm
$CURL -O https://s3.amazonaws.com/msv5/rpm/tnef-1.4.12-1.i686.rpm if [ -f 'tnef-1.4.18-1.el8.x86_64.rpm' ]; then
if [ -f 'tnef-1.4.12-1.i686.rpm' ]; then $RPM -Uvh tnef-1.4.18-1.el8.x86_64.rpm
$RPM -Uvh tnef-1.4.12-1.i686.rpm fi
fi elif [ $RHEL -eq 7 ]; then
elif [ $MACHINE_TYPE == 'i386' ]; then $CURL -LO https://mirrors.efa-project.org/msv5/EL7/tnef-1.4.18-1.el7.x86_64.rpm
# i386 stuff here if [ -f 'tnef-1.4.18-1.el7.x86_64.rpm' ]; then
$CURL -O https://s3.amazonaws.com/msv5/rpm/tnef-1.4.12-1.i386.rpm $RPM -Uvh tnef-1.4.18-1.el7.x86_64.rpm
if [ -f 'tnef-1.4.12-1.i686.rpm' ]; then fi
$RPM -Uvh tnef-1.4.12-1.i686.rpm
fi
else else
echo "NOTICE: I cannot find a suitable RPM to install tnef (x86_64, i686, i386)"; echo "NOTICE: I cannot find a suitable RPM to install tnef";
timewait 5 timewait 5
fi fi
# back to where i started # back to where i started
rm -f tnef-1.4.12* rm -f tnef-1.4.18*
cd "$THISCURRPMDIR" cd "$THISCURRPMDIR"
fi fi
fi fi
@ -938,68 +978,64 @@ if [ $UNRAROPTION -eq 1 ]; then
# user elected to use unrar RPM option # user elected to use unrar RPM option
if [ ! -x '/usr/bin/unrar' ]; then if [ ! -x '/usr/bin/unrar' ]; then
cd /tmp cd /tmp
rm -f unrar-5.0.3* rm -f unrar-6.2.5*
clear clear
echo; echo;
echo "unrar missing. Installing via RPM ..."; echo; echo "unrar missing. Installing via RPM ..."; echo;
if [ $MACHINE_TYPE == 'x86_64' ]; then
# 64-bit stuff here if [ $RHEL -eq 9 ]; then
$CURL -O https://s3.amazonaws.com/msv5/rpm/unrar-5.0.3-1.x86_64.rpm $CURL -LO https://mirrors.efa-project.org/msv5/EL9/unrar-6.2.5-1.el9.x86_64.rpm
if [ -f 'unrar-5.0.3-1.x86_64.rpm' ]; then if [ -f 'unrar-6.2.5-1.el9.x86_64.rpm' ]; then
$RPM -Uvh unrar-5.0.3-1.x86_64.rpm $RPM -Uvh unrar-6.2.5-1.el9.x86_64.rpm
fi fi
elif [ $MACHINE_TYPE == 'i686' ]; then elif [ $RHEL -eq 8 ]; then
# i686 stuff here $CURL -LO https://mirrors.efa-project.org/msv5/EL8/unrar-6.2.5-1.el8.x86_64.rpm
$CURL -O https://s3.amazonaws.com/msv5/rpm/unrar-5.0.3-1.i686.rpm if [ -f 'unrar-6.2.5-1.el8.x86_64.rpm' ]; then
if [ -f 'unrar-5.0.3-1.i686.rpm' ]; then $RPM -Uvh unrar-6.2.5-1.el8.x86_64.rpm
$RPM -Uvh unrar-5.0.3-1.i686.rpm fi
fi elif [ $RHEL -eq 7 ]; then
elif [ $MACHINE_TYPE == 'i386' ]; then $CURL -LO https://mirrors.efa-project.org/msv5/EL7/unrar-6.1.7-1.el7.x86_64.rpm
# i386 stuff here if [ -f 'unrar-6.1.7-1.el7.x86_64.rpm' ]; then
$CURL -O https://s3.amazonaws.com/msv5/rpm/unrar-5.0.3-1.i386.rpm $RPM -Uvh unrar-6.1.7-1.el7.x86_64.rpm
if [ -f 'unrar-5.0.3-1.i386.rpm' ]; then fi
$RPM -Uvh unrar-5.0.3-1.i386.rpm
fi
else else
echo "NOTICE: I cannot find a suitable RPM to install unrar (x86_64, i686, i386)"; echo "NOTICE: I cannot find a suitable RPM to install unrar";
timewait 5 timewait 5
fi fi
# back to where i started # back to where i started
rm -f unrar-5.0.3* rm -f unrar-6.2.5*
cd "$THISCURRPMDIR" cd "$THISCURRPMDIR"
fi fi
fi fi
# install missing perl-Filesys-Df and perl-Sys-Hostname-Long on RHEL 7 if [ $RHEL -eq 9 ]; then
if [ $DFOPTION -eq 1 ]; then # install missing perl-Net-LibIDN if the user elected to do so
# test to see if these are installed. if not install from RPM if [ $IDNOPTION -eq 1 ]; then
cd /tmp # user elected to use perl-Net-LibIDN RPM option
rm -f perl-Filesys-Df* $RPM -q perl-Net-LibIDN
rm -f perl-Sys-Hostname-Long* if [ $? -ne 0 ]; then
cd /tmp
# perl-Filesys-Df rm -f perl-Net-LibIDN-0.12*
perldoc -l Filesys::Df >/dev/null 2>&1 clear
if [ $? -ne 0 ]; then echo;
if [ $MACHINE_TYPE == 'x86_64' ]; then echo "perl-Net-LibIDN missing. Installing via RPM ..."; echo;
$CURL -O https://s3.amazonaws.com/msv5/rpm/perl-Filesys-Df-0.92-1.el7.x86_64.rpm
if [ -f 'perl-Filesys-Df-0.92-1.el7.x86_64.rpm' ]; then if [ $RHEL -eq 9 ]; then
rpm -Uvh perl-Filesys-Df-0.92-1.el7.x86_64.rpm $CURL -LO https://mirrors.efa-project.org/msv5/EL9/perl-Net-LibIDN-0.12-1.x86_64.rpm
if [ -f 'perl-Net-LibIDN-0.12-1.x86_64.rpm' ]; then
$RPM -Uvh perl-Net-LibIDN-0.12-1.x86_64.rpm
fi fi
else
echo "NOTICE: I cannot find a suitable RPM to install perl-Net-LibIDN";
timewait 5
fi
# back to where i started
rm -f perl-Net-LibIDN-0.12*
cd "$THISCURRPMDIR"
fi fi
fi fi
# perl-Sys-Hostname-Long
perldoc -l Sys::Hostname::Long >/dev/null 2>&1
if [ $? -ne 0 ]; then
$CURL -O https://s3.amazonaws.com/msv5/rpm/perl-Sys-Hostname-Long-1.5-1.el7.noarch.rpm
if [ -f 'perl-Sys-Hostname-Long-1.5-1.el7.noarch.rpm' ]; then
rpm -Uvh perl-Sys-Hostname-Long-1.5-1.el7.noarch.rpm
fi
fi
# go back to where i started
cd "$THISCURRPMDIR"
fi fi
# fix the stupid line in /etc/freshclam.conf that disables freshclam # fix the stupid line in /etc/freshclam.conf that disables freshclam
@ -1020,7 +1056,7 @@ if [ $CONFCAV -eq 1 ]; then
sed -i '/#LogFile \/var\/log\/clamd.scan/ c\LogFile /var/log/clamd.scan' /etc/clamd.d/scan.conf sed -i '/#LogFile \/var\/log\/clamd.scan/ c\LogFile /var/log/clamd.scan' /etc/clamd.d/scan.conf
chown -R clamscan:mtagroup /var/run/clamd.scan chown -R clamscan:mtagroup /var/run/clamd.scan
echo "d /run/clamd.scan 0750 clamscan mtagroup -" > /usr/lib/tmpfiles.d/clamd.scan.conf echo "d /run/clamd.scan 0750 clamscan mtagroup -" > /usr/lib/tmpfiles.d/clamd.scan.conf
echo "d /run/clamd.scan 0750 clamscan mtagroup -" > /etc/tmpfiles.d/clamd.scan.conf echo "d /run/clamd.scan 0750 clamscan mtagroup -" > /etc/tmpfiles.d/clamd.scan.conf
touch /var/log/clamd.scan touch /var/log/clamd.scan
chown clamscan:clamscan /var/log/clamd.scan chown clamscan:clamscan /var/log/clamd.scan
usermod -G mtagroup,virusgroup,clamupdate clamscan usermod -G mtagroup,virusgroup,clamupdate clamscan
@ -1034,18 +1070,6 @@ timewait 2
# used to trigger a wait if something this missing # used to trigger a wait if something this missing
PMODWAIT=0 PMODWAIT=0
# first try to install missing perl modules via yum
# using this trick
for i in "${ARMOD[@]}"
do
perldoc -l $i >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$i is missing. Trying to install via Yum ..."; echo;
THING="perl($i)";
$YUM -y install $THING
fi
done
for i in "${ARMOD[@]}" for i in "${ARMOD[@]}"
do do
perldoc -l $i >/dev/null 2>&1 perldoc -l $i >/dev/null 2>&1
@ -1068,46 +1092,66 @@ do
fi fi
done done
for i in "${SAMOD[@]}" function install_sa() {
do # Create sabuild user and set up for sudo build (SA 4.0+)
perldoc -l $i >/dev/null 2>&1 useradd -m -s /sbin/nologin sabuild &>/dev/null
if [ $? -ne 0 ]; then id -u sabuild &>/dev/null
if [ $CPANOPTION -eq 1 ]; then if [ $? -eq 0 ]; then
clear echo "sabuild ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sabuild
echo "$i is missing. Installing via CPAN ..."; echo; if [ ! -f '/home/sabuild/.cpan/CPAN/MyConfig.pm' ]; then
timewait 1 echo;
if [ $AUTOCPAN -eq 0 ]; then echo "CPAN config missing. Creating one ..."; echo;
perl -MCPAN -e "CPAN::Shell->force(qw(install $i ));" mkdir -p /home/sabuild/.cpan/CPAN
else cd /home/sabuild/.cpan/CPAN
cpanm --force --no-interactive $i $CURL -LO https://mirrors.efa-project.org/msv5/CPAN/RHEL/sabuild/MyConfig.pm
fi chown -R sabuild:sabuild /home/sabuild/.cpan
else cd "$THISCURRPMDIR"
echo "WARNING: $i is missing. You should fix this.";
PMODWAIT=5
fi fi
for i in "${SAMOD[@]}"
do
perldoc -l $i >/dev/null 2>&1
if [[ $? -ne 0 || $1 == "update" ]]; then
if [ $CPANOPTION -eq 1 ]; then
clear
echo "$i is missing or needs updated. Installing via CPAN ..."; echo;
timewait 1
su - sabuild -s /bin/bash -c "echo \"\\\n\" | perl -MCPAN -e \"CPAN::Shell->force(qw(install $i ));\""
else
echo "WARNING: $i is missing. You should fix this.";
PMODWAIT=5
fi
else
echo "$i => OK";
fi
done
# Cleanup, just revoke sudo privs
rm -f /etc/sudoers.d/sabuild
else else
echo "$i => OK"; echo "Unable to create sabuild user, cannot install spamassassin"
echo "You should fix this."
fi fi
done }
install_sa
# Update perl modules # Update perl modules
if [[ -n "${arg_update+x}" && $AUTOCPAN -ne 0 ]]; then if [[ -n "${arg_update+x}" && $AUTOCPAN -ne 0 ]]; then
cpanm App::cpanoutdated cpanm App::cpanoutdated
cpan-outdated -p | cpanm --force --no-interactive for i in $(cpan-outdated -p); do
if [ "$i" == "Mail::SpamAssassin" ]; then
# Check for and override spamassassin rpm, if present # Check for spamassassin rpm and notify user
# RHEL variants ship SA with security vulnerabilities present if [[ -n $($RPM -qa | grep spamassassin) ]]; then
if [[ -n $(rpm -qa | grep spamassassin) ]]; then echo "Spamassassin detected installed via rpm. To update spamassassin use your package manager."
echo "Possibly outdated Spamassassin detected, installing from CPAN..." timewait 1
$RPM -e spamassassin else
cpanm --force --no-interactive Mail::SpamAssassin install_sa "update"
perldoc -l Mail::SpamAssassin >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Error installing spamassassin from CPAN, rolling back..."
$YUM -y install spamassassin
echo "WARNING: spamassassin is potentially outdated, you should fix this."
fi fi
fi else
cpanm --force --no-interactive $i
fi
done
fi fi
# will pause if a perl module was missing # will pause if a perl module was missing
@ -1121,7 +1165,7 @@ if [ $SELMODE -eq 1 ]; then
if [ -f '/etc/selinux/config' ]; then if [ -f '/etc/selinux/config' ]; then
perl -pi -e 's/'$OLDTHING'/'$NEWTHING'/;' /etc/selinux/config perl -pi -e 's/'$OLDTHING'/'$NEWTHING'/;' /etc/selinux/config
setenforce 0 setenforce 0
else else
clear clear
echo; echo;
echo "WARNING: I was unable to find the SELinux configuration file to set"; echo "WARNING: I was unable to find the SELinux configuration file to set";
@ -1132,9 +1176,6 @@ if [ $SELMODE -eq 1 ]; then
fi fi
# Freshclam # Freshclam
if [ -f '/etc/init.d/clamd' ]; then
chkconfig clamd on
fi
freshclam 2>/dev/null freshclam 2>/dev/null
# make sure in starting directory # make sure in starting directory

View file

@ -5,9 +5,9 @@
# This script installs the required software for # This script installs the required software for
# MailScanner via zypper and CPAN based on user input. # MailScanner via zypper and CPAN based on user input.
# #
# Tested distributions: OpenSUSE Leap 15.1 # Tested distributions: OpenSUSE Leap 15.4
# #
# Updated: 14 Nov 2021 # Updated: 19 Feb 2023
# MailScanner Team <https://www.mailscanner.info> # MailScanner Team <https://www.mailscanner.info>
# clear the screen. yay! # clear the screen. yay!
@ -27,7 +27,6 @@ while [ $# -gt 0 ]; do
arg_MTA="none"; arg_MTA="none";
arg_installClamav=0; arg_installClamav=0;
arg_installCPAN=1; arg_installCPAN=1;
arg_ignoreDeps=0;
arg_ramdiskSize=0; arg_ramdiskSize=0;
arg_update=1; arg_update=1;
((parsedCommands++)); ((parsedCommands++));
@ -71,19 +70,6 @@ while [ $# -gt 0 ]; do
fi fi
;; ;;
--ignoreDeps=*)
if [[ ${1#*=} =~ ^([yY])$ ]]; then
arg_ignoreDeps=1;
((parsedCommands++));
elif [[ ${1#*=} =~ ^([nN])$ ]]; then
arg_ignoreDeps=0;
((parsedCommands++));
else
printf "Error: Invalid value for ignoreDeps: only Y or N values are accepted.\n"
exit 1
fi
;;
--ramdiskSize=*) --ramdiskSize=*)
if [[ ${1#*=} =~ ^-?[0-9]+$ ]]; then if [[ ${1#*=} =~ ^-?[0-9]+$ ]]; then
arg_ramdiskSize="${1#*=}"; arg_ramdiskSize="${1#*=}";
@ -109,8 +95,6 @@ while [ $# -gt 0 ]; do
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--installCPAN=Y|N Install missing perl modules via CPAN (Y or N)\n" printf -- "--installCPAN=Y|N Install missing perl modules via CPAN (Y or N)\n"
printf " Recommended: Y (yes)\n\n" printf " Recommended: Y (yes)\n\n"
printf -- "--ignoreDeps=Y|N Force .rpm package install regardless of missing dependencies (Y or N)\n"
printf " Recommended: N (no)\n\n"
printf -- "--ramdiskSize=value Create a RAMDISK for incoming spool directory (integer value or 0 for none)\n" printf -- "--ramdiskSize=value Create a RAMDISK for incoming spool directory (integer value or 0 for none)\n"
printf " Suggestions:\n"; printf " Suggestions:\n";
printf " None 0\n"; printf " None 0\n";
@ -167,11 +151,15 @@ fi
# user info screen before the install process starts # user info screen before the install process starts
echo "MailScanner Configuration 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 "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 "via the zypper package manager. Tested distributions are openSUSE 15.4+ and associated";
echo "variants. Internet connectivity is required for this configuration script to execute."; echo "variants. Internet connectivity is required for this configuration script to execute.";
echo; echo;
echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING"; echo "WARNING - Make a backup of any custom configuration files if upgrading - WARNING";
echo; echo;
echo "To install SpamAssassin 4.0, an unprivileged user 'sabuild' will be created and granted";
echo "temporary sudo privileges. This is necessary to obtain a successful build. sudo privileges";
echo "will be removed after install, and you can optionally remove the 'sabuild' user at any time";
echo;
echo "You may press CTRL + C at any time to abort the configuration. 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 "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 "failed tests if you opt to use CPAN. You may also ignore 'No package available' notices";
@ -296,36 +284,6 @@ else
fi fi
fi fi
# ask if the user wants to ignore dependencies. they are automatically ignored
# if the user elected the CPAN option as explained above
if [ $CPANOPTION -ne 1 ]; then
clear
echo;
echo "Do you want to ignore MailScanner dependencies?"; echo;
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;
echo "Recommended: N (no)"; echo;
if [ -z "${arg_ignoreDeps+x}" ]; then
read -r -p "Ignore MailScanner dependencies (nodeps)? [y/N] : " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
# user wants to ignore deps
NODEPS='--nodeps'
else
# requiring deps
NODEPS=
fi
else
if [ ${arg_ignoreDeps} -eq 1 ]; then
NODEPS='--nodeps'
else
NODEPS=
fi
fi
fi
# ask if the user wants to add a ramdisk # ask if the user wants to add a ramdisk
clear clear
echo; echo;
@ -371,55 +329,191 @@ else
fi fi
# base system packages # base system packages
BASEPACKAGES="binutils gcc glibc-devel libaio1 make man-pages patch rpm tar time unzip which zip libtool perl curl wget openssl libopenssl-devel bzip2 tnef unrar razor-agents libbz2-devel"; BASEPACKAGES="
binutils gcc glibc-devel
libaio1 make man-pages
patch rpm tar
time unzip which
zip libtool perl
curl wget openssl
libopenssl-devel bzip2 tnef
unrar razor-agents libbz2-devel
sudo libidn2-devel libdb-4_8-devel
re2c p7zip libmaxminddb-devel
";
# Packages available in the suse base 13.2. If the user elects not to use EPEL or if the # Packages (maybe) available in the suse base 15.4. If the user elects not to use EPEL or if the
# package is not available for their distro release it will be ignored during the install. # package is not available for their distro release it will be ignored during the install.
# #
MOREPACKAGES="perl-Archive-Zip perl-Convert-BinHex perl-Convert-TNEF perl-DBD-SQLite perl-DBI perl-MIME-tools perl-Digest-HMAC perl-Digest-SHA1 perl-ExtUtils-MakeMaker perl-File-ShareDir-Install perl-File-Temp perl-Filesys-Df perl-Getopt-Long-Descriptive perl-IO-stringy perl-HTML-Parser perl-HTML-Tagset perl-Inline perl-Mail-DKIM perl-Mail-SPF perl-MailTools perl-Net-CIDR-Set perl-Net-DNS perl-Net-IP perl-OLE-Storage_Lite perl-Scalar-List-Utils perl-razor-agents perl-Sys-Hostname-Long perl-Sys-SigAction perl-Test-Pod perl-TimeDate perl-URI re2c perl-Encode-Detect perl-Test-Simple p7zip perl-Math-Int64 perl-Path-Class perl-Test-Fatal perl-Test-Number-Delta perl-namespace-autoclean perl-Role-Tiny perl-Data-Dumper-Concise perl-DateTime perl-Test-Warnings perl-autodie perl-Test-Requires perl-Test-Tester perl-Clone-PP perl-File-HomeDir perl-Sort-Naturally perl-JSON-MaybeXS perl-Test-LeakTrace perl-Throwable libmaxminddb-devel"; MOREPACKAGES="
perl-Archive-Tar perl-Archive-Zip perl-bignum
perl-Carp perl-Compress-Zlib perl-Compress-Raw-Zlib
perl-Convert-BinHex perl-Convert-TNEF perl-Data-Dumper
perl-Date-Parse perl-DBD-SQLite perl-Digest-SHA1
perl-Digest-HMAC perl-Digest-MD5 perl-DBI
perl-DirHandle perl-ExtUtils-MakeMaker perl-Fcntl
perl-File-Basename perl-File-Copy perl-File-Path
perl-File-Spec perl-File-Temp perl-FileHandle
perl-Filesys-Df perl-Getopt-Long perl-Inline-C
perl-IO perl-IO-File perl-IO-Pipe
perl-IO-Stringy perl-HTML-Entities perl-HTML-Parser
perl-HTML-Tagset perl-HTML-TokeParser perl-Mail-Field
perl-Mail-Header perl-Mail-IMAPClient perl-Mail-Internet
perl-Math-BigInt perl-Math-BigRat perl-MIME-Base64
perl-MIME-Decoder perl-MIME-Decoder-UU perl-MIME-Head
perl-MIME-Parser perl-MIME-QuotedPrint perl-MIME-Tools
perl-MIME-WordDecoder perl-Net-CIDR perl-Net-DNS
perl-Net-IP perl-OLE-Storage_Lite perl-Pod-Escapes
perl-Pod-Simple perl-POSIX perl-Scalar-Util
perl-Socket perl-Storable perl-Test-Harness
perl-Test-Pod perl-Test-Simple perl-Time-HiRes
perl-Time-localtime perl-Sys-Hostname-Long perl-Sys-SigAction
perl-Sys-Syslog perl-Env perl-File-ShareDir-Install
perl-Data-Dump perl-DB_File perl-Getopt-Long-Descriptive
perl-Mail-DKIM perl-Digest perl-Encode-Detect
perl-Error perl-ExtUtils-CBuilder perl-ExtUtils-ParseXS
perl-Getopt-Long perl-Inline perl-IO-String
perl-IO-Zlib perl-IP-Country perl-Mail-SPF
perl-Mail-SPF-Query perl-Module-Build perl-Net-CIDR-Lite
perl-Net-DNS perl-Net-LDAP perl-Net-DNS-Resolver-Programmable
perl-NetAddr-IP perl-Parse-RecDescent perl-Test-Harness
perl-Test-Manifest perl-Text-Balanced perl-URI
perl-version perl-IO-Compress-Bzip2 perl-Sendmail-PMilter
perl-Math-Int64 perl-IP-Country-DB_File perl-namespace-autoclean
perl-Data-IEEE754 perl-Data-Printer perl-Data-Validate-IP
perl-List-AllUtils perl-List-SomeUtils perl-Net-Works-Network
perl-List-UtilsBy perl-MaxMind-DB-Metadata perl-MaxMind-DB-Reader
perl-Module-Runtime perl-Moo perl-MooX-StrictConstructor
perl-Role-Tiny perl-strictures perl-MaxMind-DB-Reader-XS
perl-Sub-Quote perl-Math-Int128 perl-HTTP-Date
perl-MailTools perl-Net-CIDR-Set perl-TimeDate
perl-Test-Fatal perl-Test-Number-Delta perl-Data-Dumper-Concise
perl-DateTime perl-Test-Warnings perl-autodie
perl-Test-Requires perl-Test-Tester perl-Clone-PP
perl-File-HomeDir perl-Sort-Naturally perl-JSON-MaybeXS
perl-Test-LeakTrace perl-Throwable perl-Email-Address-XS
perl-Net-LibIDN perl-Net-LibIDN2 perl-Test-Perl-Critic
perl-IO-Socket-INET6 perl-Devel-Hide perl-Algorithm-Diff
perl-Alien-Build perl-Alien-Libxml2 perl-Alien-Build-Plugin-Download-GitLab
perl-Authen-SASL perl-B-COW perl-B-Keywords
perl-BSD-Resource perl-Capture-Tiny perl-Class-Tiny
perl-Clone perl-Config-Tiny perl-DBIx-Simple
perl-Devel-Cycle perl-Email-Abstract perl-Email-Address-XS
perl-Email-Date-Format perl-Email-MIME perl-Email-MIME-ContentType
perl-Email-MessageID perl-Email-Sender perl-Email-MIME-Encodings
perl-Email-Simple perl-Encode perl-Encode-Locale
perl-ExtUtils-Config perl-ExtUtils-Helpers perl-ExtUtils-InstallPaths
perl-FFI-CheckLib perl-File-Listing perl-File-Slurper
perl-File-chdir perl-Path-Class perl-Geo-IP
perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Message
perl-HTTP-Negotiate perl-Hook-LexWrap perl-IO-Compress-Brotli
perl-IO-HTML perl-IO-Socket-SSL perl-Importer
perl-LWP-MediaTypes perl-Lingua-EN-Inflect perl-MIME-Charset
perl-MIME-Types perl-Mail-DMARC perl-Module-Build-Tiny
perl-Module-Pluggable perl-MooX-Types-MooseLike perl-Mozilla-CA
perl-Net-HTTP perl-Net-IDN-Encode perl-Net-IMAP-Simple
perl-Net-Patricia perl-Net-SMTPS perl-Net-SSLeay
perl-PPI perl-PPIx-QuoteLike perl-PPIx-Regexp
perl-PPIx-Utilities perl-Perl-Critic perl-Perl-Critic-Policy-Perlsecret
perl-Perl-Tidy perl-PerlIO-utf8_strict perl-Pod-Spell
perl-Readonly perl-Readonly-XS perl-Regexp-Common
perl-Scope-Guard perl-Socket6 perl-String-Format
perl-Sub-Info perl-Task-Weaken perl-Term-Size-Any
perl-Term-Size-Perl perl-Term-Table perl-Test-Exception
perl-Test-FailWarnings perl-Test-File-ShareDir perl-Test-Needs
perl-Test-NoWarnings perl-Test-Object perl-Test-Output
perl-Test-Regexp perl-Test-RequiresInternet perl-Test-Simple
perl-Test-SubCalls perl-Test2-Suite perl-Text-Diff
perl-Text-Unidecode perl-Time-Local perl-Unicode-LineBreak
perl-WWW-RobotRules perl-XML-LibXML perl-XML-NamespaceSupport
perl-XML-SAX perl-XML-SAX-Base perl-libwww-perl
"
# the array of perl modules needed # the array of perl modules needed
ARMOD=(); ARMOD=();
ARMOD+=('Archive::Tar'); ARMOD+=('Archive::Zip'); ARMOD+=('bignum');
ARMOD+=('Carp'); ARMOD+=('Compress::Zlib'); ARMOD+=('Compress::Raw::Zlib'); ARMOD+=('Archive::Tar'); ARMOD+=('Archive::Zip'); ARMOD+=('bignum');
ARMOD+=('Convert::BinHex'); ARMOD+=('Convert::TNEF'); ARMOD+=('Data::Dumper'); ARMOD+=('Carp'); ARMOD+=('Compress::Zlib'); ARMOD+=('Compress::Raw::Zlib');
ARMOD+=('Date::Parse'); ARMOD+=('DBD::SQLite'); ARMOD+=('DBI'); ARMOD+=('Convert::BinHex'); ARMOD+=('Convert::TNEF'); ARMOD+=('Data::Dumper');
ARMOD+=('Digest::HMAC'); ARMOD+=('Digest::MD5'); ARMOD+=('Digest::SHA1'); ARMOD+=('Date::Parse'); ARMOD+=('DBD::SQLite'); ARMOD+=('Digest::SHA1');
ARMOD+=('DirHandle'); ARMOD+=('ExtUtils::MakeMaker'); ARMOD+=('Fcntl'); ARMOD+=('Digest::HMAC'); ARMOD+=('Digest::MD5'); ARMOD+=('DBI');
ARMOD+=('File::Basename'); ARMOD+=('File::Copy'); ARMOD+=('File::Path'); ARMOD+=('DirHandle'); ARMOD+=('ExtUtils::MakeMaker'); ARMOD+=('Fcntl');
ARMOD+=('File::Spec'); ARMOD+=('File::Temp'); ARMOD+=('FileHandle'); ARMOD+=('File::Basename'); ARMOD+=('File::Copy'); ARMOD+=('File::Path');
ARMOD+=('Filesys::Df'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline::C'); ARMOD+=('File::Spec'); ARMOD+=('File::Temp'); ARMOD+=('FileHandle');
ARMOD+=('IO'); ARMOD+=('IO::File'); ARMOD+=('IO::Pipe'); ARMOD+=('Filesys::Df'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline::C');
ARMOD+=('IO::Stringy'); ARMOD+=('HTML::Entities'); ARMOD+=('HTML::Parser'); ARMOD+=('IO'); ARMOD+=('IO::File'); ARMOD+=('IO::Pipe');
ARMOD+=('HTML::Tagset'); ARMOD+=('HTML::TokeParser'); ARMOD+=('Mail::Field'); ARMOD+=('IO::Stringy'); ARMOD+=('HTML::Entities'); ARMOD+=('HTML::Parser');
ARMOD+=('Mail::Header'); ARMOD+=('Mail::IMAPClient'); ARMOD+=('Mail::Internet'); ARMOD+=('HTML::Tagset'); ARMOD+=('HTML::TokeParser'); ARMOD+=('Mail::Field');
ARMOD+=('Math::BigInt'); ARMOD+=('Math::BigRat'); ARMOD+=('MIME::Base64'); ARMOD+=('Mail::Header'); ARMOD+=('Mail::IMAPClient'); ARMOD+=('Mail::Internet');
ARMOD+=('MIME::Decoder'); ARMOD+=('MIME::Decoder::UU'); ARMOD+=('MIME::Head'); ARMOD+=('Math::BigInt'); ARMOD+=('Math::BigRat'); ARMOD+=('MIME::Base64');
ARMOD+=('MIME::Parser'); ARMOD+=('MIME::QuotedPrint'); ARMOD+=('MIME::Tools'); ARMOD+=('MIME::Decoder'); ARMOD+=('MIME::Decoder::UU'); ARMOD+=('MIME::Head');
ARMOD+=('MIME::WordDecoder'); ARMOD+=('Net::CIDR'); ARMOD+=('Net::DNS'); ARMOD+=('MIME::Parser'); ARMOD+=('MIME::QuotedPrint'); ARMOD+=('MIME::Tools');
ARMOD+=('Net::IP'); ARMOD+=('OLE::Storage_Lite'); ARMOD+=('Pod::Escapes'); ARMOD+=('MIME::WordDecoder'); ARMOD+=('Net::CIDR'); ARMOD+=('Net::DNS');
ARMOD+=('Pod::Simple'); ARMOD+=('POSIX'); ARMOD+=('Scalar::Util'); ARMOD+=('Net::IP'); ARMOD+=('OLE::Storage_Lite'); ARMOD+=('Pod::Escapes');
ARMOD+=('Socket'); ARMOD+=('Storable'); ARMOD+=('Test::Harness'); ARMOD+=('Pod::Simple'); ARMOD+=('POSIX'); ARMOD+=('Scalar::Util');
ARMOD+=('Test::Pod'); ARMOD+=('Test::Simple'); ARMOD+=('Time::HiRes'); ARMOD+=('Socket'); ARMOD+=('Storable'); ARMOD+=('Test::Harness');
ARMOD+=('Time::localtime'); ARMOD+=('Sys::Hostname::Long'); ARMOD+=('Sys::SigAction'); ARMOD+=('Test::Pod'); ARMOD+=('Test::Simple'); ARMOD+=('Time::HiRes');
ARMOD+=('Sys::Syslog'); ARMOD+=('Env'); ARMOD+=('bignum'); ARMOD+=('Time::localtime'); ARMOD+=('Sys::Hostname::Long'); ARMOD+=('Sys::SigAction');
ARMOD+=('Data::Dump'); ARMOD+=('DB_File'); ARMOD+=('DBD::SQLite'); ARMOD+=('Sys::Syslog'); ARMOD+=('Env'); ARMOD+=('File::ShareDir::Install');
ARMOD+=('DBI'); ARMOD+=('Digest'); ARMOD+=('Encode::Detect'); ARMOD+=('Data::Dump'); ARMOD+=('DB_File'); ARMOD+=('Getopt::Long::Descriptive');
ARMOD+=('Error'); ARMOD+=('ExtUtils::CBuilder'); ARMOD+=('ExtUtils::ParseXS'); ARMOD+=('Mail::DKIM'); ARMOD+=('Digest'); ARMOD+=('Encode::Detect');
ARMOD+=('Getopt::Long'); ARMOD+=('Inline'); ARMOD+=('IO::String'); ARMOD+=('Error'); ARMOD+=('ExtUtils::CBuilder'); ARMOD+=('ExtUtils::ParseXS');
ARMOD+=('IO::Zlib'); ARMOD+=('IP::Country'); ARMOD+=('Mail::SPF'); ARMOD+=('Getopt::Long'); ARMOD+=('Inline'); ARMOD+=('IO::String');
ARMOD+=('Mail::SPF::Query'); ARMOD+=('Module::Build'); ARMOD+=('Net::CIDR::Lite'); ARMOD+=('IO::Zlib'); ARMOD+=('IP::Country'); ARMOD+=('Mail::SPF');
ARMOD+=('Net::DNS'); ARMOD+=('Net::LDAP'); ARMOD+=('Net::DNS::Resolver::Programmable'); ARMOD+=('Mail::SPF::Query'); ARMOD+=('Module::Build'); ARMOD+=('Net::CIDR::Lite');
ARMOD+=('NetAddr::IP'); ARMOD+=('Parse::RecDescent'); ARMOD+=('Test::Harness'); ARMOD+=('Net::DNS'); ARMOD+=('Net::LDAP'); ARMOD+=('Net::DNS::Resolver::Programmable');
ARMOD+=('Test::Manifest'); ARMOD+=('Text::Balanced'); ARMOD+=('URI'); ARMOD+=('NetAddr::IP'); ARMOD+=('Parse::RecDescent'); ARMOD+=('Test::Harness');
ARMOD+=('version'); ARMOD+=('IO::Compress::Bzip2'); ARMOD+=('Sendmail::PMilter'); ARMOD+=('Test::Manifest'); ARMOD+=('Text::Balanced'); ARMOD+=('URI');
ARMOD+=('Math::Int64'); ARMOD+=('IP::Country::DB_File'); ARMOD+=('namespace::autoclean'); ARMOD+=('version'); ARMOD+=('IO::Compress::Bzip2'); ARMOD+=('Sendmail::PMilter');
ARMOD+=('Data::IEEE754'); ARMOD+=('Data::Printer'); ARMOD+=('Data::Validate::IP'); ARMOD+=('Math::Int64'); ARMOD+=('IP::Country::DB_File'); ARMOD+=('namespace::autoclean');
ARMOD+=('List::AllUtils'); ARMOD+=('List::SomeUtils'); ARMOD+=('Net::Works::Network'); ARMOD+=('Data::IEEE754'); ARMOD+=('Data::Printer'); ARMOD+=('Data::Validate::IP');
ARMOD+=('List::UtilsBy'); ARMOD+=('MaxMind::DB::Metadata'); ARMOD+=('MaxMind::DB::Reader'); ARMOD+=('List::AllUtils'); ARMOD+=('List::SomeUtils'); ARMOD+=('Net::Works::Network');
ARMOD+=('Module::Runtime'); ARMOD+=('Moo'); ARMOD+=('MooX::StrictConstructor'); ARMOD+=('List::UtilsBy'); ARMOD+=('MaxMind::DB::Metadata'); ARMOD+=('MaxMind::DB::Reader');
ARMOD+=('Role::Tiny'); ARMOD+=('strictures'); ARMOD+=('MaxMind::DB::Reader::XS'); ARMOD+=('Module::Runtime'); ARMOD+=('Moo'); ARMOD+=('MooX::StrictConstructor');
ARMOD+=('Sub::Quote'); ARMOD+=('Math::Int128'); ARMOD+=('HTTP::Date'); ARMOD+=('Role::Tiny'); ARMOD+=('strictures'); ARMOD+=('MaxMind::DB::Reader::XS');
ARMOD+=('Sub::Quote'); ARMOD+=('Math::Int128'); ARMOD+=('HTTP::Date');
ARMOD+=('MailTools'); ARMOD+=('Net::CIDR::Set'); ARMOD+=('TimeDate');
ARMOD+=('Test::Fatal'); ARMOD+=('Test::Number::Delta'); ARMOD+=('Data::Dumper::Concise');
ARMOD+=('DateTime'); ARMOD+=('Test::Warnings'); ARMOD+=('autodie');
ARMOD+=('Test::Requires'); ARMOD+=('Test::Tester'); ARMOD+=('Clone::PP');
ARMOD+=('File::HomeDir'); ARMOD+=('Sort::Naturally'); ARMOD+=('JSON::MaybeXS');
ARMOD+=('Test::LeakTrace'); ARMOD+=('Throwable'); ARMOD+=('Email::Address::XS');
ARMOD+=('Net::LibIDN'); ARMOD+=('Net::LibIDN2'); ARMOD+=('Test::Perl::Critic');
ARMOD+=('IO::Socket::INET6'); ARMOD+=('Devel::Hide'); ARMOD+=('Algorithm::Diff');
ARMOD+=('Alien::Build'); ARMOD+=('Alien::Libxml2'); ARMOD+=('Alien::Build::Plugin::Download::GitLab');
ARMOD+=('Authen::SASL'); ARMOD+=('B::COW'); ARMOD+=('B::Keywords');
ARMOD+=('BSD::Resource'); ARMOD+=('Capture::Tiny'); ARMOD+=('Class::Tiny');
ARMOD+=('Clone'); ARMOD+=('Config::Tiny'); ARMOD+=('DBIx::Simple');
ARMOD+=('Devel::Cycle'); ARMOD+=('Email::Abstract'); ARMOD+=('Email::Address::XS');
ARMOD+=('Email::Date::Format'); ARMOD+=('Email::MIME'); ARMOD+=('Email::MIME::ContentType');
ARMOD+=('Email::MessageID'); ARMOD+=('Email::Sender'); ARMOD+=('Email::MIME::Encodings');
ARMOD+=('Email::Simple'); ARMOD+=('Encode'); ARMOD+=('Encode::Locale');
ARMOD+=('ExtUtils::Config'); ARMOD+=('ExtUtils::Helpers'); ARMOD+=('ExtUtils::InstallPaths');
ARMOD+=('FFI::CheckLib'); ARMOD+=('File::Listing'); ARMOD+=('File::Slurper');
ARMOD+=('File::chdir'); ARMOD+=('Path::Class'); ARMOD+=('Geo::IP');
ARMOD+=('HTTP::Cookies'); ARMOD+=('HTTP::Daemon'); ARMOD+=('HTTP::Message');
ARMOD+=('HTTP::Negotiate'); ARMOD+=('Hook::LexWrap'); ARMOD+=('IO::Compress::Brotli');
ARMOD+=('IO::HTML'); ARMOD+=('IO::Socket::SSL'); ARMOD+=('Importer');
ARMOD+=('LWP::MediaTypes'); ARMOD+=('Lingua::EN::Inflect'); ARMOD+=('MIME::Charset');
ARMOD+=('MIME::Types'); ARMOD+=('Mail::DMARC'); ARMOD+=('Module::Build::Tiny');
ARMOD+=('Module::Pluggable'); ARMOD+=('MooX::Types::MooseLike'); ARMOD+=('Mozilla::CA');
ARMOD+=('Net::HTTP'); ARMOD+=('Net::IDN::Encode'); ARMOD+=('Net::IMAP::Simple');
ARMOD+=('Net::Patricia'); ARMOD+=('Net::SMTPS'); ARMOD+=('Net::SSLeay');
ARMOD+=('PPI'); ARMOD+=('PPIx::QuoteLike'); ARMOD+=('PPIx::Regexp');
ARMOD+=('PPIx::Utilities'); ARMOD+=('Perl::Critic'); ARMOD+=('Perl::Critic::Policy::Perlsecret');
ARMOD+=('Perl::Tidy'); ARMOD+=('PerlIO::utf8_strict'); ARMOD+=('Pod::Spell');
ARMOD+=('Readonly'); ARMOD+=('Readonly::XS'); ARMOD+=('Regexp::Common');
ARMOD+=('Scope::Guard'); ARMOD+=('Socket6'); ARMOD+=('String::Format');
ARMOD+=('Sub::Info'); ARMOD+=('Task::Weaken'); ARMOD+=('Term::Size::Any');
ARMOD+=('Term::Size::Perl'); ARMOD+=('Term::Table'); ARMOD+=('Test::Exception');
ARMOD+=('Test::FailWarnings'); ARMOD+=('Test::File::ShareDir'); ARMOD+=('Test::Needs');
ARMOD+=('Test::NoWarnings'); ARMOD+=('Test::Object'); ARMOD+=('Test::Output');
ARMOD+=('Test::Regexp'); ARMOD+=('Test::RequiresInternet'); ARMOD+=('Test::Simple');
ARMOD+=('Test::SubCalls'); ARMOD+=('Test2::Suite'); ARMOD+=('Text::Diff');
ARMOD+=('Text::Unidecode'); ARMOD+=('Time::Local'); ARMOD+=('Unicode::LineBreak');
ARMOD+=('WWW::RobotRules'); ARMOD+=('XML::LibXML'); ARMOD+=('XML::NamespaceSupport');
ARMOD+=('XML::SAX'); ARMOD+=('XML::SAX::Base'); ARMOD+=('LWP::UserAgent')
# additional spamassassin plugins # additional spamassassin plugins
SAMOD=(); SAMOD=();
@ -494,7 +588,7 @@ if [ $CPANOPTION -eq 1 ]; then
echo "CPAN config missing. Creating one ..."; echo; echo "CPAN config missing. Creating one ..."; echo;
mkdir -p /root/.cpan/CPAN mkdir -p /root/.cpan/CPAN
cd /root/.cpan/CPAN cd /root/.cpan/CPAN
$CURL -O https://s3.amazonaws.com/msv5/CPAN/MyConfig.pm $CURL -LO https://mirrors.efa-project.org/msv5/CPAN/SUSE/root/MyConfig.pm
cd "$THISCURRPMDIR" cd "$THISCURRPMDIR"
timewait 1 timewait 1
fi fi
@ -529,18 +623,6 @@ timewait 2
# used to trigger a wait if something this missing # used to trigger a wait if something this missing
PMODWAIT=0 PMODWAIT=0
# first try to install missing perl modules via zypper
# using this trick
for i in "${ARMOD[@]}"
do
perldoc -l $i >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$i is missing. Trying to install via Zypper ..."; echo;
THING="perl($i)";
$ZYPPER --non-interactive --ignore-unknown install $THING
fi
done
for i in "${ARMOD[@]}" for i in "${ARMOD[@]}"
do do
perldoc -l $i >/dev/null 2>&1 perldoc -l $i >/dev/null 2>&1
@ -563,45 +645,67 @@ do
fi fi
done done
for i in "${SAMOD[@]}" function install_sa() {
do # Create sabuild user and set up for sudo build (SA 4.0+)
perldoc -l $i >/dev/null 2>&1 groupadd sabuild
if [ $? -ne 0 ]; then useradd -m -s /sbin/nologin -g sabuild sabuild &>/dev/null
if [ $CPANOPTION -eq 1 ]; then id -u sabuild &>/dev/null
clear if [ $? -eq 0 ]; then
echo "$i is missing. Installing via CPAN ..."; echo; echo "sabuild ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sabuild
timewait 1 if [ ! -f '/home/sabuild/.cpan/CPAN/MyConfig.pm' ]; then
if [ $AUTOCPAN -eq 0 ]; then echo;
perl -MCPAN -e "CPAN::Shell->force(qw(install $i ));" echo "CPAN config missing. Creating one ..."; echo;
else mkdir -p /home/sabuild/.cpan/CPAN
cpanm --force --no-interactive $i cd /home/sabuild/.cpan/CPAN
fi $CURL -LO https://mirrors.efa-project.org/msv5/CPAN/SUSE/sabuild/MyConfig.pm
else chown -R sabuild:sabuild /home/sabuild/.cpan
echo "WARNING: $i is missing. You should fix this."; cd "$THISCURRPMDIR"
PMODWAIT=5
fi fi
for i in "${SAMOD[@]}"
do
perldoc -l $i >/dev/null 2>&1
if [[ $? -ne 0 || $1 == "update" ]]; then
if [ $CPANOPTION -eq 1 ]; then
clear
echo "$i is missing or needs updated. Installing via CPAN ..."; echo;
timewait 1
su - sabuild -s /bin/bash -c "echo \"\\\n\" | perl -MCPAN -e \"CPAN::Shell->force(qw(install $i ));\""
else
echo "WARNING: $i is missing. You should fix this.";
PMODWAIT=5
fi
else
echo "$i => OK";
fi
done
# Cleanup, just revoke sudo privs
rm -f /etc/sudoers.d/sabuild
else else
echo "$i => OK"; echo "Unable to create sabuild user, cannot install spamassassin"
echo "You should fix this."
fi fi
done }
install_sa
# Update perl modules # Update perl modules
if [[ -n "${arg_update+x}" && $AUTOCPAN -ne 0 ]]; then if [[ -n "${arg_update+x}" && $AUTOCPAN -ne 0 ]]; then
cpanm App::cpanoutdated cpanm App::cpanoutdated
cpan-outdated -p | cpanm --force --no-interactive for i in $(cpan-outdated -p); do
if [ "$i" == "Mail::SpamAssassin" ]; then
# Check for and override spamassassin rpm, if present # Check for spamassassin rpm and notify user
if [[ -n $(rpm -qa | grep spamassassin) ]]; then if [[ -n $($RPM -qa | grep spamassassin) ]]; then
echo "Possibly outdated Spamassassin detected, installing from CPAN..." echo "Spamassassin detected installed via rpm. To update spamassassin use your package manager."
$RPM -e spamassassin timewait 1
cpanm --force --no-interactive Mail::SpamAssassin else
perldoc -l Mail::SpamAssassin >/dev/null 2>&1 install_sa "update"
if [ $? -ne 0 ]; then
echo "Error installing spamassassin from CPAN, rolling back..."
$ZYPPER --non-interactive --ignore-unknown install spamassassin
echo "WARNING: spamassassin is potentially outdated, you should fix this."
fi fi
fi else
cpanm --force --no-interactive $i
fi
done
fi fi
# will pause if a perl module was missing # will pause if a perl module was missing