Date: Mon, 04 May 1998 17:53:41 +0100 From: Brian Somers <brian@Awfulhak.org> To: tarkhil@asteroid.svib.ru Cc: Doug White <dwhite@resnet.uoregon.edu>, Sebastian Romo <sromo@cabonet.net.mx>, freebsd-questions@FreeBSD.ORG Subject: Re: Spamming Problem Message-ID: <199805041653.RAA21014@awfulhak.org> In-Reply-To: Your message of "Mon, 04 May 1998 09:48:18 %2B0400." <199805040548.JAA23010@minas-tirith.pol.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
> <Pine.BSF.3.96.980502182357.21194I-100000@gdi.uoregon.edu>Doug White writes:
>
> >Check out the modifications in /etc/mail.
>
> Hmm... First, the following lines
[.....]
> seems to stip domain to last two levels, which is not enough (I've got some
> spam from <something>.chel.su, and didn't want to block the entire chel.su;
Try this:
# `database declarations'
Kdenyip hash -a.REJECT /etc/mail/db/denyip.db
Kspamsites hash -a.REJECT /etc/mail/db/spamsites.db
Kspamnames hash -a.REJECT /etc/mail/db/spamnames.db
# `called with host.tld and IP address of connecting host.'
# `ip address must NOT be in the "denyip" database'
Scheck_relay
R$* $| $* $: $1 $| <$2> $(denyip $2 $)
R$* $| < $* > $*.REJECT $#error $@ 5.1.8 $: $3
R$* $| < $* > $* $1 $| $2
# `host must *not* be in the "spamsites" database'
R$* $| $* $: <$1> <$1 $| $2>
R<$+.$+> $* <$+> <$2> $| $(spamsites $1 $2 $) $3 <$4>
R<$*> $* $| $*.REJECT $* <$1> $3.REJECT $4
R<$*> $*.REJECT $* $#error $@ 5.1.8 $: $2
R<$*> $* <$+> $3
# `called with envelope sender, "Mail From: xxx", of SMTP conversation'
Scheck_mail
R$* $: $>3 $1
# `Make sure it resolves'
R$* < @ $+ . > $1 @ $2
R$* < @ $+ > $#error $@ 4.1.8 $: "451 Domain doesn't resolve"
# `Must not be in "spamnames" database'
R$* @ $+ $: < $1 @ $2 > $(spamnames $1@$2 $)
R< $* > $*.REJECT $#error $@ 5.1.8 $: $2 - Contact postmaster@$m
R< $* > $* $1
# `host must *not* be in the "spamsites" database'
R$* @ $* $: <$2> <$1 @ $2>
R<$+.$+> $* <$+> <$2> $| $(spamsites $1 $2 $) $3 <$4>
R<$*> $* $| $*.REJECT $* <$1> $3.REJECT $4
R<$*> $*.REJECT $* $#error $@ 5.1.8 $: $2 - Contact postmaster@$m
R<$*> $* <$+> $3
# `test check_relay (required by -bt to get the $| in)'
Sxlat
R$* $$| $* $: $1 $| $2
R$* $| $* $@ $>check_relay $1 $| $2
I don't protect against relaying though...
> Alex.
--
Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
<http://www.Awfulhak.org>
Don't _EVER_ lose your sense of humour....
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805041653.RAA21014>
