From owner-freebsd-hackers Sat May 3 05:01:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA26269 for hackers-outgoing; Sat, 3 May 1997 05:01:47 -0700 (PDT) Received: from obiwan.psinet.net.au (obiwan.psinet.net.au [203.19.28.59]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA26263 for ; Sat, 3 May 1997 05:01:41 -0700 (PDT) Received: from localhost (adrian@localhost) by obiwan.psinet.net.au (8.8.5/8.8.5) with SMTP id TAA10034 for ; Sat, 3 May 1997 19:46:18 +0800 (WST) Date: Sat, 3 May 1997 19:46:17 +0800 (WST) From: Adrian Chadd To: freebsd-hackers@freebsd.org Subject: Antispam sendmail.cf modifications.. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk This stuff is just repeats off webpages and usenet postings, but I suppose nothing will happen unless someone does something. :) The diffs from the standard sendmail.cf file are as follows : --- /etc/sendmail.cf Sat May 3 19:19:09 1997 +++ /etc/sendmail.cf.back Sat May 3 18:55:44 1997 @@ -85,21 +85,6 @@ # ... 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. @@ -929,49 +914,3 @@ R$+ $: $>61 $1 R$+ $: $>93 $1 - - - -# blocking of spammers at MAIL From: -Scheck_mail -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" - - *** End You have 4 files in /etc/sendmail/ : localnetworks: IPs which you will relay mail from - eg the IP ranges of your dialups. can be set as XXX.XXX.XXX to allow the C-class. virtdomains: Domains which you accept mail for - including virtual ones. spamdomains: Domains you want to reject for spamming spammers: u@h 's that you want to reject for spamming. Testing show that they work, my only gripe is that (apparently) if I have cyberpromo.com in spamdomains, it will reject mail from luser@cyberpromo.com, but not luser@something.cyberpromo.com. That would be a better feature, if someone wants to modify my patch for that to work. Also, I wouldn't mind the modification that makes sendmail refuse MAIL FROM:s with invalid domain names... I'll go out and find it but if anyone else has it, feel free to email it here. Cya -- Adrian Chadd | UNIX, MS-DOS and Windows ... | (also known as the Good, the bad and the | ugly..)