Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Apr 1997 14:59:29 -0700 (PDT)
From:      Dan Busarow <dan@dpcsys.com>
To:        Charles Henrich <henrich@crh.cl.msu.edu>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: sendmail tricks anyone?
Message-ID:  <Pine.UW2.3.95.970421144404.7039K-100000@cedb>
In-Reply-To: <19970421163326.59258@crh.cl.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 21 Apr 1997, Charles Henrich wrote:
> Im trying to find out if I can make sendmail obey a set of rules like the
> following:
> 
> If an email comes from a domain that sendmail understands as local
> (/etc/sendmail.cw or what have you) to allow remailing of the mssage.
> 
> if an email comres from a domain that isnt local, only allow local delivery of
> that message, else eat it..

That's one of the uses for the new check_* rule sets.

See 

	http://www.informatik.uni-kiel.de/%7Eca/email/check.html

for a nice explanation of these rules.

Your case is covered by:

F{MxHosts} /etc/sendmail.mxhosts		# like sendmail.cw
F{LocalIP} /etc/sendmail.localip		# IP prefixes you consider local
F{SpamIP} /etc/sendmail.spamip			# IP addresses/prefixes of spammers

Scheck_rcpt
R$+                           $: $(dequote "" $&{client_addr} $) $| $1
R0 $| $*                      $@ ok           no client addr: directly invoked
R$={LocalIP}$* $| $*          $@ ok           from here
R$={SpamIP}$* $| $*           $#error $@ 5.7.1 $: "571 Access denied"
# not local, check rcpt.  The following replaces current workspace w/ recipient
R$* $| $*                     $: $>3 $2
# remove local part, maybe repeatedly
R$*<@$=w.>$*                  $>3 $1 $3
R$*<@$*$={MxHosts}.>$*        $>3 $1 $4
# still something left?
R$*<@$+>$*                    $#error $@ 5.7.1 $: "571 no relay"

Let me know if you have questions on how this works.

Dan
-- 
 Dan Busarow                                                  714 443 4172
 DPC Systems / Beach.Net                                    dan@dpcsys.com
 Dana Point, California  83 09 EF 59 E0 11 89 B4   8D 09 DB FD E1 DD 0C 82




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.UW2.3.95.970421144404.7039K-100000>