Setting up to Receive Calls
HylaFax needs it’s own getty program installed in order to answer the telephone line and process a fax. The HylaFax getty program is called faxgetty. The following lines will have to be added into /etc/ttys (note: change cuad1 to cuad0 if you are using COM1):
# Setup for Hylafax
cuad1 "/usr/local/sbin/faxgetty" dialup on secure
After installing the above line you can now ‘kill -HUP 1‘ to get init to use the new changes. After HUPing init then you should be able to call into the phone number of the fax modem and it will pick up the line.
Forwarding Faxes via Email
By default HylaFax will send an email to the FaxMaster email account showing the a fax was received and it will also include a link that allows the user to FTP the fax off the server. This is not very convienient or secure. A better way to set this up is to designate a fax manager that will receive all the faxes and then forward them to the correct person. This person will then receive an email with the an attachment of the incoming fax (in TIFF, PS, or PDF format). For this example we will attach the faxes in PDF format as this seems to be the most common way for users to view them.
First we will use the template capability in HylaFax to send our HTML format messages. These are a lot easier to read for the average user and can easily be customized.
# cd /var/spool/hylafax/etc/templates
# cp -Rp html-sample1 html
Then we will tell HylaFax to use the new html templates and include the fax in the message as a PDF. To do this we need to create a new file called /var/spool/hylafax/etc/FaxDispatch
# cd /var/spool/hylafax/etc
# vi FaxDispatch
HylaFax will not read this file when a fax comes in and send a copy of the fax (in PDF format) to $SENDTO
Printing Incoming Faxes
HylaFax can also print faxes as they come in to any local or network printer. This how-to will not go over setting up a printer on your FreeBSD system and assumes that printing is already setup and working. I have my system setup so that it will print out the fax on a network printer as well as email the fax to the fax manager. Here is how I did it.
HylaFax processes all incoming faxes with a shell script called faxrcvd. This shell script is the one that processes and emails the incoming fax. By adding the following line into the script (after line 206) it can also print out the faxes. NOTE: This does assume that the printer can print postscript files.
# /usr/local/bin/fax2ps $FILE | /usr/bin/lpr -Pprinter