Upgrading(Obsolete)
From QMail-Toaster
[edit] Upgrading(Obsolete)
To update your toaster manually, you must remove libdomainkeys, control-panel-toaster and spamassassin-toaster with "rpm -e --nodeps", just prior to updating, to ensure a clean build on all the packages. So, remove these three packages and use the current-install script for your distro found in the "Utilities" section at http://www.qmailtoaster.com.
qmailmrtg-upgrade-fix.sh script
djbdns-localcache-install.sh script
[edit] qmail-toaster-1.03-1.0.15 to qmail-toaster-1.03-1.3.5 upgrade notes
I finally upgraded a few years old qmail-toaster installation to the newest version under CentOS 3.
I thought I'd share my experiences, If someone else is planning a same kind of operation.
First I shutdown my toaster:
# service qmail stop
Now no new messages are accepted and they are queued at the sending end (I have no 2ndary MX). I sent a test message outside the server just to find out how soon the message would reach me after I got my toaster back up and running (the result: I received the message about 6hrs after my toaster was started again).
Downloaded Jake's backup script
Unpackaged the backup script:
(Note: There are newer versions of th backup and restore scripts available)
# tar xfz qmail-restore-script-1.2.tar.gz
Edited the user variables and mysql settings in qmail-backup script and then ran it:
# ./qmail-backup-2.7.sh
The backup took several hours to complete.
Then I removed conflicting old packages:
# rpm -e --nodeps libdomainkeys control-panel-toaster spamassassin-toaster \ courier-imap-toaster-doc
And installed a dependency I knew (from my test upgrade) I would need (these are probably CentOS 3 specific):
# yum install pcre-devel # wget \
# rpm -ivh perl-forward-compat-5.8.0-0.fdr.2.i386.rpm
Next I used the upgrade script from http://wiki.qmailtoaster.com that I had downloaded previously. It downloads the needed packages, recompiles them and then installs them. You can probably do this by hand, too. The script I used was "Last modified: May 26, 2006". The script has been updated since and uses a sandbox nowadays. I did not try with the new script. If you need the one I used, I can send a copy.
I edited the variables in the beginning of the scrip to match my setup:
DISTRO=rht90 ARCH=i386 BDIR=redhat
And then ran it:
# ./qmailtoaster_upgrade.sh
After the script finished, I checked my mysql setup from /var/qmail/control/sql and inserted the same info to the new mysql setup file /home/vpopmail/etc/vpopmail.mysql
As I use smtproutes, I wanted to disable domainkeys. I also found out that badmimetypes was also blocking attachments (.exe for example) which I wanted to get rid of. So I edited /etc/tcprules.d/tcp.smtp to look like this:
127.:allow,RELAYCLIENT=""
123.123.123.123:allow,RELAYCLIENT=""
:allow,CHKUSER_RCPTLIMIT="50",CHKUSER_WRONGRCPTLIMIT="10",QMAILQUEUE="/var/qmail/bin/simscan"
where 123.123.123.123 was my email server's ip address. I rebuilt the cdb:
# cd /etc/tcprules.d/ # tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp
I also found out that I needed to setup the Qmail Toaster Admin htaccess password again with htpasswd and that qmailadmin URL had changed to /qmailadmin/ (at least with me it was previously at /toaster.admin/ or similiar)
Then I replaced the startup init script to the new one:
# cd /etc/init.d/ # mv qmail.rpmnew qmail
And started the service.
After startup everything else was fine, except that I found out that mail sent from command line did not get a domain set correctly (it was empty). I found out that in /var/qmail/control/ new files defaulthost and defaultdomain were created and that they were empty. I added my host and domain name to those files, and restarted the service.
I also noticed that all forwards were working but they did not show up in qmailadmin. The old .qmail files are no longer supported and the forward information is now stored in MySQL. After running the forward upgrade script from $VPOPMAILDIRl/bin/ they showed up correctly in qmailadmin.
The last step was configuring spamassassin, which did not exist in my previous install:
Simcontrol sits before Spam Assassin. Define what hosts should be scanned in:
/var/qmail/control/simcontrol
Which looks like this:
mydomain.com:clam=yes,spam=yes,spam_hits=20,attach=.src:.bat:.pif :clam=no,spam=no,spam_hits=12,attach=.src:.bat:.pif
Spam for mydomain.com with hits more than 20 will be deleted automatically. The file extensions listed are blocked.
The line starting with : defines what is done for other domains (no virus or spam filtering in my setup, but attachments are blocked).
NOTE: File extension blocking is also done at /var/qmail/control/badmimetypes which is complicated to configure. I found it better to turn it off by editing
/etc/tcprules.d/tcp.smtp
and by removing from it these definitions:
BADMIMETYPE="",BADLOADERTYPE="M"
(rebuild tcp.smtp.cdb after that)
If you make changes to the simcontrol file, execute:
# /var/qmail/bin/simscanmk # /var/qmail/bin/simscanmk -g # /var/qmail/bin/qmail-badloadertypes # /var/qmail/bin/qmail-badmimetypes # qmailctl cdb
More simscan information available at:
http://qmailwiki.inter7.com/Simscan/Guide
If mail gets through Simscan, Spamassassin will process it. Basic help: available at wiki
The config file:
/etc/mail/spamassassin/local.cf
Basic config:
bayes_path /home/vpopmail/.spamassassin/bayes ok_locales all skip_rbl_checks 1 required_hits 5 report_safe 0 rewrite_header Subject ***SPAM*** use_pyzor 1 use_auto_whitelist 1 use_bayes 1 use_bayes_rules 1 bayes_auto_learn 1
Note the addition bayes_path done by me at the beginning of config. It was added for that when issuing spamassassin commands as root you would use the correct Bayes DB and not the default one for root that is located at /root/.spamassassin/bayes
If we reach score 5, then the subject is rewrited as ***SPAM***
If you make changes, check that they are ok:
# spamassassin -D --lint
Now you need to restart spamd. Best way to achieve this is to copy Jake's spamd script to /usr/local/bin directory as qmail-spamd
And then issue
# chmod u+rwx /usr/local/bin/qmail-spamd # qmail-spamd restart
You should make spam and ham subfolders under your INBOX and move all messages that spamassassin does not recognize correctly to there (do not use forwarded messages -- they might teach Spamassassin that forwarded mail is spam!) and then teach your Spamassassin with sa-learn:
# cd home/vpopmail/domains/mydom.com/username/Maildir/.spam/cur/ # /usr/bin/sa-learn --showdots --no-sync --spam ./* # cd home/vpopmail/domains/mydom.com/username/Maildir/.ham/cur/ # /usr/bin/sa-learn --showdots --no-sync --ham ./* # /usr/bin/sa-learn --sync
You should see something like this if it's working right when you run
# spamassassin -D --lint
[2643] dbg: bayes: tie-ing to DB file R/O /home/vpopmail/.spamassassin/bayes_toks [2643] dbg: bayes: tie-ing to DB file R/O /home/vpopmail/.spamassassin/bayes_seen
[12512] dbg: bayes: DB journal sync: last sync: 1156140306 [12512] dbg: bayes: corpus size: nspam = 1143, nham = 651
If the output complains about missing perl modules, install them. Here's what I did:
# yum install perl-Archive-Tar perl-IO-Zlib perl-Net-DNS perl-IO-Socket-SSL # perl -MCPAN -e shell # install Mail::SPF::Query # install IP::Country::Fast
Note, it is ok to get:
dbg: diag: module not installed: Net::Ident ('require' failed)
dbg: diag: module not installed: IO::Socket::INET6 ('require' failed)
dbg: diag: module not installed: Razor2::Client::Agent ('require' failed)
It might also be good idea to use SURBL