Faxmaker is an excellent product that I work with, but it is also expensive. When I ran into some issues with my Faxmaker server (I think it was more modem driver issues, but whatever), I decided to investigate other options instead of renewing/upgrading. That’s when I came across Hylafax+.
My workplace uses Faxmaker for 3 things: email-to-fax, fax-to-email, and PDF-to-fax. After some reading, Hylafax will do all of this as well, so I’m going to document the entire conversion process.
For now, I’m going to cover my initial setup of Hylafax to use a MultiTech MT5634 modem board to receive incoming faxes and send them to users as a PDF attachment.
First of all, there are 2 different Hylafax results on Google. The older version (no updates since ’07) and Hylafax+ (the version I’m referring to). The documentation is rather spartan, so I’m cobbling together my setup from the docs and from forum posts.
Download and install Hylafax+. Before continuing with the actual setup, make sure that your modems are recognized as serial devices. The MT5634 I’m using has 4 ports, and they appear as /dev/ttyS5-8.
The first thing you’ll want to do is run faxsetup. This will ask you some questions about your area (long distance prefix, area code, etc). After faxsetup has completed, it will prompt you to run faxaddmodem, which creates the config files needed for each fax line. The faxaddmodem script will prompt you for the device name (ttySx), allow you to override any of the defaults you set in faxsetup, and lets you adjust things like max fax size and error tolerance. It will also detect the modem capabilities. You’ll need to run faxaddmodem once for every fax line on the system.
One thing that took a couple minutes to figure out is the getty setup. If you’re setting up a fax line for inbound calls, you’ll need to add an entry to your inittab to bind the Hylafax getty (faxgetty) to the interface:
Then kick your inittab (init q). If you forget this step (like I did), the modem will never pickup incoming faxes. You can check the status of your fax lines by running faxstat, which will give you a rundown on all your lines (idle, answering, receiving, etc).
Hylafax runs in a chroot environment, so all config references are relative to its chroot (/var/spool/hylafax for me). In etc/, you’ll find config.ttySx files for all of your modems. Fax lines at my location need to have an 8 prefixed to them for an outside call, and a dialout prefix wasn’t one of the faxaddmodem questions. To add a prefix, you’ll need to add a custom dialout command to each config file:
Your command might be slightly different, but the premise is the same – the AT dial command, followed by the prefix (8), then %s (which is replaced with the actual fax number being dialed), and @ (not sure what this does, but people said it was needed).
At this point, incoming faxes will be coming to root, attached as TIFF files. While that could be what you’re looking for, I need these faxes to go to users. For that, you’ll need to create a file in /etc called FaxDispatch (case sensitive). This is a config file that allows you to route based on serial line (among other features), and set the file format for attachments:
FILETYPE=pdf case "$DEVICE" in ttyS5) SENDTOfirstname.lastname@example.org;; ttyS6) SENDTOemail@example.com;; esac
You get the idea. There is a lot more you can do with this file, but for now, that’s all I need to restore some missing functionality for users.
I’m sure I’ve made some config errors already, but this was enough to get inbound faxing working again. Sendmail had to be configured to allow relaying to example.com, since it wasn’t hosted locally.
This has covered the basic setup for fax-to-email, the next post will cover the email-to-fax and PDF-to-fax setup. The HylaFax switchover has been cancelled for now, so there will be no further updates to this process.