Installation procedures for BlackMail:
(Did you read the README?)

Note: see the end of the document for OS-specific tips:

	To install BlackMail, start by typing

		./Configure

	(NOTE: you will need Perl 5.004 to run this script, but you
	can proceed without it.)

	If for any reason Configure does not work create a link to the
	template file for your OS e.g.
	ln -s templates/bsd Makefile.tmpl

	The Makefile supplied will compile Blackmail with the most
	common options already set. Take a look at the file and
	change any options as necessary.

	Now, after you modify these files, type the following:

		make
		make install       (as root)

	If you do not already have an /etc/blackmail.conf, then
	copy the blackmail.conf provided to /etc.
	Edit /etc/blackmail.conf, and make any necessary changes.
	You must complete the MAILFILE section (this was formally
	in blackmail.h) also, if required fill in the LOCHOST entry. You
	should add your hostname to the TREAT_AS_LOCALHOST and
	ALLOWED_MAIL_SITES entries.  Any other headers you know of that
	are used in spam should be put in the HEADERS section, and
	any known spamsites should be put in the REJECTED_ADDRESSES
	section.  (See blackmail(3) for more information.)

	Note that the blackmail.conf.jsm is also distributed as an example
	only, inclusion of any sites there does not mean that they are
	100% spammers, nor is the list totally comprehensive.
	Makefile.jsm is how I build blackmail on my machine.

TEST INSTALLATION

	Before installing on port 25 of any machine and certainly if you
	do not have a 'spare' machine to test on, I would recommend
	installing blackmail on some unused port e.g.

	Install a test service in /etc/services, by adding this line

smtptest        1025/tcp                #to test out blackmail

	check that the arbitrary port number 1025 is not already used, if it
	is then choose another port number. Save the file.

	Install a test entry for blackmail in inetd, by adding this line:

smtptest   stream  tcp     nowait  root    /usr/sbin/tcpd	/usr/sbin/blackmail

	Save it, then type "killall -HUP inetd". (Linux only)
	On non-Linux platforms your killall may work differently, so it is
	safer to do a  ps to find the PID of inetd and then kill that.
	e.g.
	ps ax | grep inetd   (or  ps -f | grep inetd)   giving:
		   66  ?  S     0:00 /usr/sbin/inetd
	then do   kill -HUP 66

	Once this is done, telnet to port 'smtptest', and make sure the daemon
	is running.  If it is, send some mail.  This will test it out.

	Here is an example of what you can do:

> telnet localhost smtptest
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220-jsm-net.demon.co.uk BlackMail-0.29 (5 Oct 98)
220-This system is private property.  In order to ensure security,
220-we routinely perform security checks.  In the course of these scans,
220-your activities might be monitored.
220 jsm-net.demon.co.uk Linux Smail3.1.28.1 #5 ready at Tue, 28 Oct 97 20:41 GMT
HELO jsm-net.demon.co.uk
250 jsm-net.demon.co.uk Hello jsm-net.demon.co.uk
MAIL FROM:<test@jssl.co.uk>
250 <test@jssl.co.uk> ... Sender Okay
RCPT TO:<jsm@jsm-net.demon.co.uk>
250 <jsm@jsm-net.demon.co.uk> ... Recipient Okay
DATA
354 Enter mail, end with "." on a line by itself
From: test@jssl.co.uk
To: jsm@jsm-net.demon.co.uk
Date: 15:03:00 GMT

This is a test
.
250 Mail accepted
QUIT
221 jsm-net.demon.co.uk closing connection
Connection closed by foreign host.
> 


	If you have a number of machines specified as 'local' be sure to
	repeat the exercise from those machines to verify your configuration.
	When you feel confident that you have passed this stage you can
	remove your 'test' entries and install blackmail on port 25 as below.

	(I choose to leave a test entry available in the files on my system,
	pointing to the development copy of the blackmail binary, just
	commenting out the entries when not in use.

SEMI-FINAL INSTALLATION

	If you are making a first time installation, it is well worth
	installing Blackmail with the PASSIVE option enabled before you
	let the full version loose on your system. This will give you
	time to ensure you got the configuration 100% right. While
	you have PASSIVE+PASSIVE_RELAY turned on you will not reject any
	mail and any messages blackmail would have rejected will be tagged
	with a header or footer and the number of rejection reasons. You must
	read the log files and establish whether Blackmail is working
	as you desire.

	edit the Makefile and uncomment the line
	#PASSIVE= -DPASSIVE -DPASSIVE_RELAY
	to read
	PASSIVE= -DPASSIVE -DPASSIVE_RELAY

	then
		make clean
		make
		make install       (as root)

	and after that, proceed as per FINAL INSTALLATION

	After a few days of running you should have a good enough idea
	if Blackmail is doing its job. If all is well, re-edit the Makefile
	changing
	PASSIVE= -DPASSIVE -DPASSIVE_RELAY
	to read 
	#PASSIVE= -DPASSIVE -DPASSIVE_RELAY

	then
		make clean
		make
		make install       (as root)

	Blackmail is now in full operation and will bounce spam.

FINAL INSTALLATION

	Install blackmail's entry in inetd, by adding this line:

smtp    stream  tcp     nowait  root    /usr/sbin/tcpd	/usr/sbin/blackmail

	Save it, then type "killall -HUP inetd".  Once this is done,
	telnet to port 25, and make sure the daemon is running.  If it
	is, send some mail.  This will test it out.


	By the way, "man 3 blackmail" and FAQ make good bathroom reading.

	Good luck with Blackmail!


	To partake in discussion of the use and development of Blackmail,
	please join the mailing list by sending e-Mail to 
	listserv@jags.net with "ADD blackmail.list" in the
	body of the message. Submissions can be sent to
	blackmail.list@jags.net


OS-SPECIFIC TIPS

	NeXTStep
	========
	In Configure, change 
		#!/usr/bin/perl  to  #!/usr/local/bin/perl
	In blackmail.conf, change
		"/usr/bin/rsmtp -bs"  to "/usr/local/bin/rsmtp -bs"

	You will also need to copy libc.h into the blackmail directory.
	I am told that this comes with the development kit.
	** if the location of libc.h is the same on all Nexts - let me know **

	NetBSD
	======
	In Configure, change 
		#!/usr/bin/perl  to  #!/usr/local/bin/perl

	Unix System V Release 4.0
	=========================
	DNS does not seem to work as expected, try out the dns-test
	directory first. I chose to disable the DNS checks.
	On the one system I have access to, 'make' drops all of the .o
	files into the blackmail root directory and then cannot link
	them. A workaround is to change your Makefile so that the LINK_FLAGS
	line is as follows:

	LINK_FLAGS= *.o

	SunOs / Solaris
	===============
	When using gcc, you will need to 'fix-includes' as the Sun
	supplied header files cause lots of warnings.
	Also check the FAQ for a note regarding /etc/services.
	There has been little positive feedback from these OSes, so if you
	have any comments to make _DO_ let the author/maintainer know.

Don't forget - read the FAQ!
