This is just a 'documentation dump' that I had to make to perform this upgrade. Note that MailScanner 5 in its current incarnation annihilates your existing MailScanner 4.x installation. E.g.: it has not been 'delinuxized', so all paths are wrong. I have managed to perform the upgrade on seven servers using the following steps. Please review them all, do not just type them in without knowing what you're doing.
Now edit file defaults. Fix all paths!
Be sure to comment out include /usr/local/etc/MailScanner/conf.d/* in my_config.conf (or you will have an endless start loop).
Now review the /rules/ directory in /somewhere/etc-MailScanner and put wanted rules back.
Also review .conf files (not MailScanner.conf) in /somewhere/etc-MailScanner and (re)apply them to the ones in /usr/local/etc/MailScanner, if and when needed.
Any remaining errors (also check /var/log/maillog!) are likely to be changed file/configuration names, which you can change by hand (either in your my_config.conf or by renaming files).
Test for output errors, and fix those:
If MailScanner starts cleanly (again: also check /var/log/maillog!):
Code:
# cp -Rp /usr/local/etc/MailScanner /somewhere/etc-MailScanner
# cp -Rp /usr/local/lib/MailScanner /somewhere/lib-MailScanner
# cp -Rp /usr/local/libexec/MailScanner /somewhere/libexec-MailScanner
# cp -Rp /usr/local/share/MailScanner /somewhere/share-MailScanner
# service mta stop
# service mailscanner stop
# pkg delete -y mailscanner
# pkg autoremove -y
# rm -rf /usr/local/etc/MailScanner
# rm -rf /usr/local/lib/MailScanner
# rm -rf /usr/local/libexec/MailScanner
# rm -rf /usr/local/share/MailScanner
# pkg install -y MailScanner
# cd /etc && ln -s /usr/local/etc/MailScanner
# cd /usr/lib && ln -s /usr/local/lib/MailScanner
# cd /usr/share && ln -s /usr/local/share/MailScanner
# cd /usr/sbin && ln -s /usr/local/sbin/MailScanner
# cd /usr/local/etc/MailScanner/
Code:
# cd /usr/local/etc/MailScanner/conf.d/
# grep -v -e ^$ -e ^# /somewhere/etc-MailScanner/MailScanner.conf > my_config.conf
Code:
# cd /usr/sbin/
(if your shell complains during the next command, type 'sh' and enter)
# ls /usr/local/sbin/ms-* | while read file
do ln -s "${file}"
done
(if you typed 'sh' before doing this, you can press Ctl+d now)
# cd /usr/local/sbin
# ln -s MailScanner mailscanner
# mkdir -p /usr/local/lib/MailScanner/MailScanner
# cp -Rp /somewhere/lib-MailScanner/MailScanner/CustomFunctions /usr/local/lib/MailScanner/MailScanner/
# mkdir /usr/local/lib/MailScanner/wrapper
# cp -p /somewhere/libexec-MailScanner/* /usr/local/lib/MailScanner/wrapper/
Also review .conf files (not MailScanner.conf) in /somewhere/etc-MailScanner and (re)apply them to the ones in /usr/local/etc/MailScanner, if and when needed.
Code:
# service mailscanner start
Test for output errors, and fix those:
Code:
# /usr/local/sbin/ms-cron HOURLY
# /usr/local/sbin/ms-cron DAILY
Code:
# service mta restart
Last edited: