# Procmail to sideline spam found in different mail folders

## aZZe

Hi everyone!

I set up another Postfix/Dovecot Gentoo server. I use procmail to sideline spam which is stored in different mail folders. The strange thing is I don't know why it works on Server1 but not on Server2 which is set up in the same way. I used the HowTo from the Gentoo Wiki:

https://wiki.gentoo.org/wiki/Mailfiltering_Gateway#Autolearning_and_sidelining_emails

Here is my .procmailrc:

```

#Set some default variables

MAILDIR=$HOME/Maildir

SPAM_FOLDER=$MAILDIR/.spam-found/

LIKELY_SPAM_FOLDER=$MAILDIR/.likely-spam-found/

#Sort mails with a spamscore of 7+ to the spamfolder

:0:

* ^X-Spam-Status: Yes

* ^X-Spam-Level: \*\*\*\*\*\*\*

$SPAM_FOLDER

   

#Sort mail with a spamscore between 5-7 to the likely spam folder

:0:

* ^X-Spam-Status: Yes

$LIKELY_SPAM_FOLDER

    

#Sort all other mails to the inbox

:0

*

./

```

This is the output in /var/log/mail.log:

```

dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail -a "DOMAIN")

```

But I don't see the email in my inbox. If I turn off using procmail in main.cf (mailbox_command = /usr/bin/procmail -a "DOMAIN") I get the email. If I turn it back on I don't receive anything.

Does any have an idea?

----------

## Princess Nell

You can set LOGFILE and VERBOSE in procmailrc to get extended diagnostics. See procmailrc(5).

----------

