Procmail Rules - please help

Peter Rosa prosa at pro.sk
Wed Oct 22 08:05:16 PDT 2003


Hello list's friends.

I have FreeBSD box with sendmail+spamassassin+procmail. As it comes more and
more spam messages I realize to prepare rules for spam deletion. I have done
3 months work on spam mesgs+senders+scores analysis. Now I'm ready to do it,
but I'm not very familiar with procmail. I prepared the following list

I want to write rules, which will do following:
1. check if the X-Spam-Level is more than 15
2. retrieve the sender domain from Form: header
3. compare sender domain against my own list (freemails.txt),
     where are all big freemail sites listed.
4. if sender is not there, add sender domain to the ACCESS
   database with REJECT 550 Stop Spamming
5. delete the spam message
6. spams marked with score 10 should go to quarantene.



Please help me with second rule, as it can not work - it's only an idea:

FREEMAILS=`cat /etc/mail/freemails.txt`
SENDERDOMAIN=`egrep From: - | awk -F@ '{ print $2 }'`

:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
* ${SENDERDOMAIN}<>${FREEMAILS}
| echo '${SENDERDOMAIN}\t\t550 Stop Spamming' >> /etc/mail/access

:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
/dev/null

:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
! spam-lover at my_domain.com



Any solution is very welcome :-)

Peter Rosa



More information about the freebsd-questions mailing list