spam-abwehr

From: Manfred Renken (lufo.renken@t-online.de)
Date: Thu Jul 24 2003 - 11:26:31 CEST


Moin Moin Liste,

beim Kampf gegen nervende Spam bin ich auf nachfolgendes Skript
(http://www.ordb.org/faq/#usage_procmail) gestossen. Wenn ich die
Inst.-Beschreibung richtig verstehe, ist hier nur der Mailserver anzugeben.
In meinem Fall: pop\.btx\.dtag\.de
Wie starte ich das Skript? Durch einfachen Aufruf (boss:\ # ./procmailrc) ?
Immerhin handelt es sich nicht um ein Shell-Skript.
Wie starte ich das Skript dauerhaft bei jedem Systemstart ?
Und letzte Frage (ähmm.....)--- was genau führt das o.g. Skript eigentlich
aus ?? O.K. soviel ist klar, es werden IP-Nummern vom Relay-Server überprüft
wovon auszugehen ist, dass diese als Spam-mailer miss- bzw gebraucht werden.
Wer von euch Allwissenden wäre so nett mir eine detalliertere Erklärung zu
posten.

Gruß Manfred

Auf der o.g. HomePage ist eine in engl. geschriebene Anleitung zu lesen,
aber eben fast nur in Englisch ;-) !!!

Hier das Skripting:

# Sample procmail script for checking incoming mail with ORDB.
# Allan Olesen (aolesen@post3.tele.dk) December 2001

# Function:
# This script will check incoming mail and identify the ip
# of the last mailserver, a mail have passed prior to
# hitting your or your isp's mailserver. This ip will be
# checked in the ORDB database (www.ordb.org). If the ip
# is listed as an open relay, this header will be inserted
# in the mail:
# X-Spamcheck: Sender ip xxx.xxx.xxx.xxx is registered in ORDB

# System requirements:
# A Linux (or probably any other *N*X) mailserver, configured
# to pipe incoming mails through procmail.
# (Standard configuration in most Linux distributions?)

# Installation:
# Save this script with the filename .procmailrc in your home
# directory. Make sure that this file does not already exist.

# Configuration:
# Change the name mail.example.com below to the name of the first
# trusted server, an incoming mail will hit.
# . (dot) must be preceeded by a \ (backslash).
# Several servers can be separated with a | (pipe). However,
# be careful with this. If the mail passes through more than
# one of the trusted servers, the script will probably begin
# checking one of these in ORDB, instead of checking the
# last untrusted server:

MAILSRV="(mail\.example\.com)"

# The name of procmail's logfile:

LOGFILE=procmail.log

# You can set VERBOSE=on, if you like really large logfiles:

VERBOSE=off

# Path to formail and nslookup:
FORMAIL=/usr/bin/formail
NSLOOKUP=/usr/bin/nslookup

# The script. Do not touch anything, unless you know what
# you are doing:

:0 w
*$ Received: from.*\/[0-9]+.[0-9]+.[0-9]+.[0-9]+.^*.*by.*$MAILSRV
{ HEADSTR=$MATCH
:0
* HEADSTR ?? ()\/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
{ IPSTR=$MATCH
:0
* IPSTR ?? ()\/[0-9]+
{ PART1=$MATCH
:0
* IPSTR ?? [0-9]+\.\/[0-9]+
{ PART2=$MATCH
:0
* IPSTR ?? [0-9]+\.[0-9]+\.\/[0-9]+
{ PART3=$MATCH
:0
* IPSTR ?? [0-9]+\.[0-9]+\.[0-9]+\.\/[0-9]+
{ REVIPSTR="$MATCH.$PART3.$PART2.$PART1"
ORDBCHECK=`$NSLOOKUP $REVIPSTR.relays.ordb.org`
}}}}}}

# These lines can be uncommented for debugging purposes
#:0 f
#| $FORMAIL -A "X-Spamcheck: HEADSTR: $HEADSTR"

#:0 f
#| $FORMAIL -A "X-Spamcheck: IPSTR: $IPSTR"

#:0 f
#| $FORMAIL -A "X-Spamcheck: REVIPSTR: $REVIPSTR"

:0 f
* ORDBCHECK ?? 127\.0\.0\.[1-9]
| $FORMAIL -A "X-Spamcheck: Sender ip $IPSTR is registered in ORDB"

# END OF PROCMAIL SCRIPT



This archive was generated by hypermail 2.1.7 : Thu Jul 24 2003 - 17:05:26 CEST