From owner-freebsd-questions@FreeBSD.ORG Wed Oct 22 08:05:16 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD18416A4B3 for ; Wed, 22 Oct 2003 08:05:16 -0700 (PDT) Received: from ns.pro.sk (proxy.pro.sk [212.55.244.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id E824843FCB for ; Wed, 22 Oct 2003 08:05:14 -0700 (PDT) (envelope-from prosa@pro.sk) Received: from peter (Peter [192.168.1.53]) by ns.pro.sk (8.12.9/8.12.9) with SMTP id h9MF59G7060380 for ; Wed, 22 Oct 2003 17:05:09 +0200 (CEST) (envelope-from prosa@pro.sk) Message-ID: <00a501c398ad$74d6bc60$3501a8c0@pro.sk> From: "Peter Rosa" To: "FreeBSD Questions" Date: Wed, 22 Oct 2003 17:02:05 +0200 Organization: PRO, s.r.o. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-RAVMilter-Version: 8.4.3(snapshot 20030217) (ns.pro.sk) X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) Subject: Procmail Rules - please help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2003 15:05:16 -0000 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@my_domain.com Any solution is very welcome :-) Peter Rosa