Hylafax

Hylafax (http://www.hylafax.org) is a Linux-based IP fax solution: connected to a phone line via a modem, the software receives faxes and sends them via email to a predefined address as either PDF or TIFF attachments; users can also add a printer to their Windows or Mac desktop and send faxes directly from their desktop applications simply by entering the recipient's fax number.


Installation

The Hylafax server will need to be able to access a telephone line in order to be able to send and receive faxes. Hylafax supports RS232 9-pin serial modem connections. I have always had great success with Zoom modems, like this model:

http://www.misco.co.uk/applications/SearchTools/item-details.asp?EdpNo=1...

Most Linux platforms are supported by Hylafax, including Debian, Fedora, Red Hat/CentOS, SuSE, OpenBSD and Solaris. Download the appropriate RPM package for your platform from the Hylafax web site:

http://www.hylafax.org/content/Binary_Packages

In this example I have used CentOS 4.7

Install a base CentOS configuration, including the Mail Server component.
Hylafax requires both the SharUtils and the GhostScript packages, these can both be installed via Yum:

yum install sharutils
yum install ghostscript

Install Hylafax:

rpm -i hylafax-x.x.x.rpm

Once installed, hylafax must then be configured. Do this by running FaxSetup:

/usr/sbin/FaxSetup

You will be prompted for a number of pieces of information. Leave all of the settings at the default values apart from your telephone number details.

At the end of the script you will be prompted to run FaxAddModem. This allows you to specofy the serial port to which the modem is connected that Hylafax should use to send and receive faxes. Select Yes. If you select No, you can run the script at any time by running:

/usr/sbin/faxaddmodem

You will be prompted to specify the serial port that Hylafax should use, this will normally be either ttyS0 (COM1) or ttyS1 (COM2)
You will also be prompted to enter the telephone number of the line that the modem is connected to, and you can also enter a name that will be presented to recipient fax machines (normally the name of the company).
Leave all of the other options at their default values.
When all of the options have been specified, the wizard will then attempt to communicate with the modem on the serial port specified and determine the optimum communications speed: normally either 9600 or 14400 bits per second.

Now you can specify the email address that receives faxes should be sent to, and in what format.
Locate and edit the file

/var/spool/hylafax/etc/FaxDispatch

Locate the line beginning:

"SENDTO=FaxMaster;"

Substitute "FaxMaster" for the email address you wish faxes to be sent to (the target email address should already be configured on the email server):

"SENDTO=sales_faxes@mydomain.com;"

Underneath this line is another that reads:

"FILETYPE=pdf"

This determines the format that faxes are sent in. The default is PDF format, TIFF is also an option.

Finally, locate the file

/etc/inittab

and add the following line:

mo:2345:respawn:/usr/sbin/faxgetty ttySx

(where x is the number of the serial port that the modem is connected to)

If you want the Hylafax service to launch automatically when the server is powered on, issue the following command:

chkconfig hylafax on

Now reboot the server.

Your Hylafax server is now configured and once rebooted will listen for incoming faxes on the connected modem, automatically answer after 1 ring (unless you specified an alternate setting during the configuration), convert the received fax into a PDF file and send it to the email address specified:

Hylafax

NOTE - for the server to be able to send email successfully it must be able to locate an MX record for the target domain via DNS.


Windows Client Configuration

Should you wish your users to have the ability to send faxes through the Hylafax server, then there are clients freely available for a variety of platforms, also available from the Hylafax web site.

The simplest Windows client I have yet come across is WHFC (Windows HylaFax Client), available from:

http://whfc.uli-eckhardt.de/1.2/download.shtml

The package is a simple EXE file that installs all required components. Once installed, you won't be prompted to, but I recommend a reboot.

Once rebooted, before you configure the client, log back into the Hylafax server and run the following command:

/usr/sbin/faxxadduser jamesl

where 'jamesl' is the username of the account you wish to be able to access the Hylafax server to send faxes. Multiple accounts can be created.

Back on the Windows client, open Control Panel --> Printers and add a new Printer.
Select the option to install a local printer and untick the option to 'automatically detect'. You will see a new port has been created for the WHFC client:

Hylafax

Select this port. From the list of available printers, select an Apple LaserWriter:

Hylafax

Enter a name for the printer that will identify it to the user, such as 'Hylafax'.

Now launch the Hylafax client from the Start --> Programs menu. Open the File menu and select User Preferences:

Hylafax

The following window will be displayed:

Hylafax

Complete the Name and Login fields (required), the remaining fields are optional. The Login field needs to contain the same information as the user account you created earlier with the 'faxadduser' command on the Hylafax server. Click OK.

Now select System Preferences from the File menu, the following window will be displayed:

Hylafax

Enter the name or the IP address of the Hylafax server. Click OK. If all has gone well you should see the client successfully connected:

Hylafax

To send a fax from the Windows PC, select the option to Print from any application and select the Hylafax printer. The following window will be displayed:

Hylafax

Enter the fax number of the recipient and click OK. The fax will be queued for transmission.


Mac Client Configuration

A similar client is available for MacOS called 'HylafaxSender', available from http://beta9.be/hylafax/

Once installed, open the Preferences and enter the server address and user name:

Hylafax

The main client window appears as follows:

Hylafax

Enter the recipient's telephone number, select the file you wish to fax, and click 'Send Fax'


Addendum

It is possible to have multiple modems connected to the same Hylafax server (on different COM ports), with each modem configured to send faxes to a different email address. Simply connect the modem, run the faxaddmodem script and configure the FaxDispatch file with the details of the new modem.