📄 ch64.htm
字号:
<LI><TT>-1</TT> to generate only 1D-encoded fax when sending.
</UL>
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading15<FONT COLOR="#000077"><B>CAUTION:</B> </FONT>There is no
way to abort an incoming fax. Just sit back and wait until it's over.
<HR>
</DL>
<P>The <TT>faxd.recv</TT> daemon is the program that implements the server side of
the fax job submission protocol. It also implements extensions to this protocol to
support job removal and the return of status information. <TT>faxd.recv</TT> is normally
invoked by <TT>inetd</TT> with a line in the following form:<FONT COLOR="#0066FF"></FONT>
<PRE><FONT COLOR="#0066FF">fax stream tcp nowait fax /usr/libexec/faxd.recv faxd.recv
</FONT></PRE>
<P>The <TT>faxd.recv</TT> daemon accepts requests for transmitting faxes and creates
the appropriate queue and document files in the HylaFAX spooling area. If a job is
received properly, a request to process the job is then sent to a fax server by writing
to a FIFO special file named <TT>FIFO</TT> in the spooling directory. The <TT>faxd.recv</TT>
daemon then returns a message to the sender indicating the Job ID (an integer number
associated with the job). This Job ID can be used later to remove the job from the
queue and to query the job's status.</P>
<P>Diagnostics generated by <TT>faxd.recv</TT> are logged with the <TT>syslog</TT>
facility. The user is always informed of any problem that affects the status of the
queued job. Check the man pages for a list of these error messages.
<H3 ALIGN="CENTER"><A NAME="Heading16<FONT COLOR="#000077">Sending a Fax</FONT></H3>
<P>To send a fax, you will use the <TT>sendfax</TT> program. The syntax for this
command from the man page is<FONT COLOR="#0066FF"></FONT>
<PRE><FONT COLOR="#0066FF">sendfax [ -a transmit-time ]
[ -c comments ]
[ -r regarding ]
[ -x to-company ]
[ -y to-location ]
[ -d destination ]
[ -f from ]
[ -h host[:modem] ]
[ -i identifier ]
[ -k kill-time ]
[ -lm ]
[ -n ]
[ -p ]
[ -s pagesize-name ]
[ -t tries ]
[ -v ]
[ -DR ]
[ files... ]
</FONT></PRE>
<P><TT>sendfax</TT> queues up fax requests to a <TT>faxd</TT> server. These requests
normally are processed immediately, although they may also be queued for later transmission
using a syntax identical to the <TT>at</TT> command. For each job that is queued,
<TT>sendfax</TT> prints a job identifier on the standard output. This number can
be supplied to the <TT>faxrm</TT> command to remove the job or to the <TT>faxalter(1)</TT>
command to alter some of its parameters.</P>
<P>Fax documents are made from the concatenation of files specified on the command
line. If no files are supplied, <TT>sendfax</TT> reads data from the standard input
unless polling is requested. <TT>sendfax</TT> passes PostScript and TIFF documents
directly to the fax server for transmission and attempts to convert other file formats
to either PostScript or TIFF. In normal operation, <TT>sendfax</TT> automatically
converts ASCII-text or <TT>troff</TT> output before transmission.</P>
<P>By default, <TT>sendfax</TT> will generate a cover page for each fax that is transmitted.
This cover page is created by the faxcover program using information determined by
<TT>sendfax</TT> and by information supplied on the command line. The <TT>-x</TT>
option is used to specify the receiver's company; the <TT>-y</TT> option to specify
the receiver's geographical location; the <TT>-c</TT> option to specify a comments
field; and the <TT>-r</TT> option to specify a Re: subject. If a destination is specified
as <TT>user@fax-number</TT>, the user string is passed to <TT>faxcover</TT> as the
identity of the recipient.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading17<FONT COLOR="#000077"><B>NOTE: </B></FONT>The preceding options
must precede the <TT>-d</TT> option on the command line. Note also that multiword
names must be enclosed in quote marks (<TT>"</TT>).
<HR>
</DL>
<DL>
<DD>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading18<FONT COLOR="#000077"><B>TIP:</B> </FONT>If you don't want
a cover page, specify the <TT>-n</TT> option.
<HR>
</DL>
<P>Here are a few other things about sending faxes:
<UL>
<LI>You can use <TT>*70</TT>, on the <TT>-d</TT> parameter of <TT>sendfax</TT> when
you want to disable call waiting.
<P>
<LI>By default, a fax is sent at low resolution (98 lines per inch). Medium resolution
(196 lines per inch), often called <TT>fine mode</TT>, is requested with the <TT>-m</TT>
option. Low resolution is requested with the <TT>-l</TT> option.
<P>
<LI>Faxes are on 8.5 x 11 pages unless otherwise configured. Other sizes include
A3, ISO A4, ISO A5, ISO A6, ISO B4, North American Letter, American Legal, American
Ledger, American Executive, Japanese Letter, and Japanese Legal.
<P>
<LI>By default, <TT>sendfax</TT> uses the <TT>FAXSERVER</TT> environment variable
to identify the fax server to which the job should be directed. This can be overridden
with a <TT>-h</TT> option. The server specified with the <TT>-h</TT> option, and
by the environment variable, is a host name or address and, optionally, a modem identifier.
The syntax for the latter is either <TT>host:modem</TT> or <TT>modem@host</TT>. For
example, <TT>cua2@no.inhale.edu</TT>. If no modem is specified, the job will be submitted
to any available modem.
</UL>
<P>If the first attempt to send a fax is unsuccessful, HylaFAX periodically tries
to resend the fax. By default, HylaFAX tries to transmit the fax for one day from
the time of the initial transmission. The <TT>-k</TT> option is used to specify an
alternate time for killing the job. This time is specified using notation compatible
with <TT>at</TT> and as a time relative to the time of the initial transmission attempt.</P>
<P>If an error is encountered while HylaFAX is processing a job, the fax server sends
an electronic mail message to the account submitting the job. If the <TT>-D</TT>
option is specified, HylaFAX also notifies the account by mail when the job is completed.
In addition, if the <TT>-R</TT> option is specified, notification also is returned
any time the job must be queued for retransmission.</P>
<P>Notification messages identify a job by its job identifier.</P>
<P>An arbitrary identification string can be specified instead with the <TT>-i</TT>
option.</P>
<P>If the <TT>-v</TT> option is specified, <TT>sendfax</TT> prints information on
the standard output about what <TT>sendfax</TT> does. If you specify <TT>--v -v</TT>,
even <TT>faxd.recv</TT> displays its status messages as it works.</P>
<P>See the man pages for more information on the options available with this <TT>sendfax</TT>
command.</P>
<P>Only two types of files are accepted by the fax server for transmission: PostScript
files or TIFF Class F (bi-level Group 3-encoded) files. All other types of files
must be converted to one of these two formats. The <TT>sendfax</TT> program applies
a set of rules against the contents of each input file to identify the file's type
and to figure out how to convert the file to a format that is suitable for transmission.
These rules are stored in the <TT>/usr/local/lib/HylaFAX/typerules</TT> file, an
ASCII file similar to <TT>/etc/magic</TT>. See the man pages on type rules for a
detailed look at how these type rules work.
<H3 ALIGN="CENTER"><A NAME="Heading19<FONT COLOR="#000077">Receiving Faxes</FONT></H3>
<P>Server processes can be configured to answer incoming phone calls and automatically
receive faxes. Received documents are placed in the <TT>recvq</TT> subdirectory as
TIFF Class F files. The server can be configured to make these files publicly accessible,
or they can be made private, in which case an administrator must manage their delivery.</P>
<P>When a fax is received, the server process invokes the <TT>bin/faxrcvd</TT> command.
The default command is a shell script that sends a mail message to a well-known user,
the <TT>FaxMaster</TT>, but you might also, for example, automatically spool the
document for printing.</P>
<P>Actually the man pages for HylaFAX are well written (for man pages). In the man
pages for <TT>faxd</TT>, you get a lot of detailed information about how received
faxes are handled.
<H3 ALIGN="CENTER"><A NAME="Heading20<FONT COLOR="#000077">Special Features</FONT></H3>
<P>HylaFAX comes with several features from creating cover pages and receiving incoming
data calls to handling polling requests. In each of these cases you can get more
information for the man pages for each command discussed in the remainder of this
chapter.
<H4 ALIGN="CENTER"><A NAME="Heading21<FONT COLOR="#000077">Cover Pages</FONT></H4>
<P>You generate PostScript cover sheets for your outgoing faxes with the <TT>faxcover</TT>
command. The syntax for this command from the man page is<FONT COLOR="#0066FF"></FONT>
<PRE><FONT COLOR="#0066FF">$ faxcover [ -t to-name ]
[ -l to-location ]
[ -x to-company ]
[ -v to-voice-number ]
[ -c comments ]
[ -r regarding ]
[ -p page-count ]
[ -s pagesize-name ]
[ -C template-file ]
-f from-name -n fax-number
</FONT></PRE>
<P>To generate the cover page for each outgoing fax, <TT>faxcover</TT> is invoked
by the <TT>sendfax</TT> program. <TT>Faxcover</TT> generates a PostScript cover-page
document on the standard output. The cover page fills the entire area of the default
page and is created according to the information supplied on the command line and
a cover sheet template file. The default template file is named <TT>faxcover.ps</TT>.
You can override the default cover sheet with the <TT>-C</TT> option by specifying
a file in the <TT>FAXCOVER</TT> environment variable.</P>
<P>If the cover sheet's filename is not an absolute path, <TT>faxcover</TT> looks
first for this file in the sender's home directory. If no such file is present, <TT>faxcover</TT>
looks in the library directory where the HylaFAX client application data is installed.
If no template file is located, <TT>faxcover</TT> terminates without generating a
cover page.
<H4 ALIGN="CENTER"><A NAME="Heading22<FONT COLOR="#000077">Polling</FONT></H4>
<P>HylaFAX supports the polled retrieval of fax documents. Documents received because
of a poll request are stored in the <TT>recvq</TT> subdirectory and also delivered
directly to the requester using the <TT>bin/pollrcvd</TT> command. This script typically
encodes the binary fax data and returns it to the recipient via e-mail.
<H4 ALIGN="CENTER"><A NAME="Heading23<FONT COLOR="#000077">Receiving Data Calls</FONT></H4>
<P>Most fax modems also support non-fax communications. HylaFAX uses the locking
mechanism employed by <TT>uucp</TT> and <TT>cu</TT>. Therefore, HylaFAX transparently
relinquishes the serial port when an application uses the modem for an outgoing call.
In addition, HylaFAX attempts to deduce whether an incoming call is for fax or data
use. If an incoming call comes from a data modem and the <TT>-g</TT> argument is
specified in the configuration file (or on the command line when the fax server process
is started), HylaFAX invokes the <TT>getty</TT> program so that the caller may log
in to the system.
<H4 ALIGN="CENTER"><A NAME="Heading24<FONT COLOR="#000077">Checking Status</FONT></H4>
<P>HylaFAX maintains status information in several forms. General status information
for each server process can be displayed by the <TT>faxstat(1)</TT> program. The
server processes may also be configured to log various kinds of debugging and tracing
information. For more information about configuration, see the section titled "Installation
Steps" in this chapter. The <TT>faxstat</TT> utility provides information such
as the remote status of jobs queued for transmission, jobs received, and the general
status of server processes. (See Listing 64.3.)
<H3 ALIGN="CENTER"><A NAME="Heading25<FONT COLOR="#000077">Listing 64.3. Output
of the faxstat command.</FONT><FONT COLOR="#0066FF"></FONT></H3>
<PRE><FONT COLOR="#0066FF"># faxstat
Server on localhost:cua1 for C: Running and idle.
Job Modem Destination Time-To-Send Sender Status
2 any 5551212 root Queued and waiting
1 any 5551212 kamran Being processed
Server on localhost:cua1 for C: Sending job 1 to 5796555.
</FONT></PRE>
<P>Any problems encountered during fax transmission are reported to the user by e-mail.
A user may also request notification by mail when a job is requeued. The server process
uses the <TT>/bin/notify</TT> command to inform the user via e-mail.</P>
<P>The file <TT>etc/xferlog</TT> contains status information about all faxes sent
and received. This file is in a simple ASCII format that is easy to manipulate with
programs such as <TT>vi</TT> or <TT>emacs</TT>.</P>
<P>To get more accounting information, use the following commands.
<UL>
<LI><TT>xferlog</TT>--A log file of all transmitted files
<P>
<LI><TT>xferstats</TT>--Accounting information about all faxes sent or received
</UL>
<H4 ALIGN="CENTER"><A NAME="Heading26<FONT COLOR="#000077">E-Mail Setup</FONT></H4>
<P>It is easy to set up a simple mail-to-fax gateway facility with HylaFAX. If your
system uses <TT>sendmail</TT> to deliver mail, follow the instructions in the <TT>faxmail/mailfax.sh-sendmail</TT>
document. If your system uses <TT>smail</TT> (Linux users), follow the instructions
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -