• 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


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. Also setting -C to point to /etc/mail/spamassassin is a VERY bad idea, the section has been removed entirely.
  • 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
  • No labels