procmail virus and spam users
i made a /etc/procmailrc script for filtering spam with spamassassin
and virus with clamfilter.pl.
it's working nicely, but now i want to resend all the spam to a
masterspam user and all the viruses to mastervirus user that are on the
same server that is filtered by the script.
this is my /etc/procmailrc:
PATH=/bin:/usr/bin
MAILDIR=$HOME/Maildir
DEFAULT=$HOME/Maildir
LOGFILE=$HOME/procmail.log
VERBOSE=yes
:0fw: spamassassin.lock
* < 256000
| spamassassin
:0
* ^X-Spam-Status: Yes
! masterspam [at] theonfoundry.eu
:0fw
| /usr/local/bin/clamfilter.pl
:0
* ^X-Virus-Found: yes
! mastervirus [at] theonfoundry.eu
:0
* .*
../
the problem is that once a mail is recognized as spam the system sends
it to masterspam and then the mail loops for some time beetween
masterspam and masterspam... :)
how can i avoid that the mail resended to masterspam and mastervirus
are processed and resended to themselves in a loop?
thanks,
ale.
Re: procmail virus and spam users
mmm maybe i have found a solution?
PATH=/bin:/usr/bin
MAILDIR=$HOME/Maildir
DEFAULT=$HOME/Maildir
LOGFILE=$HOME/procmail.log
VERBOSE=yes
:0fw: spamassassin.lock
*!^X-Original-To: masterspam [at] theonfoundry.eu
*!^X-Original-To: mastervirus [at] theonfoundry.eu
* < 256000
| spamassassin
:0
* ^X-Spam-Status: Yes
*!^X-Original-To: masterspam [at] theonfoundry.eu
*!^X-Original-To: mastervirus [at] theonfoundry.eu
! masterspam [at] theonfoundry.eu
:0fw
*!^X-Original-To: mastervirus [at] theonfoundry.eu
*!^X-Original-To: masterspam [at] theonfoundry.eu
| /usr/local/bin/clamfilter.pl
:0
* ^X-Virus-Found: yes
*!^X-Original-To: mastervirus [at] theonfoundry.eu
*!^X-Original-To: masterspam [at] theonfoundry.eu
! mastervirus [at] theonfoundry.eu
:0
* .*
../
Re: procmail virus and spam users
mcstanga wrote:
> mmm maybe i have found a solution?
>
>
> PATH=/bin:/usr/bin
> MAILDIR=$HOME/Maildir
> DEFAULT=$HOME/Maildir
> LOGFILE=$HOME/procmail.log
> VERBOSE=yes
>
> :0fw: spamassassin.lock
> *!^X-Original-To: masterspam [at] theonfoundry.eu
> *!^X-Original-To: mastervirus [at] theonfoundry.eu
> * < 256000
> | spamassassin
>
> :0
> * ^X-Spam-Status: Yes
> *!^X-Original-To: masterspam [at] theonfoundry.eu
> *!^X-Original-To: mastervirus [at] theonfoundry.eu
> ! masterspam [at] theonfoundry.eu
>
> :0fw
> *!^X-Original-To: mastervirus [at] theonfoundry.eu
> *!^X-Original-To: masterspam [at] theonfoundry.eu
> | /usr/local/bin/clamfilter.pl
>
> :0
> * ^X-Virus-Found: yes
> *!^X-Original-To: mastervirus [at] theonfoundry.eu
> *!^X-Original-To: masterspam [at] theonfoundry.eu
> ! mastervirus [at] theonfoundry.eu
>
> :0
> * .*
> ./
I would think it would be better to check for viruses prior to checking
for spam.
PATH=/bin:/usr/bin
MAILDIR=$HOME/Maildir
DEFAULT=$HOME/Maildir
LOGFILE=$HOME/procmail.log
VERBOSE=yes
:0
*!^X-myloop_check: master(spam|virus) [at] theonfoundry.eu
{
:0fw
| /usr/local/bin/clamfilter.pl
:0
* ^X-Virus-Found: yes
{
:0fw
|formail -A "X-myloop_check: mastervirus [at] theonfoundry.eu"
:0
! mastervirus [at] theonfoundry.eu
}
:0fw: spamassassin.lock
* < 256000
| spamassassin
:0
* ^X-Spam-Status: Yes
{
:0fw
|formail -A "X-myloop_check: masterspam [at] theonfoundry.eu"
:0
! masterspam [at] theonfoundry.eu
}
}
:0
* .*
../
---
Depending on your mail server, you might be better off checking for
virus during the SMTP transaction versus when the final delivery is
attempted. You might wish to introduce a check that can not be included
in the message such that you anti-virus/anti-spam mechanisms can be
bpassed by inclusion of the headers.
AK