The good ol' fax has gone ========================= Not quite, it's still standing right next to the other computers, but it's turned off, waiting to be setup with another copy of FreeBSD to play around with network stuff, maybe IPv6 (if I ever can find some time to start playing with that). It has been the last pure DOS machine in the house. All other machines have long been migrated from DOS to Unix or to OS/2 and from there (unfortunately, due to the lack of appropriate applications on other platforms) further to Win95. The good old 486SX-25 has served me for about 5 years as fax machine. Hopelessly overpowered for the task, but at that time it was the machine with the lowest spec I had in the house, all the others were 486DX-33 (still the majority in my farm). Everyone is talking about TCO (Total Cost of Ownership), while, at the same time, keeping most software updated to the latest version. As all reports state, hardware costs are only a small piece of the whole TCO cake; administration, training and troubleshooting is much more expensive. In these terms, my fax machine has been a relatively cheap system. I set it up with BitFax, which had come free with one of my modems and never switched applications. Only once, I installed an updated version of BitFax to gain some functionality I wanted. What I always liked about BitFax is, that it is possible to write a fax as a simple ASCII file using any text editor, even edlin (for those who still know this one), include a special string and have that string replaced with an image of my signature. No need to fire up a full fledged graphical word processor, eating tons of RAM. Very small fax files, for both sending and receiving faxes is another advantage; storing one year worth of fax traffic, both inbound and outbound on a single floppy disk? No problem, even though this is close to 100 faxes in and as much out. About three years ago I started sending international faxes over the internet, simply because it was much cheaper. Meanwhile, most of my fax traffic is international, so the fax machine has been running almost exclusively for incoming faxes. As I do most of my computing work remotely from my notebook, it often happened that I didn't notice incoming faxes for a couple of days. I said to myself that if I could get a notice by e-mail whenever a fax arrived, it would be much more efficient. Also viewing faxes using a browser or the like, would be much easier for my wife than going downstairs to the fax computer and operate BitFax. The 486DX-50 Unix (FreeBSD) server handles all the computing needs of my home network. It is already a file-, print-, web-, mail-, pop-, internet-gateway-, DNS-, and-so-on server, so why not add another item to its task list? Plugging in another modem would make it a great faxserver. I could have my e-mail notification without going through the trouble of connecting the DOS machine via UUCP to the Unix server. For my wife I could integrate it with the webserver, so she can access faxes from her friends and parents much more easily. If I'm away for some time, I'd have the possibility to have incoming faxes automatically sent to me by e-mail... mgetty+sendfax -------------- Gert Doering is the author of a package called mgetty+sendfax. This is a free and improved replacement of the getty process on Unix. getty is responsible for picking up modems and providing callers with a login prompt. mgetty, however, is much smarter. It can not only improve the login, but also transparently handles UUCP calls and fax calls. The second part of the package, sendfax, can be used for sending outbound faxes. It is possible to build solutions to integrate sendfax with windows and with e-mail, but I'm quite happy with my current internet faxing. So it's only mgetty which I'm interested in. On my test FreeBSD machine I started to setup mgetty v1.0.0. For somebody who is trying for the first time to setup an application on an Unix system, mgetty might not be the best thing to start with. It is not quite as simple to setup as for example apache, or squid, or some other much wider supported application, but following the instructions in the manual, mixed with some intution and knowledge, it was not such a big deal to install it and do a very basic configuration. After successfully receiving a testfax, I changed some of the defaults to better fit my purposes. So far, so good. Getting the raw g3 fax files into a format suitable for displaying in webbrowsers, was quite a bit more complicated. An utility for converting the g3 files to pbm (portable bit map) is provided, but GIF and JPG are the standards on the web. Now, I must confess, in terms of graphical stuff, layout, design and so on, I'm not the right person to talk to. I had no problem displaying the converted, or even original files with utilities such as xv, or ImageMagick, but that was not what I wanted. My goal was to serve the faxes through a webserver to a graphical browser, such as Netscape. Converting the g3 or pbm files using various utilities either produced files which were simply not legible or far too big. After all, 2 MB per A4 page (about 15 KB in g3 format) is not only more than I can spend in terms of harddisk real estate, but also more than you can anybody reasonably expect to download to a webbrowser for viewing a couple of lines on a fax; not even if it is on an inhouse network. This conversion problem kept me busy for quite some time. Finally I also checked out an mgetty site (try http://alpha.greenie.net/), downloaded a developement version of mgetty+sendfax (v1.1.18) and a couple of additional utilities. There was also a small c program called p2g.c (pbm to gif). It is small, fast, simple and does exactly what I needed. While mgetty v1.0.0 was the latest 'production' release, I tried out the freshly downloaded v1.1.18 'developement' release and found it to work fine for me. So, equipped with everything I needed, I finally set out to install mgetty v1.1.18 on the production server. interfacing with the webserver ------------------------------ mgetty can automatically execute a program whenever a fax has been received as well as send e-mail. So for the e-mail notification there wasn't any extra work to do, just make sure the configuration is ok. For automatically adding received faxes to the web interface, I configured mgetty to call a small shell script whenever a fax has been received. The shell script actually is only a wrapper and currently does nothing more than calling a python program. It would also have been possible to call the python program directly, but the additional step has been chosen to have a very easy way to add functionality temporarily, like if I'm away for two weeks and want faxes to follow me. The python program actually has two uses. If there are parameters passed on the command line, it will process these parameters and add the newly received fax to the web interface. From within the web interface, the exactly same program is being called as a CGI. When called as a CGI, there are no command line parameters and the program will scan the environment variables for instructions on what action it is supposed to take. On the 'received faxes' page, each fax is listed with date, remote-ID, number of pages and comment. The user has several possibilities. Of course viewing is one thing. In the case of a multi page fax, it currently is necessary to use the browser's refresh button for each separate page, as the browser caches the previous faxpage even if the caching function has been turned off. I'm sure there is some workaround for this, but I haven't found it yet (hints by e-mail welcome!).Rotating faxes for viewing is not yet implemented. The python program is only a first 'scratch' version and one day I hope to clean it up and implement the remaining features I was thinking of. In this scratch version there is also one more annoyance when viewing a fax page: it is too big. Since the resulting GIF image is being passed to the browser as is, and not embedded in an HTML code, I don't know how to control it's height and width. So at the moment some scrolling around the screen is needed for reading the faxes. I also hope to take care of this later. If I can't find a way to set dimensions for viewing, I'll most probably try to shrink the image with the help of an imaging library which I recently found. Changing the comment for the fax and deleting the fax from the list requires a password. Currently it is a hardcoded password for each authorized user, but in the future I plan to use the Unix login password. With printing I probably was somewhat lucky. When viewing, the GIF is too big and thus it also will not print nicely. But every computer in the house is printing via the network on the printers attached to the server. So instead of users printing locally on their machine, the print button makes the python program execute g3tolj, which comes with mgetty. g3tolj transforms the raw fax file from the g3 format to a format, which can be passed to an HP LaserJet printer. Even though I do not have a laser printer, it does work nicely with my HP DeskJet 520. worthwile --------- The switch from the long established BitFax machine to the Unix server did take some time and effort. And not everything is in it's final state yet, as the python program will still need some considerable brushup. But for the moment it is working well enough, so I'll stay with this 'alpha' version until I finish the projects I'm currently working on. All in all I would consider the change as worthwile: it did cost time, but it saves a machine, offers more possibilities, is easier to handle and as I'm regularly checking e-mail, incoming faxes aren't going unnoticed any more for a whole week. Kurt Keller - Kurt@pinboard.com