Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 1997 00:17:06 +0800 (WST)
From:      Adrian Chadd <adrian@obiwan.psinet.net.au>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Sendmail.cf patch #2..
Message-ID:  <Pine.BSF.3.95q.970505001353.1937A-100000@obiwan.psinet.net.au>
In-Reply-To: <Pine.BSF.3.95q.970504231019.819A-100000@obiwan.psinet.net.au>

index | next in thread | previous in thread | raw e-mail


On Sun, 4 May 1997, Adrian Chadd wrote:

> Heres the updated patch of mine that does exactly what the first one did,
> but this one rejects mail if the MAIL FROM: doesn't resolve.
> (Read the patch for more details)

Me and diff don't mix.. esp at this time of night (twice in a row.. :)

Try this one:


--- /etc/sendmail.cf	Sun May  4 13:25:35 1997
+++ sendmail.cf	Sun May  4 11:03:06 1997
@@ -85,6 +85,21 @@
 # ... define this only if sendmail cannot automatically determine your domain
 #Dj$w.Foo.COM
 
+# Both these files are basic text files, one host or user@host per line
+# a list of known spammers, user@host form one per line
+F{Spammer}/etc/sendmail/spammers
+
+# A list of domains to completely block, one per line
+F{SpamDomains}/etc/sendmail/spamdomains
+
+Kdequote dequote
+# Localdomains is a plaintext list of domains we accept mail for, including
+# virtual domains
+F{LocalDomains}/etc/sendmail/virtdomains
+# Contains a plaintext list of IPs we will relay mail for, can be X.Y.Z to
+# cover a whole class C..
+F{LocalNetworks}/etc/sendmail/localnetworks
+
 
 CP.
 
@@ -914,3 +929,59 @@
 
 R$+			$: $>61 $1
 R$+			$: $>93 $1
+
+
+
+# blocking of spammers at MAIL From: and forcing DNS resolve
+# (note - this is incompatible with the DeliveryMode=defer option, since
+# it requires that a DNS lookup be done immediately upon mail receipt.
+
+Scheck_mail
+# Check for valid domain name
+R$*				$: <?> $>3 $1
+R<?> $* < @ $+ . >		$: <OK>
+R<?> $* < @ $+ >		$#error $: 451 Domain must resolve
+
+
+# Check against spammer list
+R<$={Spammer}>		$#error $@ 5.7.1 $: "571 We don't accept junk mail"
+R$*			$: $>3 $1
+R$*<@$={SpamDomains}.>$*	$#error $@ 5.7.1 $: "571 We don't accept junk mail from your domain"
+R$*<@*$={SpamDomains}>$*		$#error $@ 5.7.1 $: "571 We don't accept junk mail from your domain"
+R$={Spammer}			$#error $@ 5.7.1 $: "571 We don't accept junk mail from your domain"
+
+
+
+#
+# check_rcpt
+#
+Scheck_rcpt
+
+# mail terminating locally is ok
+R$*$={LocalDomains}$*		$@ OK
+
+# adding the client's domain name...
+R$*				$: $(dequote "" $&{client_name} $) $| $1
+
+# directly invoked (no client name) is ok
+R $| $*				$@ OK
+
+# we will relay mail from clients in our own domain
+R$*$={LocalDomains}$* $| $*	$@ OK
+
+# adding the client's ip number...
+R$*				$: $(dequote "" $&{client_addr} $) $| $1
+
+# directly invoked (no ip address) is ok
+R0 $| $* $| $*			$@ OK
+
+# we will relay all mail from clients on our own networks
+R$*$={LocalNetworks}$* $| $* $| $*	$@ OK
+
+# or from localhost
+R$*127.0.0.1$* $| $* $| $*	$@
+
+# anything else is bogus
+R$*				$#error $: "550 Relay Denied"
+
+




help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970505001353.1937A-100000>