Linux Online Advertisement
[ Register ]

[ Applications ]
[ Documentation ]
[ Distributions ]
[ Download Info ]
[ General Info ]
[ Book Store ]

Advertisement

[ Courses ]
[ News ]
[ People ]
[ Hardware ]
[ Vendors ]
[ Projects ]
[ Events ]
[ User Groups ]
[ User Area ]

Running Linux, Fourth Edition

[ About Us ]
[ Home Page ]
[ Advertise ]

Advanced Linux Course

Fax Services with Hylafax

Hylafax is a freely available server for sending and receiving facsimiles (faxes). It is easily installed and maintained on a Linux system and can handle relatively steady stream of incoming and outgoing faxes.

Note

Hylafax was created by Sam Leffler at Silicon Graphics. It's technically freeware. You can use it as you see fit. The only restriction is that you must respect Mr. Leffler and Silicon Graphics' copyrights to the software and you cannot use their names for advertising or publicity purposes without their permission.

Installation of Hylafax

To install Hylafax on Fedora Core, I got the RPM from their FTP site: ftp://ftp.hylafax.org/binary/linux/redhat/RPMS/i386/. Before you install it however, you need to also install the 'sharutils' package, if it isn't already installed, since it comes with the standard Fedora distribution. Hylafax will also complain about not having 'metamail' package installed. Actually, this is optional, so if you don't find that package - or you find it and it starts complaining about multiple dependencies, as was my case - then you can go ahead with the install without it. Just do it this way:

rpm -ihv --nodeps hylafax..*.rpm

You should now install the 'mgetty' package from the standard Fedora RPMs. This will take care of the reception of faxes.

Set-up and Configuration of Hylafax

To set up Hylafax, we need to run a program that's appropriately named 'faxsetup'. Just run this script in a terminal. Before we get into what it does, I need to point out a little nuisance have found on two of the three distributions on which I have used Hylafax. I have gotten an error about it not finding the ghostscript utilities in the correct place. It's important to fix this because 'faxsetup' will not work without it. Luckily, it's easy to fix. Just create symbolic links to where Hylafax would like to find these ghostscript files:

ln -s /var/spool/hylafax/bin/ps2fax /var/spool/hylafax/bin/ps2fax.gs
ln -s /var/spool/hylafax/bin/pdf2fax /var/spool/hylafax/bin/pdf2fax.gs

This program should then segue into the 'faxaddmodem' script (which used to be a separate program). What 'faxaddmodem' does is to set Hylafax up to use your particular modem. The first thing you need to know is where your modem is. Most conventional modems, whether internal or external and even most of those evil contraptions known as WinModems will use the IRQ for the second serial port. This translates to /dev/ttyS1 on a Linux system. This is the first thing that 'faxaddmodem' is going to ask you. It will then attempt to get analyze the class and get the speed of the modem.

Note

Your mouse is usually occupying /dev/ttyS0 (that's a zero), but that doesn't always have to be the case. On mouse-less servers, you may find that your modem likes ttyS0 just fine. 'faxaddmodem' will tell you if it found the modem on ttyS1. If not, try ttyS0.

It will now begin to ask you questions about your area code, country code and telephone number. These are questions that you should be able to handle without any problem (and this is the advanced course, isn't it!). For most of the other questions about how the modem is going to work you can safely use the defaults. What you should be on the lookout for is the question:

Protection mode for received facsimile [0640]?

I changed this to [644], which makes the faxes world readable. This is because later, we'll be creating a Samba share so that Windows machines (and Linux machines too) can view the faxes.

In the end, values similar to the following should be acceptable:

Country code [1]? 11
Area code [415]? 111
Phone number of fax modem [+1.999.555.1212]? 5555555
Local identification string (for TSI/CIG) ["NothingSetup"]? Your Company Inc.
Long distance dialing prefix [1]? 0
International dialing prefix [011]? 0
Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]? 
Tracing during normal server operation [0x08501]? 
Tracing during send and receive sessions [0x08501]? 
Protection mode for received facsimile [0640]? 644 
Protection mode for session logs [0640]? 
Protection mode for ttyS1 [0660]? 
Rings to wait before answering [1]? 1
Modem speaker volume [off]? quiet
Tag line format string ["From %%l|%c|Page %%P of %%T"]? 

Finally, the setup program will ask you the following question:

Should I run faxmodem for each configured modem [yes]?

Since we're configuring a system that both sends and receives, I've answered no to this question. 'faxmodem' is for setting up a send-only environment.

Reception of Faxes

'faxgetty' is a program that handles the reception of faxes. In order for faxgetty to do its job automatically, you need to add the following line to /etc/inittab

T1:23:respawn:/usr/sbin/faxgetty ttyS1

Again, T1 and ttyS1 correspond to a modem that's configured to use the interrupts for the second serial port (COM2 if you're coming from the Windows world). Adjust accordingly (that is, T0 and ttyS0) if you're using the first serial port.

Now we need to restart the runlevels so that faxgetty looks out for our incoming faxes. To to this, issue the following command:

kill -HUP 1
Note

UPDATE: If you're using the latest stable version of Debian, which at the time of this writing is 'sarge', adding the 'faxgetty' line to /etc/inittab is no longer required.

We should also restart Hylafax now as well:

/etc/init.d/hylafax restart (or start)

Authorized Users

Note

There are dozens of programs that interact with Hylafax in order to send faxes. Some of these permit you to send a word processor document that you're working on directly through a program as if it were a printer. To see the list of programs that work well with Hylafax, see: http://www.hylafax.org/links.html#clients

One of the ways to send a fax is with third party applications that send or 'print' the fax to the Hylafax server. In order for these to work, we need to add users to our system. This is done with the following command:

faxadduser -p [password] -u [$UID] - [username]

Of course, this supposes that each individual user has an account on the system where Hylafax is. This might not be the most efficient or most importantly, the most secure idea, so you may want to create one account with its login privileges disabled and have everyone go through this.

As for others viewing incoming faxes, since we originally set up the incoming faxes to be world readable (see: Protection mode for received facsimile), it's easy to set up the directory to be seen from workstations via Samba. Naturally, you have to be running Samba. If you are, just add the following to your smb.conf file:

[Fax_Rec]
comment = Incoming Faxes
browseable = yes
writable = yes
path = /var/spool/hylafax/recvq
public = yes

Of course, the needs of each individual or company are different. There are a lot of tools out there to help you with the management of faxes. With Hylafax, though, you've got a solid system for sending and reception that you can easily build upon.



Comments: feedback (at) linux.org
Advertising: banners (at) linux.org
Copyright Linux Online Inc.
Compilation ©1994-2008 Linux Online, Inc.
All rights reserved.