Last year in September, we published “Maia Mailguard Setup On FreeBSD” as the sixth article of the compelete Postfix email system guide. Overlapping the new release of FreeBSD, new Maia version also has some major changes in its layout and mechanics. Therefore, we decided to post a quick essay over the new installation and configuration routines of Maia Mailguard, yet more by testing it on FreeBSD 9.0 platform. But please keep in mind that here we’ll only give the differences between our original “Maia Mailguard Setup On FreeBSD” article, and the achievement of this setup is bound to previous Postfix system component setups in one way or another.
It seems that amavisd will no longer be used and it has been replaced by maiad, the derivative of amavisd which was customized for Maia Mailguard moreso we believe. Other changes are related with the directory layout (/var/maiad/) and some other configuration enhancements.
Here are the configuration defaults of maia-1.0.3.r1575_1
MYSQL MYSQLSERVER DOVECOT POSTFIX CLAMAV SPAMASSASSIN BDB IPCOUNTRY DOMAINKEYS SPF DKIM FILE UNRAR ARJ LHA ARC CAB RPM ZOO FREEZE P7ZIP
We add APACHE, WEBHOST, FUZZYOCR, GRAPHICS, CRYPT and RAR while we remove MYSQL and MYSQLSERVER duo, as MYSQL option tries to install mysql-client meaninglessly although it has to skip it as it is already installed on the system.
+APACHE +WEBHOST -MYSQL -MYSQLSERVER +FUZZYOCR +GRAPHICS +CRYPT +RAR
Install the port, create your new maia database, transfer the initial mysql schema from /usr/local/share/doc/maia as explained before. Below are the additional parts that has to be modified inside /usr/local/etc/maia.conf;
$auth_method = 'sql'; $system_rules_dir = '/usr/local/share/spamassassin'; # default: let the script find it
# /var/maiad/maia/scripts/configtest.pl
MAIA MAILGUARD CONFIGURATION TEST This script checks for the presence of applications and Perl modules required by maiad, SpamAssassin, and Maia Mailguard's maintenance scripts. Version numbers are also checked, and if a newer version of a component is recommended, you should consider upgrading to at least the minimum recommended version. If you have already configured your Maia Mailguard database, the script will also test the connection to that database. Remember also to run the configtest.php script on your web server to perform similar tests of your web, PHP, and PEAR environment. Application/Module Version Status ======================================================================== Perl : 5.12.4 : OK file(1) : 5.03 : OK Archive::Tar : 1.54 : OK Archive::Zip : 1.30 : OK BerkeleyDB : 0.50 : OK Compress::Zlib : 2.048 : OK Convert::TNEF : 0.17 : OK Convert::UUlib : 1.4 : OK Crypt::Blowfish : 2.12 : OK Crypt::CBC : 2.30 : OK Crypt::OpenSSL::RSA : 0.28 : OK Data::UUID : 1.217 : OK DB_File : 1.82 : OK DBD::mysql : 4.019 : OK DBD::Pg : N/A : NOT INSTALLED (required if you use PostgreSQL as your Maia Mailguard database) DBI : 1.617 : OK Digest::MD5 : 2.39 : OK Digest::SHA : 5.47 : OK Digest::SHA1 : 2.13 : OK Encode::Detect : 1.01 : OK File::Spec : 3.3101 : OK forks : 0.34 : OK HTML::Parser : 3.69 : OK HTTP::Date : 6.01 : OK IO::Stringy : 2.110 : OK IO::Socket::INET6 : 2.69 : OK IO::Zlib : 1.10 : OK IP::Country::Fast : 604.001 : OK libdb : 4.7 : OK LWP : 6.03 : OK Mail::Address : 2.08 : OK Mail::DKIM : 0.39 : OK Mail::Internet : 2.08 : OK Mail::SpamAssassin : 3.3.2 : OK Mail::SPF : 2.007 : OK MIME::Base64 : 3.08 : OK MIME::Parser : 5.502 : OK MIME::QuotedPrint : 3.08 : OK Net::CIDR::Lite : 0.21 : OK Net::Cmd : 2.29 : OK Net::DNS : 0.68 : OK Net::Server : 0.99 : OK Net::SMTP : 2.31 : OK NetAddr::IP : 4.058 : OK Pod::Usage : 1.36 : OK Razor2::Client::Agent : 2.84 : OK Template : 2.24 : OK Time::HiRes : 1.9719 : OK Unix::Syslog : 1.1 : OK URI : 1.59 : OK Text::CSV : 1.21 : OK MySQL Server : 5.1.61 : OK Database DSN test : PASSED
# su - vscan $ /var/maiad/maia/scripts/load-sa-rules.pl --debug $ exit
# pear channel-discover htmlpurifier.org Adding Channel "htmlpurifier.org" succeeded Discovery of channel "htmlpurifier.org" succeeded
# pear install hp/HTMLPurifier downloading HTMLPurifier-4.4.0.tgz ... Starting to download HTMLPurifier-4.4.0.tgz (276,637 bytes) .........................................................done: 276,637 bytes install ok: channel://htmlpurifier.org/HTMLPurifier-4.4.0
Designate the .lock file location particularly;
# vi /usr/local/etc/maiad.conf
$lock_file = "/var/maiad/maiad.lock";
amavisd.conf has been replaced by new maiad.conf. Trim the permission bits of your maiad.conf as Maia will complain about it. Add the new daemon to rc.conf, create individual “run” directory for maia and change its ownership;
# chmod 440 /usr/local/etc/maiad.conf # echo 'maiad_enable="YES"' >> /etc/rc.conf # mkdir /var/run/maia # chown -R vscan:vscan /var/run/maia
We need to replace the older amavisd directory paths with the new ones inside crontab;
# crontab -u vscan -e
#Load new rules and store into Maia database. 30 4 * * * /var/maiad/maia/scripts/load-sa-rules.pl > /dev/null #Train Spam Assassin. 0 * * * * /var/maiad/maia/scripts/process-quarantine.pl --learn --report > /dev/null #Take a snapshot of the stats at the start of every hour. 0 * * * * /var/maiad/maia/scripts/stats-snapshot.pl > /dev/null #Purge mail that has not been confirmed. 0 23 * * * /var/maiad/maia/scripts/expire-quarantine-cache.pl > /dev/null #Send quarantine reminders. 0 15 * * * /var/maiad/maia/scripts/send-quarantine-reminders.pl > /dev/null #Send quarantine digests. 0 15 * * * /var/maiad/maia/scripts/send-quarantine-digests.pl > /dev/null #Force bayesian auto-expiry during off-peak hours. 25 2 * * * /usr/local/bin/sa-learn --sync --force-expire > /dev/null
# /usr/local/etc/rc.d/maiad start
Maia should start smooth now. But if you live unlooked-for problems, I recommend you to increase the log level to 5 by editing $log_level = 0 inside maiad.conf in order to diagnose things. But don’t forget to take it back to 0 before going into production state.







RSS feed for comments on this post.




