HOME PROJECTS SOFTWARE HARDWARE OTHER FACTS LINKS

under constructionSorry this section is under construction.

Why a fax server

Even we are supposed to become a paperless society, I can find that we are producing more paper than before. I think that is because it is too easy and cheap to print nowadays. One of my pet hates in this respect is the use of faxes instead of emails. It is still the only way to send documents in lots of circumstances. However I found myself most of the times typing the document in my favorite word-processor, printing the pages to be faxed and then throwing those pages to the bin when done. What a waste! I know that there are solutions that let you fax from your computer. Unfortunately they are costly and thus my company has decided not to implement them. I then started to look around the internet for a free solution. As you might expect it came from Linux and the open source community. The answer to my problem is called Hylafax. This is a server which lets you fax documents by way of printing them. Even if the solution sounded simple, to put into practice was a lot of more complex than I thought. The issue is on the client side. When you print a document to be faxed, you want to enter the fax number as well. But how? In normal circumstances the print dialog box cannot be customized to let the user enter a fax number. You simply print. That's it.

How to get the fax number from the user

Ok first I did a Google search as you would expect and found lots of solutions that basically involve writting a special print driver that will prompt the user for the fax number and other information such as the cover page. Even if this is quite good I found that this is prone to buggy drivers which also need to be rewritten for each new Windows version! You are also stuck with what the driver asks the user. No customization. Moreover to program a print driver this is not easy and require source headers not freely available (bad Microsoft bad!).

Other solutions assume that the user will type the fax number within the document to be faxed. The server will then (try) to extract the fax number. Normally that implies that the fax number must be entered according to strict rules. No very user friendly especially if your users are called dumb bob smiley crazy face!

After a while researching I drew up the following requirements:

From the Hylafax links page, I found this small program that was doing something clever. It waits for the server to request the fax number then opens a dialog box to prompt the user to enter the fax number and finally returns the string back to the server. Even if that was still too much of the interface on the client side, it gave me the idea that the server could push a request to the client machine to get the fax number. The sequence of events should be as follows:

  1. The user prints the document using a special Fax printer implemented as a backend with CUPS and made available via Samba.
  2. The backend script stores the document and requests the fax information back to the client.
  3. A server on the client machine acknowledges the request and opens the default browser to show a web page held on our server (that's the clever bit).
  4. Our web server prompts for the extra information via web pages. This can be easily customised because anyone could write their own web pages to suit their needs. Moreover the processing bit is held on the server and in one place. That will simplified any changes to the interface.
  5. When finished, the web server transfers the fax request to Hylafax with the original document and the extra information.

As you can see there are 5 programs to cover the whole process:

Server side requirements

In order to implement our fax server you will need the following.

Step 1: installing Print_To_FAX virtual printer

This is the printer to be installed on each client. However this will be as simple as selecting the printer from the list of printers made available via Samba by CUPS and running the Install command. Only the CUPS drivers will be installed on each client while the printer script resides on the server.

To install this printer on the server, follow the next steps:

Next use CUPS web administration to add the printer by clicking Add Printer. Select make as Postscript and model as HylaFAX Virtual Printer.

Step 2: installing Web Push Server on client machines

  • create folder /var/www and extract this folder in there. You need to make sure that all files are owned by apache user and group. To do so type chown -r apache:apache localhost
  • emerge sudo run visudo and add the following lines: Host_Alias SERVERX01 = localhost apache SERVER01=(root) NOPASSWD: /usr/bin/hylafax_sendps.sh Defaults logfile=/var/log/sudo
    Valid XHTML 1.0 Strict