SpamAssassin, spam_buttons, Squirrelmail, and CentOS 3

2007-05-26 One-minute read

After more than 6 years, I’m finally starting to get spam on my primary email address. It has certainly helped that the address has not been published: my fans need to use my contact page first. The QVCS Guide has clear instructions on configuring SpamAssassin to filter out spam. Once I had this configured I tracked down the spam_buttons plugin for SquirrelMail. Theoretically, spam_buttons should have been an easy way to mark email as spam or ham (non-spam) from SquirrelMail. Alas, I had to fight a little to get this working. The missing piece was sudo -H in config.php.

  1. Follow the spam_buttons INSTALL instructions.
  2. In /etc/sudoers: apache ALL=(ALL) NOPASSWD: /usr/bin/sa-learn
  3. In spam_buttons/config.php: $is_spam_shell_command = 'sudo -H -u ###USERNAME### /usr/bin/sa-learn --spam'; $is_not_spam_shell_command = 'sudo -H -u ###USERNAME### /usr/bin/sa-learn --ham';