Faxing with sendfax
Both mgetty and sendfax deal exclusively with raw 'g3' fax files (g3 stands
for group 3) which is the CCITT standard for encoding fax transmissions. You
will have to use an external program to create, view, or print these files.
There are two types of g3 files:
204x196 dpi - high-resolution
206x98 dpi - low-resolution
The width of a fax page is always 1728 pixels, the length arbitrary. A typical
full page has a length of around 2100 pixels in high-resolution mode.
Sending Fax Files
sendfax is called with the following syntax:
% sendfax [-v] [-n] phone_number faxpage_s
% sendfax 2222323 /tmp/to_gert_1.g3 /var/spool/fax/outgoing/pic.g3
The -v option specifies verbose progress messages. The -n option
specifies sendfax to send the fax in normal resolution. The default
is fine-resolution. This must be correct.
The sendfax return codes are as follows (if the return code is below
10, an extenal program probably should try to re-send the fax, if the
return code is 10 or higher, it should alert the administrator):
0: - all pages tx successfully
1: - error on command line
2: - cannot open fax device
3: - error initializing the modem
4: - dial failed "BUSY"
5: - dial failed "NO DIALTONE"
10: - dial failed "ERROR" or "NO CARRIER"
11: - waiting for XON failed.
12: - tx pages failed
15: - some other error
Automated Fax Queuing
For fax spooling and processing the queue, four additional utility
programs are provided:
faxspool [options] phone-number input-file(s)
phone-number can be an alias. The private alias
file is '$HOME/.faxnrs' and the global alias file
is '/etc/mgetty+sendfax/faxaliases'. These files
are searched for the line stating with this alias
and the remainder of the line will be used as the
phone number.
faxrunq
Reads the directory and try to send all the faxes
queued there.
faxq
Will display all entries in the fax queuel If called
with the -o parameter, it will also display completed,
but not yet deleted jobs (JOB.done files). The -v
parameter, the output will be more verbose.
faxrm
Can be used to remove fax jobs from the queue. It is
called with the job ids of the to-be-removed faxes
as command line argument. The job ids are thoses that
faxq returns.
Converting Fax Files
The programs in the mgetty package include pbm2g3 and g32pbm. These
are used to convert fax files to different formats. The pbm2g3 file
converts pbm (portable intermediate format) to the g3 format. The
g32pbm does just the opposite.
There is also a package called 'pbmplus' which includes a lot of
small utilites to convert various bitmat formats into a pbm file.
It also comes with a lot of standard tools to scale, flip, and
otherwise manipulate the pbm bitmaps. It also comes with different
versions of G3 conversion (pbmtog3 and g3topbm). The programs
supplied in the mgetty package are faster.
For a graphical fax viewer using X11, you can use an image viewer
such as 'xview', 'xloadimage', and 'xv'. There is a simple but
fast fax viewer found in 'mgetty/frontend/X11/'.
Print the fax on a postscript printer:
% cat $faxfile | g32pbm | pnmtops -noturn | lp -dest postscript
To view the fax in X11:
% cat $file | g32pbm >/tmp/fax.pbm; xloadimage /tmp/fax/pbm
% g32pbm $file | xv -
To create g3 fax files, use pbm2g3, or GhostScript software which
contains a 'digifax' driver that will produce the required format,
or use 'hp2pbm' which will convert HP LaserJet print files into g3
fax files (also ph2hig3).
To convert ascii files use: '% pbmtext | pbm2g3'. Don't convert text
longer than 50 lines. You can convert text files into GhostScript
using 'psify' / 'pslp.ps' programs from the ghostscript distribution.
PostScript input can be converted by GhostScript 2.4+ using the
digifax ('dfaxhigh' and 'dfaxlow') drivers. It will generate a
plain g3 file with a 64 byte additional header. The typical call
to ghostscript will look like this:
gs -sDEVICE=dfaxhigh -sOutputFile=/tmp/fax.g3.%d yourdocument.ps
With GhostScript 3.01 and higher, you can use the 'faxg3' driver as
well, it's output is identical to 'dfaxhigh'. GhostScript version 5.01
and up render fax pages better with 'faxg3' than with 'dfaxhigh'.
g3cat