# qmail + spamassassin + maildrop...

## Kulfaangaren!

...does anyone have it working ?

I changed my $HOME/.qmail and wrote a $HOME/.mailfilter and it works.....if the only thing I have in it is 'to $DEFAULT', as soon as I use anything else for example 'logfile $HOME/maildrop.log' everything stops working and the mails remains in the qmail in-queue.

It is the same when I try to use the xfilter cmd to filter the mail through spamc...everything grinds to a halt.

I would very much appreciate if someone could point me in the right direction or even solve the mystery for me  :Smile:  SInce I can't even add the logfile cmd I can't see what happens that way either  :Sad: 

.qmail file:

```
| /usr/bin/maildrop -d user1 /home/user1/.mailfilter
```

.mailfilter file:

```
##############################

# Variable definitions.

#

DEFAULT="${HOME}/.maildir/"

MAILDIR="${DEFAULT}"

JUNKMAIL="${DEFAULT}.Spam/"

#logfile /home/user1/maildrop.log

#

##############################

# Spam filter.

#

#exception {

#       xfilter "/usr/bin/spamc -f"

#}

#if ( /^X-Spam-Status: *Yes/ ) {

#       to $JUNKMAIL

#}

#if ( /^X-Spam-Flag: *Yes/ ) {

#        to $JUNKMAIL

#}

#

##############################

to $DEFAULT
```

// Fredrik

----------

## indros

Have you ever solved this issue? I am having the same issue, and am pulling my hair out.

----------

## Kulfaangaren!

 *indros wrote:*   

> Have you ever solved this issue? I am having the same issue, and am pulling my hair out.

 

Sorry no...noone seemed to be able to help.

I'm contemplating writing my own filtering sotware   :Crying or Very sad: 

procmail is a bitch and I can't get it to work and maildrop doesn't work at all!

----------

## Praxxus

Well, I'm not using maildirs, but here's a snippet of my .mailfilter file.  Note that maildrop is really bitchy about spaces & blank lines:

```
[ed@mail ~]$ cat .mailfilter

if (/^X-Spam-Status:.Yes,*/)

    to mail/SPAM

if (/^Subject:.*failure.notice.*/)

    to "mail/Failure Notices"

if (/^From:.*System.Anti-Virus.Administrator.*/)

    to "mail/Virus Warnings"

if (/^Subject:.*\[(u|U)sers\].*/)

    to "mail/FreeSWAN Users"

else

    to .mbox
```

You can run maildrop manually, in verbose mode, to debug it:

1)  create a bogus e-mail message in a file (named foo in this example):

```

From:  luser@luserland.com

To:  you@your.maildrophost.com

Subject:  Fooooooooo!

Date: Thu, 08 May 2003 11:08:21 -0800

This is stupid.

```

2)  send it through maildrop (assuming you have a .mailfilter file)

```

cat foo | maildrop -V 3
```

"-V 3" is the 'verbose level.'  3 looks pretty good, but I know it goes at least as high as 9.

----------

## Kulfaangaren!

Thanks...i'll try it tonight, right now I need to get some sleep before I have to go to work at 7 (it's 3:30am now  :Smile: 

----------

## indros

Thanks for the tip. It now seems to be working.

As for my .qmail file, it simply contains:

```
| maildrop
```

----------

## Kulfaangaren!

Soo...there...now I have tried it and been very conservative with spaces and **** it ! It WORKS !  :Smile: 

Seems the problem with my .mailfilter was the use of  {'s on the same line as the if's, for example:

```
if (/^X-Spam-Status:.*Yes/) {
```

...when it should have been:

```
if (/^X-Spam-Status:.*Yes/)

{

   to $DEFAULT

}
```

Thanks for the help.

----------

