I was poking around on the Zimbra forums today during some downtime and I ran across a little gem regarding configuration around a few options regarding spam delivery to users. The question was about disabling of spam filtering on a per-user basis (Yes, not really ideal, but sometimes you have to give users something I like to call 'exactly what they asked for'), but I found even more than I expected.
Anyway, I thought I would highlight a few of the gems that I discovered.
Disabling mail to the Junk folder
This was actually the original question that I was trying to answer. Most Zimbra admins know how to whitelist/blacklist senders and other various tweaks in the Zimbra wiki, but I didn't realize until today that we can actually configure Zimbra to not send mail filtered as junk to the Junk folder. This can be done per user, per domain, or per class of service (COS).
zmprov ma email@example.com +amavisSpamLover TRUE +amavisBypassSpamChecks TRUE
To disable, just make the + a -:
zmprov ma firstname.lastname@example.org -amavisSpamLover TRUE -amavisBypassSpamChecks TRUE
(or you can just set to false, but the default is false - I do like me some clean configs!)
And of course, change the command ma (modifyAccount) to match whatever type of object you want if you're not modifying a user.
Letting banned files through to users
Every once in a while, I've struggled with users needing to get things like encrypted zip files or other suspicious-looking files. Not wanting to let all kinds of viruses though by disabling virus scanning and file extension blocks, it always ends up in a battle. Perhaps I'm the last to learn this one, but it's actually easily bypassed on a per-user, per-domain, or per-COS basis.
zmprov ma email@example.com +amavisBannedFilesLover TRUE
You can also disable virus scanning for those various levels as well:
zmprov ma firstname.lastname@example.org +amavisBypassVirusChecks TRUE
Whitelisting and Blacklisting via zmprov (upgrade-safe!)
One of the new, well-known, features of Zimbra 6 is that you can now allow users to have their own white and blacklists, controllable within the user interface. Whitelisting and blacklisting has, of course, always been supported, but it's been a pain as long as I've been managing Zimbra servers. If you're one that already knew which wiki article I was referring to above, you know what I mean! To make matters worse, those settings have to be re-applied after upgrades.
While adding blacklist and whitelist senders to a user's list via zmprov is expected (after all, you can configure it in the web client), what hasn't really been touted - as far as I've read - is that those filters can easily be applied per domain as well. While that's not really a new feature by any means, it does mean that those whitelist and blacklist lists are in Zimbra's LDAP - where they should've been all along. That, and LDAP doesn't get wiped during upgrades / service restarts like some config files do.
zmprov md whatan00b.com +amavisBlacklistSender @exchange.microsoft.com
Loosening up spam tag levels
You can also adjust the spam scoring levels to mark messages as junk/not junk on the various levels as well. The properties to adjust are: amavisSpamTagLevel, amavisSpamTag2Level, and amavisSpamKillLevel.
Warning: with these settings, be sure that you know exactly what each of these mean. That rule always applies, of course, but getting those settings wrong could cause your mail server to drop messages without bouncing them, thus neither sender nor receiver knows!
So many more!
This turned into a much longer post than I expected, but there are so many more options available! Check out /opt/zimbra/conf/attrs/amavisd-new-attrs.xml on your Zimbra server for even more config options.
Also, check out /opt/zimbra/conf/attrs/zimbra-attrs.xml for even more goodness (unrelated to junk mail).