* Install Razor (this varies from system to system, see SingleUserUnixInstall for one option) * Setup razor's config in a central location such as /etc/mail/spamassassin/.razor with these commands: * Make sure you register first {{{razor-client}}} (depreciated) {{{razor-admin -home=/etc/mail/spamassassin/.razor -register}}} {{{razor-admin -home=/etc/mail/spamassassin/.razor -create}}} {{{razor-admin -home=/etc/mail/spamassassin/.razor -discover}}} * Make sure permissions are configured correctly * This part can get tricky since multiple daemons running under several usernames may be trying to run spamassassin -r, for example (Apache and qmail are two examples from my configuration) * One solution is to create a spam group and add all the usernames that need to report spam to that group, then enable that group to use this razor config {{{add to /etc/group: spam:812:x:apache,qmailq}}} (Make sure the group id, 812 in this case, is unique. And change the username list to something appropriate for your site.) {{{cd /etc/mail/}}} {{{chgrp -R spam spamassassin/}}} {{{chmod g+ws spamassassin/}}} {{{chmod g+ws spamassassin/.razor/}}} {{{cd spamassassin/}}} {{{chmod g+w *}}} {{{cd .razor/}}} {{{chmod g+w *}}} * Tell spamd where to find Razor's new config file {{{add to /etc/mail/spamassassin/local.cf: razor_config /etc/mail/spamassassin/.razor/razor-agent.conf}}} * Tell razor where it lives {{{add to /etc/mail/spamassassin/.razor/razor-agent.conf: razorhome = /etc/mail/spamassassin/.razor/}}} * Another handy option to take care of this is to pass spamd the -H option with /etc/mail/spamassassin as the argument. This sets all helper apps' (dccproc/pyzor/razor) homedirs to /etc/mail/spamassassin. * Restart spamd {{{/etc/init.d/spamd restart}}} * Make sure anywhere you're calling spamassassin in a script/procmail recipe/.qmail file to always use the -C /etc/mail/spamassassin configuration option so it will pick up the razor_config option, and in turn the razorhome setting in razor-agent.conf * This configuration allows me to have a "Report as spam" link in IMP (web-based mail client) that calls 'spamassassin -x -C /etc/mail/spamassassin -r' and pipes the message to it while also allowing a .qmail-fake file that pipes the message to the same command (so I can bounce -- '''not''' forward -- spams to fake@mydomain.com to have them reported to razor ---- Comment / additional hints: * In my case (Plesk 8.2.1 on SuSE 9.3) it was not necessary to configure the permissions as described above. Simply make the logfile /etc/mail/spamassassin/.razor/razor-agent.log writable for all users, then you will see if it works... * Also the last part about starting spamassassin with the option -C was not necessary. * Maybe in some cases where razor does not work the outgoing port is closed or spamassassin is running in local mode (option -L) where no network tests are performed. E.g. this could be defined in /etc/sysconfig/spamd