Maia-Mailguard is by far the best open source spam/virus configuration utility I have ever used. It allows users to adjust their own settings for spam and viruses leaving the Mail Admin a little breathing room which makes it a great piece of software. You can read more about it at http://www.maiamailguard.com/ or, possibly more importantly, the fork we’ll be using at https://github.com/technion/maia_mailguard.
First, let’s make sure the ports tree is up-to-date and install ports-mgmt/portmaster (if you don’t want to use portmaster, that’s fine. I’m just using it to save time and make things easy. Plus, it’s a great tool with a small footprint!):
If this is a fresh install or you don't have a ports tree, use: # portsnap fetch extract Otherwise, let's just update the ports tree: # portsnap fetch update Now, install portmaster: # make all install clean -C /usr/ports/ports-mgmt/portmaster
Add some important build options to /etc/make.conf file:
# cat << EOF >> /etc/make.conf CLAMAVUSER=vscan CLAMAVGROUP=vscan OPTIONS_UNSET= X11 GUI CUPS NLS HAL GSSAPI_BASE KRB_BASE KERBEROS OPTIONS_SET=GSSAPI_NONE KRB_NONE WITHOUT_X=YES WITH_X=NO ENABLE_GUI=NO EOF
Edit pear-Net_SMTP installation menu:
# make config -C /usr/ports/net/pear-Net_SMTP Aside from defaults, be sure "PEAR_AUTH_SASL" is selected.
Edit pear-Auth Options installation menu:
# make config -C /usr/ports/security/pear-Auth Aside from defaults, be sure "PEAR_DB" and "PEAR_LOG" are selected.
Edit pear-Log installation menu:
# make config -C /usr/ports/sysutils/pear-Log Aside from defaults, be sure "PEAR_DB" is selected.
Edit Dovecot installation menu:
# make config -C /usr/ports/mail/dovecot Aside from defaults, be sure "MYSQL" is selected.
Edit Postfix installation menu:
# make config -C /usr/ports/mail/postfix Aside from defaults, be sure "BDB", "MYSQL" and "TLS" are selected.
Edit Postfixadmin installation menu:
# make config -C /usr/ports/mail/postfixadmin Aside from defaults, be sure "MYSQL" is selected and "PGSQL" is NOT selected.
Edit SpamAssassin installation menu:
# make config -C /usr/ports/mail/spamassassin Aside from defaults, be sure "MYSQL", "DKIM", "RAZOR", "RELAY_COUNTRY" and "SPF_QUERY" are selected.
Edit Maia-Mailguard installation menu:
# make config -C /usr/ports/security/maia Aside from defaults, be sure the "APACHE", "DOVECOT2", "MYSQLSERVER", "PFA", "POSTFIX" and "WEBHOST" options are selected. Feel free to select any additional options you may want.
Install Maia-Mailguard (along with everything it needs) via portmaster:
# portmaster -dG --no-confirm security/maia
This build will take a while. Feel free to walk away and grab some lunch or something. HOWEVER, some port installations (Such as Postfix) request information regarding certain things during install. Be sure to check on the build periodically to
see if any user input is required…
Set password for “vscan” user:
# passwd vscan (enter password) (enter password again)