From owner-freebsd-hackers Sat Nov 15 20:09:56 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA15839 for hackers-outgoing; Sat, 15 Nov 1997 20:09:56 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: (from jmb@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA15831; Sat, 15 Nov 1997 20:09:52 -0800 (PST) (envelope-from jmb) From: "Jonathan M. Bresler" Message-Id: <199711160409.UAA15831@hub.freebsd.org> Subject: Re: /etc/mail filters in 2.2.5 To: brian@awfulhak.org (Brian Somers) Date: Sat, 15 Nov 1997 20:09:52 -0800 (PST) Cc: freebsd-hackers@FreeBSD.org In-Reply-To: <199711160010.AAA22259@awfulhak.demon.co.uk> from "Brian Somers" at Nov 16, 97 00:10:14 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Brian, there are a couple issues here: Brian Somers wrote: > I installed the /etc/mail stuff a few days ago, and added a few sites > to domains.txt, specifically: > > BIGFOOT.DALTEK.NET^M #blocked. contact postmaster first, that "^M" is it in the file? is so please delete it. after deleting the "^M" cd /etc/mail; make install second, the way i wrote the rules, they block mail from a domain, hence the file is called domains.txt ;) bigfoot.daltek.net is a host, rather than a domain. you can change the entry domains.txt to "daltek.net". that will block mail from all of daltek.net. or you can use the amended rules below to block mail from both hosts and domains. then you can use entries like "bigfoot.daltek.net" in domains.txt. add the rules below that are *not* preceded by a ">" at the start of the line ;) jmb > # called with host.tld and IP address of connecting host. > # ip address must NOT be in the "denyip" database > Scheck_relay > R$* $| [$+ $1 $| $2 should not be needed > R$* $| $+] $1 $| $2 same (bat 2nd ed p510) > R$* $| $* $: $1 $| $(denyip $2 $) > R$* $| $*.REJECT $#error $: 521 blocked. contact postmaster@FreeBSD.ORG ($2) > # host must *not* be in the "spamsites" database R$+.$+.$+ $| $* $: $(spamsites $1.$2.$3 $) $1.$2.$3 $| $4 R$*.REJECT $* $| $* $#error $: 521 blocked. > R$+.$+.$+ $| $* $2.$3 $| $4 > R$+.$+ $| $* $: $(spamsites $1.$2 $) $| $3 > R$*.REJECT $| $* $#error $: 521 blocked. contact postmaster@FreeBSD.ORG ($1) > # Host must be resolvable, currently not used at hub.freebsd.org > #R$* $| $* $: <$1 $| $2> $>3 foo@$1 > #R <$*> $*<@$*.> $: $1 > #R <$*> $*<@$*> $#error $: 451 Domain does not resolve ($1) > > # called with envelope sender, "Mail From: xxx", of SMTP conversation > # > Scheck_mail > R$* $: $>3 $1 > R $* < @ $+ . > $: $2 > # R $* < @ $+ > $#error $: "451 Domain does not resolve" > R $* < @ $+ > $: $2 R$+.$+.$+ $: $(spamsites $1.$2.$3 $) $1.$2.$3 R$*.REJECT $* $#error $: 521 blocked. > R$+.$+.$+ $2.$3 > R$* $: $(spamsites $1 $: OK $) > ROK $@ OK > R$+.REJECT $#error $: 521 $1 > > # for testing check_relay and check_mail > # if we type "$|", sendmail will split this into two tokens "$" and "|" > # this rule glues prevent sendmail from splitting "$|" > # to use: /usr/sbin/sendmail -bt > # host.domain.tld $| 111.222.333.444 > Sxlat > R$* $$| $* $: $1 $| $2 > R$* $| $* $@ $>check_relay $1 $| $2 > > >