========================================================================== Portable network aware fax print server for hylafax and other fax-packages ========================================================================== Date: 04/2000 Version: 0.93 Author: Rainer Krienke, krienke@uni-koblenz.de You need: Perl, at least version 5.002, some perl modules from the standard perl library, syslog.ph (usually automatically generated by install script) Main featurs: - You can send a fax from ANY application that can print to a standard unix printer using the spooling system like lpr just by printing to a fax printer. - Your frontend is started on demand. You do NOT have to keep it open eating up your screen or CPU and memory. It's run automatically when its needed. Since the frontend is run in the environment of the user all his env settings like FAXSERVER or FAXCOVER have their usual effect. - Supports ANY graphical fax frontend that allows to be started with the fax filename as an argument on the commandline like ksendfax, susefax or tkhylafax and others - this package is independant of the underlying fax software. I's protable since its written in perl. - The package is network aware. For installations with many hosts you can install one central faxprintserver Description: ------------ Hylafax is a powerful fax suite that easily allows faxed to be sent from workstations or Windows-PC´s. This package which should be highly portable, because it is compleatly written in Perl. Its a useful extension that enables you to send a fax by printing the document to be sent to a fax printer.. The problem with hylafax in my eyes was until now, that using a Unix workstation there was no easy way from within an application (say spredsheed, wordprocessor) to send a fax simply by printing it to a (possibly network) fax printer. The main problem in between is not the lack of graphical frontends to send a fax, but the lack of a way to automatically start such a frontend in the users environment and supplying it with the right parameters (like faxnumber and filename to be faxed) by simply printing to a fax printer. Moreover it should be possible (eg in a company) to install the faxprinter on only one machinei, although all machines of that companie should be able to use it for sending a fax. The basic idea to solve this problem is to write a print inputfilter for the fax printer, that sends its data to a process started by the user who wants to send the fax. Actually all you need is a input filter for your spooling system (eg the lpr system) which calls a client that xfers all the data the filter receives to a server started by the user which reads this data, starts a graphical fax frontend and supplies it with the data received. Well, that's exactly what hfaxlclient and hfaxlserver do. This package includes a simple input printfilter to be used in a BSD based spooling system like lpr. The lpr system can be used to print across the network. Since hfaxlserver and hfaxlclient are network aware, and the lpr system when printing to a remote printer passes the name of the host who initiated printing to the remote printing system, hfaxlclient running on the remote network printer server can easily pass all data to the hfaxlserver running on the host the user printed from. This method just described however has (at least) one security problem. Because the client program tells the server which program the server should use as a graphical fax frontend, and this program is started with all the permissions the user has, it might as well delete all his files. To avoid this problem, the server accepting connections from the client allows only some particular frontends (given with full path) to be started. So the client cannot start an arbitrary program but only those allowed by the server running with the users permissions. So you should take care of the permissions the hfaxlserver file you start has since this file checks if the client that should be started is allowed to. Whoever can change this file can compromise your security as well! Usually all the hfaxl files should belong to root and have "-rwxr-xr-x" permissions. This software can either be used local on a single workstation running the client and server or in a larger environment where all worstations are connected by a LAN. In this situation you can install one central network printer "fax". This way you have to install the fax printer with its filter only one time and you can print from all your worstations where only a remote printer has to be installed. System-Installation using the installscript or rpm file: -------------------------------------------------------- You can either use the preconfigured rpm and install it as usual (rpm -i faxprt.rpm). You can as well get the faxprt.tar.gz file and unpack it. There is a installscript (./hfaxinstall) in it. It will install everything needed for a local machine (i.e. the installed fax printer is not a network but a local printer). Call the script from the distribution directory (where the script itself is in). If you already have installed the software you should first remove the installed fax-printer entry from /etc/printcap since if a printer fax is already defined, the install script will try fax1, fax2 ... and this way install a new printer. This is due to the fact that there are other faxprint packages around that might as well have added a fax printer to /etc/printcap. Hopefully the script should do the job for all printcap based systems. You can adjust several values by setting environment variables (you should change these Values only if you know what you are doing and not using the rpm package but the tar distribution): SPOOLDIR: The basedirectory of the lpd system (/var/spool/lpd) SPOOLUID: The uid of all the spooling files (lp) SPOOLGID: The gid of all the spooling files (lp) FAXPRINTER: The name of the faxprinter for /etc/printcap (fax) INSTALLDIR: The dir for all the scripts (/usr/local/bin) Set the values before starting the script. Watch out for any error messages. Changing the last variable from above requires that you change the the path in /etc/printcap in the :if= line for the fax printer where the script hfaxlif is called and the hfaxlif script itself, since it calls the hfaxlclient script with full path (usually /usr/local/bin). Changing the installtion paths ------------------------------- If you need to change the default path from /usr/local/bin to somewhere else you should check carefully if you followed the steps below: 1. Copy the script files to the new directory (ies) 2. Change the "if" line of the fax printer entry in /etc/printcap so that the path of hfaxlif matches the path where you copied hfaxlif to. 3. Change the call of hfaxlclient in the script hfaxlif so that it tries to find hfaxlclient in the directory you installed it in. Manual System Installation: --------------------------- Here are some more in depth information what has to be done and how it works. Read it if you have any trouble or want to install the software by hand: - Copy the file hfaxlclient and hfaxlserver to some well know directories that can be accessed by the print server machine and your users respectively. - On you print server machine install a new printer named "fax" or something like this. On all your client machines from where you want to access this (network) printer make you new fax printer known (install a remote printer). If there is only one machine you simply add a new faxprinter to it. The fax printer should use a input filter program like the one supplied with this package that is suitable for many BSD-based printing systems like linux is. In the filter program hfaxlclient is called (please check paths) that gets a parameter for the graphical frontend by which the process of sending a fax is actually performed. I use ksendfax, if you want to use something different replace it in the supplied filter and write the full path of this program in hfaxlservers "%allowedClients" hash (see documentation in the script file). The user may override the frontend by creating a file .hfaxlrc in his HOME directory. See below in the user installation section. If you are running a SYSV system, you have to write a similar interface script for your new printer yourself; sorry. User-Installation: -------------------- - Each user who wants to be able to send a fax by printing to the new installed printer should call the hfaxlserver script somewhere as part of the X startup procedure. You probably cannot start hfaxlserver in your .login script since it will test if the X-display is accessible at this point. A good place using KDE is the Autostart folder using the supplied .kdelnk file (in $HOME/Desktop/autostart/). You could as well put the call somewhere in your .xinitrc file, if you have one. You do not need to supply any parameters to the hfaxlserver script. If the user does not want the default frontend specified in the call of hfaxlclient he can specify another one in his .hfaxlrc file. See below. - Give it a try and print to your faxprinter. After a short while the graphical fax frontend should appear. Now you can supply the correct number and send your fax. Each user can configure which of the allowed frontends should be startetd (independently of the -c parameter given to hfaxlclient) creating a file .hfaxlrc in his HOME directory. This file should contain exactly one line specifying the clientprogram to use with its options needed to open a particular file to be faxed. Eg tkhylafax could be specified this way: /X11R6/bin/tkhylafax -file After a change restart hfaxlserver. By this declaration when printing to the fax printer hfaxlserver would start tkhylafax giving it the -file Parameter and then the ptahname of the file to be sent. Note however, that this program HAS TO BE in the %allowedClients hash in hfaxlserver! Always check this if you change the default frontend! Problems --------- There is one still unsolved problem in several perl-distributions. The error occurs, when the user tries to start hfaxlserver as well when the lpr-system tries to start hfaxlclient. The error is a perl error like: Can't locate stdarg.ph in @INC (did you run h2ph) ... This error says, that the file stdarg.ph could not be found by perl allthough it usually is there. The functionality provided by stdarg.ph is only needed for syslog purposes, so that you as sysadmin can see log messages of hfaxlserver in /var/log/messages. If do not really need these messages you can use the hfaxlserver.nosyslog and hfaxlclient.nosyslog versions of the scripts. These version do not log anything in /var/log/messages, only to stderr, but they do not need stdarg.ph. Just replace the standardscripts with the *.nosyslog versions and restart them. Have fun Rainer Krienke krienke@uni-koblenz.de