
**************** Netfax 2.1 Installation Instructions ****************

Several directories must be created for the spooler to work, and several
executables and data files must be placed in some of these directories. 

NOTE: In order to convert postscript files into G3 format fax files,
      you need to have running on your system Ghostscript (available from
      the Free Software Foundation, (Internet FTP host prep.ai.mit.edu).

      You also need the Portable Bitmap Toolkit, which should have been
      lying around in the same FTP directory where you got netfax. 
      (For example; ftp into alpha-bits.ai.mit.edu, and look for
       /pub/netfax/pbmplus.tar)

      If not,
      send mail to     
		Jef Poskanzer
		jef@well.sf.ca.us
	        {ucbvax, lll-crg, sun!pacbell, apple, hplabs}!well!jef
      and ask where to get the latest release of the pbmtools.

     You will also need a program which creates a postscript file from an
     ordinary ASCII text file. Included in this release is a program called
     'psify' which does this. 

     Another program to convert text to postscript is enscript, from
     Adobe. This is not free software, but you may already have it on 
     your system, as part of the transcript package. 

     These sources, and the TIFF library v2.3 are available by anonymous
     ftp from transit.ai.mit.edu in /pub/systems/netfax

      Henry Minsky (hqm@ai.mit.edu) 

[1] Customize the files include/conf.h and include/conf.mk as follows:

The file include/conf.h contains definitions for various parameters
and working directories.

Here are the directory entries from a typical conf.h

/* fax spooler queue directory */
#define SPOOLDIR 	"/com/fax/outgoing"	      

/* incoming fax receive area */
#define INCOMING	"/com/fax/incoming"

/* executables and data files for the spooler */
#define LIBDIR		"/usr/local/lib/fax"

/* host serial port which faxmodem sits on */
#define SERIAL_PORT	"/dev/ttyb"

/* The program to use to convert plain ASCII to postscript */
#define USE_ENSCRIPT 	TRUE
#define USE_PSIFY       FALSE

The install script also looks at the file include/conf.mk for these
definitions, so make them there as well, as well as where to put the
binaries for the client fax program.

[2] In the netfax directory, login as root, and do 

make world

to compile and install the spooler, associated data files, and user
programs. This make creates the directories it needs, according to the
entries in install/conf.mk if they do not already exist.

[2.1] 	For logging of fax transmissions, create two empty files, /usr/adm/faxlog
	and /usr/adm/faxtxd. Since these will be written to
        by the fax spooler daemon, you should chmod the protections on
        these to be writable by whatever the uid of the daemon process
        is (daemon by default). Or just set them world-writable if you don't
        care.

[2.2]   Look in the file scripts/ppmtog3.sh and make sure that the pathname
        for the pnmcut utility and pbmtog3 converter is correct. This
 	ought to be an environment variable or something.

[3] Start the fax spooler daemon on the host machine by invoking

	faxspooler -D
or
	faxspooler -D -r /* disables fax reception */


NOTE: To automatically start the fax spooler on bootup, put the
following in your /etc/rc.local file:

	# start fax server -- hqm
	#
	if [ -f /usr/local/lib/fax/faxspooler ]; then
		/usr/local/lib/fax/faxspooler -D  & echo -n ' faxspooler'
	fi
	#


[4] The user's can now send a fax by invoking the 'fax' program.

usage: fax [-p returnfax] [-r recipient] [-d] [-g] phone [file]

The phone number is a Hayes Modem compatible dial string. (A comma in the
dial string indicates a pause, etc; see a Hayes manual for details). 

The file can be ascii, postscript, or DVI format. For DVI format, use
the -d option. Postscript will be automatically recognized if the first
two characters in the file are '%!'. 

The optional -p and -r options are strings which go on the coversheet. '-r' is
the name of the recipient, and -p is a return fax number.

The -g option specifies that your are sending a one page g3 format file. This
is largely for testing.

[5] In order for people to be able to send email to fax messages, you
must make an entry in your mailer aliases file to pipe the message to
the faxmail program.

Our entry in /com/mailer looks like this:

fax-service: "|/usr/local/lib/fax/faxmail"                                   

This causes email messages to fax-service to be piped to the faxmail
program. The message is then converted to postscript, and queued in the
spooler directory.  

To specify the destination phone number, the faxmail program reads the
mail header looking for the following entries:

faxphone: <dial string>
faxrecipient: <any line of text; goes on the coversheet in the To: field>
faxreturn: <any line of text; goes on the coversheet in the Fax Reply To: field>

(If you want some other mail interface, you can hack the faxmail program
to parse mail messages differently)

