razor and dcc for zimbra on ubuntu

There are a couple of howtos around for getting Zimbra's antivirus tuned up a bit, but here is an Ubuntu-specific one!

Install razor

sudo apt-get install razor
sudo mkdir /opt/zimbra/amavisd/.razor; sudo chown -Rf zimbra:zimbra /opt/zimbra/amavisd/.razor
su - zimbra
razor-admin -home=/opt/zimbra/amavisd/.razor -create
razor-admin -home=/opt/zimbra/amavisd/.razor -discover

This last one may need to be run twice, as you may get a  "Error 202 while performing register, aborting." Just run it again and you should get something like "Register successful.  Identity stored in /opt/zimbra/amavisd/.razor/identity-rulOoIerFR"

razor-admin -home=/opt/zimbra/amavisd/.razor -register

Now just make sure that the razor line in  /opt/zimbra/conf/spamassassin/v310.pre is not commented (in Zimbra 5.0.1 its not)

Install DCC

apt-get install dcc-client

Now just uncomment the line for DCC in  /opt/zimbra/conf/spamassassin/v310.pre

Restart amavis

As the zimbra user:

zmamavisdctl stop
zmamavisdctl start

You should see something in your syslog (or elsewhere if you changed amavis' log location) along the lines of  "Module Razor2::Client::Version 2.72" and "dccifd[8811]: 1.2.74 listening to /var/lib/dcc/dccifd"