Note
This is a collection of notes from 1999 that I compiled related to sending and receiving faxes from a computer running Linux.

The first step in the chain is getting the right software. When I first began looking for a way to send a fax from a Linux box, I was pointed in the direction of mgetty and vgetty. These support every fax modem you’ll ever need as long as you’ll never need anything but a particular modem that I’d never heard of or seen for sale. That was irritating.

The next time I revisited my quest to fax from a Linux box, there was some new software on the horizon, specifically, efax. THIS is THE program to use unless you know enough about everything to know otherwise.

I found efax-0.9 on the sunsite archive. I unpacked it (tar -xvzf efax-0.9.tar.gz) and followed the directions in the README which went like this:

make
vi ./fax
make install

Now the vi ./fax part is where the user (administrator) must edit the faxing program itself. This is not as hard as it sounds. The fax program is just a relatively straight forward script that controls the more complex efax and efix programs. By changing the things in the script to the way you want them, that’s the way they’ll be when you run the script. Easy. There are good, easy to follow comments in the script itself.

Then make sure that your modem is working using minicom or however you do that. I think a good way to test the interface between efax and your modem is to use the fax receive command. If your modem does something, that’s a good sign. The next step is to have someone send you a fax. As the phone rings on the phone plugged into your fax/modem, issue the fax receive command and see if good things happen. If it goes well, your modem should answer the call, detect a fax and receive it into a file whose name represents the time and date. You should be able to look at that file with xv or possibly some other viewer.

If that worked, great. Then comes the harder part - sending a fax. Actually if you were able to receive a fax, then sending won’t be a big deal - what will be a big deal is getting your information into the correct format. The efax program is in charge of sending and receiving the files and the efix program is in charge of converting these files from and to other formats. I wanted to send a bitmap. I didn’t have much luck with the capabilities of efix in this department (BTW, efix and efax all happen automatically when you run fax. No need to worry about them specifically unless you want/need to). What I did that seemed to work was this:

  1. Use the gimp to create the document that I wanted.

  2. Save it as an uncompressed tiff file

  3. Use image magic to convert it as so: convert -monochrome document.tif fax:document.fax

  4. Then fire it away using this command: fax send 5551212 document.fax

Pretty easy. One annoying thing is that the convert command’s "fax" format doesn’t seem to be exactly efax’s, but it is good enough, the ‘fax send’ command just has efix convert it from a not good enough format to one that it likes. This creates a new file that is appended with the page like this:

document.fax.001

No harm done and it works fine.

Notes on trying to make a simple scanner to fax interface

It should be possible to skip the nonsense and get something that scans whatever’s on the scanner and pumps it out the fax (provided both work). Here is my first try:

scanimage -d umax:/dev/scanner --mode Lineart --resolution 200 | \
convert - fax:- | fax send 6470949

That’s all one line. It seemed to have problems since the fax started dialing before the scanner even got warmed up. This seems to be the way this must be done. It looks like efax and efix just don’t support piped data streams very well…Hmm. I guess that will be for future releases. So use a two step process:

scanimage -d umax:/dev/scanner --mode Lineart --resolution 200 > maptest.pbm
fax send 6470949 maptest.pbm

This creates not one, but TWO files you don’t want - maptest.pbm and maptest.pbm.001. Better ditch’em. I think it would be pretty easy to write a script that took the phone number as a command line argument and did the scan and then sent the dummy file off and finally deleted the dummy file.