added two new files: allowed_domains.txt and allowed_ips.txt.

domains/ips listed in these files are *NOT* filtered,
	even if listed in domains.txt or ips.txt.

	someone added netcom.com to the domains.txt file,
	resulting in all mail from netcom.com being blocked.
This commit is contained in:
Jonathan M. Bresler 1998-02-25 22:06:34 +00:00
parent 5132080e71
commit 996e39f3e9
2 changed files with 42 additions and 16 deletions

View File

@ -3,30 +3,41 @@ default:
mv -f /etc/mail/ips.txt /etc/mail/ips.txt.0 mv -f /etc/mail/ips.txt /etc/mail/ips.txt.0
.endif .endif
fetch ftp://ftp.gulf.net/pub/docs/ips.txt fetch ftp://ftp.gulf.net/pub/docs/ips.txt
cat /etc/mail/ips.txt | cut -d ' ' -f 1 | \ sort ips.txt > block_ips.txt
touch allowsorted_ips.txt
.if exists(/etc/mail/allow_ips.txt)
sort allow_ips.txt > allowsorted_ips.txt
.endif
comm -23 block_ips.txt allowsorted_ips.txt | \
cut -d ' ' -f 1 | \
sed -e 's/$$/ #blocked. contact postmaster/' > \ sed -e 's/$$/ #blocked. contact postmaster/' > \
/etc/mail/ips.new /etc/mail/block_ips.new
mv /etc/mail/ips.new /etc/mail/ips.txt rm allowsorted_ips.txt
mv /etc/mail/block_ips.new /etc/mail/block_ips.txt
.if exists(/etc/mail/domains.txt) .if exists(/etc/mail/domains.txt)
mv -f /etc/mail/domains.txt /etc/mail/domains.txt.0 mv -f /etc/mail/domains.txt /etc/mail/domains.txt.0
.endif .endif
fetch ftp://ftp.gulf.net/pub/docs/domains.txt fetch ftp://ftp.gulf.net/pub/docs/domains.txt
cat /etc/mail/domains.txt | cut -d ' ' -f 1 | \ sort domains.txt > block_domains.txt
touch allowsorted_domains.txt
.if exists(/etc/mail/allow_domains.txt)
sort allow_domains.txt > allowsorted_domains.txt
.endif
comm -23 block_domains.txt allowsorted_domains.txt | \
cut -d ' ' -f 1 | \
sed -e 's/$$/ #blocked. contact postmaster/' > \ sed -e 's/$$/ #blocked. contact postmaster/' > \
/etc/mail/domains.new /etc/mail/block_domains.new
mv /etc/mail/domains.new /etc/mail/domains.txt rm allowsorted_domains.txt
mv /etc/mail/block_domains.new /etc/mail/block_domains.txt
install: install:
makemap hash /etc/mail/spamsites < /etc/mail/domains.txt makemap hash /etc/mail/spamsites < /etc/mail/block_domains.txt
.if exists(/etc/mail/spamsites.local) .if exists(/etc/mail/spamsites.local)
makemap -o hash /etc/mail/spamsites < /etc/mail/spamsites.local makemap -o hash /etc/mail/spamsites < /etc/mail/spamsites.local
.endif .endif
makemap hash /etc/mail/denyip < /etc/mail/ips.txt makemap hash /etc/mail/denyip < /etc/mail/block_ips.txt
.if exists(/etc/mail/denyip.local) .if exists(/etc/mail/denyip.local)
makemap -o hash /etc/mail/denyip < /etc/mail/denyip.local makemap -o hash /etc/mail/denyip < /etc/mail/denyip.local
.endif .endif
.if exists(/etc/mail/fakenames)
makemap hash /etc/mail/fakenames < /etc/mail/fakenames
.endif
all: default install all: default install

View File

@ -1,4 +1,4 @@
Filtering out SPAM from your site Filtering out SPAM from your site
Introduction: Introduction:
The FreeBSD Project filters spam, unsolicited commerical The FreeBSD Project filters spam, unsolicited commerical
@ -12,6 +12,14 @@ usernames (such as investor and success). We do not accept mail
from any machine that matches a entry in either database, or users from any machine that matches a entry in either database, or users
in the fakenames database. in the fakenames database.
WARNING: We do not maintain the database source files.
Read domain.txt and ips.txt.
(Make will fetch them for you)
Domains that you want to allow, should be added
to the file /etc/mail/allowed_domains.txt.
IP addresses that you want to allow, should be added
to the file /etc/mail/allowed_ips.txt.
Filtering at your site: Filtering at your site:
To filter spam at your site you need to: To filter spam at your site you need to:
1. modify your /etc/sendmail.cf, 1. modify your /etc/sendmail.cf,
@ -26,14 +34,21 @@ not use m4 to generate your /etc/sendmail.cf, add the database
declarations to your /etc/sendmail.cf. declarations to your /etc/sendmail.cf.
2. Fetching the database source files: 2. Fetching the database source files:
The database source files are available from Gulf Coast The database source files are available from Gulf Coast
Internet via anonymous FTP. The Makefile in /etc/mail will retreive Internet via anonymous FTP. The Makefile in /etc/mail will retreive
the source files for you: as root, type "cd /etc/mail; make" at the source files for you: as root, type "cd /etc/mail; make" at
the command line. The previous version of the database source the command line. The previous version of the database source
files is moved to <filename>.0. Local additions should be kept in files is moved to <filename>.0.
separate files. We use spamsites.local and denyip.local. You may
want to diff the new versions of the files against the previous Local additions should be kept in separate files. We use
versions to see what has changed. spamsites.local and denyip.local. You may want to diff the new
versions of the files against the previous versions to see what
has changed.
Local deletions should be kept in separate files. We use
allowed_domain.txt and allowed_ips.txt. (This feature was added
after netcom.com was added to the spam block list.)
3. Make the databases: 3. Make the databases:
As root, type "cd /etc/mail; make install" will build the As root, type "cd /etc/mail; make install" will build the