Article ID: 597, created on Oct 6, 2008, last review on May 7, 2014

Resolution

This problem usually occurs because your procmail is either configured incorrectly or not configured at all.

You should do the following to make Spamassassin work properly:

  1. The “spamd” should start with “-d -x -q -L” options. You can specify these options in the /etc/sysconfig/spamd or /etc/default/spamassassin files depending on your OS.

Example:

# vi /etc/sysconfig/spamd

SPAMD_ARGS = "-d -x -q -L"

 

Here is the explanation of these flags: 

 -d -- Run daemonized

 -L -- Use local tests only (no DNS)

 -x -- Do not use user preferences files (typical mail users in Confixx do not have home directories, so they can not have preferences files).

 -q -- Use sql database to keep user preferences.

 

  1. Create or change /etc/procmailrc. The /etc/procmailrc should look as follows:

DROPPRIVS=YES

LOGFILE=/var/log/procmail

SHELL=/bin/sh

 

:0 fw

* < 256000

| /usr/bin/spamc -f

 

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%

# false positives according to rules/STATISTICS.txt). Let's put them in a

# different mbox. (This one is optional.)

#:0:

#* ^X-Spam-Level: ***************

#/var/spool/mail/almost-certainly-spam

 

# All mail tagged as spam (eg. with a score higher than the set threshold)

# is moved to "probably-spam".

#:0:

#* ^X-Spam-Status: Yes

#/var/spool/mail/probably-spam

 

# Work around procmail bug: any output on stderr will cause the "F" in "From"

# to be dropped. This will re-add it.

:0 H

* ! ^From[ ]

* ^rom[ ]

{

 LOG="*** Dropped F off From_ header! Fixing up. "

 

 :0 fhw

 | sed -e 's/^rom /From /'

}

 


  1. # chmod 666 /var/log/procmail
  2. Your Mail Transfer Agent should be configured with procmail.

Example:

If you have postfix, then the main.cf has to have the entry:

 mailbox_command = /usr/bin/procmail -a "$EXTENSION"


If you have sendmail, then the sendmail.mc has to have the entry:


define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')

 FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')

MAILER(procmail)

Email subscription for changes to this article
Save as PDF