Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 1997 20:09:52 -0800 (PST)
From:      "Jonathan M. Bresler" <jmb>
To:        brian@awfulhak.org (Brian Somers)
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: /etc/mail filters in 2.2.5
Message-ID:  <199711160409.UAA15831@hub.freebsd.org>
In-Reply-To: <199711160010.AAA22259@awfulhak.demon.co.uk> from "Brian Somers" at Nov 16, 97 00:10:14 am

next in thread | previous in thread | raw e-mail | index | archive | help
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
> 
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711160409.UAA15831>