XFAX 4.3a - User's Guide

Table of ContentsPreviousNextIndex

4. Sending a fax

Many of the fax messages that are sent are of a very simple nature. They may involve confirmation of an agreed time, an order, cancellation or similar, which only takes up a couple of lines. In such cases it should be possible, by means of a simple manipulation, to send just such a fax from the command line or from your favourite word processor, with the minimum of work on the part of the user.

The system can convert text files with the HP Laserjet PCL commands - to be more precise the commands that are generated by an HP Laserjet or HP Laserjet Plus printer. This means that HP Laserjet printouts from within another program such as a word processor can be sent direct to XFAX with precisely the same results as if they had been printed out on the laser printer. The only difference is that the resolution on a fax is 200 dpi (dots per inch) as opposed to a laser printer's 300 dpi or more. Lists of the commands that are supported are given in the appendix. For a more detailed description of the PCL standard you are referred to printer manuals or similar.

The typefaces that accompany XFAX are the same as the typefaces found in the Z1A typeface cassette from Microsoft.

The command faxsend converts files to the fax format and asks the fax server to place the final fax in a queue awaiting transmission. When the time for transmitting is reached (normally immediately) an attempt is made to send the fax. If the transmission is successful the fax is removed from the transmission queue and the statistic is saved in the statistics file. On the other hand if the attempt is not successful, the fax is given a new time for a new attempt. The new time becomes the current time plus the number of minutes given by the keyword RETRY_TIME in the configuration file. When the maximum number of attempts, given by the keyword MAX_TRIES, has been reached the fax is moved from the transmission queue to the queue for unsuccessful faxes. A copy of the fax is saved in the directory "Fax" (see also FAIL_DIR) under the home directory for the user who first placed the fax in the queue. This user can also be informed of the failure via electronic mail if so desired. There is also the possibility of getting the system to execute a special command after the concluded transmission or failed transmission, see also the keyword EXECUTE_AFTER_SEND.

4.1 faxsend

The easiest way to send a fax using faxsend is quite simply to give a telephone number and a file name as an argument. For example:

# faxlogon
# faxsend 7586535 pricelist

which converts the text in the file "pricelist" to fax format and sends the finished fax to fax number 7586535.

Data can also be sent to faxsend via a so-called pipe as follows:

# cat price list | faxsend 7586535 -    or
# faxsend 7586535 - <pricelist

This sends the contents in the price list file to the faxsend command which, since the parameters are specified, reads the data from standard input, converts and places the fax in a queue to a recipient with the fax number 758635. Note that you must be connected to the fax server before you can use any of the fax services. This is done with the command faxlogon.

If you send a fax abroad or via a telephone exchange, the modem may sometimes need to wait for a tone during the dialing of the number. In order to achieve this a "W" (wait for the tone) or a "," (wait 2 seconds) is inserted in the telephone number. For example, to make a call through a telephone exchange the number may appear as follows: 0W087586535. If the modem is connected to a telephone exchange line it is unnecessary to dial 0W before each telephone number. Instead you can use the keyword DIAL_PREFIX in the configuration file.

Note. If an area code given in the telephone number corresponds with that which is defined by LOCAL_PREFIX in the configuration file, it is automatically removed before the fax is placed in the queue. This means that it is possible to always give the area code, e.g. in the telephone book, without any problems arising during transmission.

4.2 Attaching a note to a fax

In order to be able to keep track of which fax is which, a note of a maximum of 80 characters can be attached to the fax. This note is then shown in the fax queues on a separate line. In order to add a note, the parameter -n is added to faxsend.

It will also be supplied to scripts defined by EXECUTE_AFTER_SEND.

# faxsend -n "Quotation to Stefan" 7586535 quotation

Notes are shown in the following way in the fax queue:

# faxq
ID     Fax number       Enqueued       Next  St P Try LC   User            Pgs
182    7586535          09:41 19980601 09:41 PE 4   0      davcar            3
>>>> Quotation to Stefan

4.3 One fax to several recipients (group transmission)

The same fax can easily be sent to several recipients if the recipients' fax numbers are stored in a file, one number per line, and then the parameter -l with the file name is used as an argument. Lines which begin with the symbol # are missed out and can thereby be used for comments. E.g.:

# faxsend -l customerfax news.txt

This sends the file news.txt to the recipients who are shown in the file customerfax.

If this method is used then only one copy of the fax file is saved, plus a small control file per recipient, which means that a minimum of hard disk space is taken up.

4.4 Scheduled transmissions

A particular time for transmission can be given by using the parameter -t with the time as an argument. E.g.:

# faxsend -t 12:18 7586535 letter

which means that the file letter is put in the queue for transmission at 18 minutes past 12.

Naturally it is possible to combine the above functions so that e.g.:

# cat newsletter | faxsend -l customerlist -t 0:30 -

puts newsletter in a queue for transmission to all customers whose fax number is in the customerlist file. However the actual transmission does not begin before 12.30 at night, perhaps to minimize telephone costs.

4.5 The ID of the fax in the queue

Each fax is given its own unique identity number before being placed in its respective queue. When being transmitted, the fax's ID can be shown on the screen, after the fax has been placed in the queue, by giving the parameter -id to faxsend. It can look like this:

# faxsend -id 7586535 letter
Converting files...OK
Placing fax in queue...OK

The above fax received the ID 1136.

4.6 Printing a fax before sending

By using the parameter -d, the fax can be printed out on a printer.

# faxsend -d laser 7586535 letter

prints out the fax on the laser printer before it is placed in the queue. Normally the UNIX command 1p is used for the printouts as well as the standard printer in the operating system. In order to change this the keywords LP, LP_PRINT-OPTION and DEFAULT_PRINTER in the configuration file are used.

4.7 The script xfax

Accompanying the XFAX distribution is a small command script known as xfax, which can be found under BINDIR. This command is for sending a fax, together with a cover sheet, in a simple way. The user is requested to feed in the recipient's fax number, name and company, and then a page with this is created and the sender's (your) information plus a message which can be entered in. You can also add files that are to be sent after the introductory cover sheet. This is useful if you wish, for example, to send a price list that is stored in a file to a prospective customer together with a few polite words.

You can also set up a telephone book to use together with xfax. Not only can global telephone books be arranged for all users of XFAXDIR/faxdir but personal telephone books can also be set up for each user in the directory .faxdir under the user's home directory. The format on the file is one recipient per line and each line consists of four fields with ":" as a field separator. The first field contains the name you want to use and the second field contains the fax number. Fields three and four can contain the recipient's name and company respectively, but these need not be given. E.g.:

icab:7586535:Stefan Norlin:Infoflex Connect AB
nisses:012-345678:Nisse Karlsson

If a recipient is chosen from a telephone book the system proposes the recipient's name and company on the cover sheet, but this can be changed if so required.

Windows clients also use the telephone books in the system.

Note. If an area code given in the telephone number corresponds with that which is defined by LOCAL_PREFIX in the configuration file, it is automatically removed before the fax is placed in the queue. This means that it is possible to always give the area code, e.g. in the telephone book, without any problems arising during transmission.

4.8 The script faxadm

Faxadm is another script that gives a simple menu for the user's fax handling. This program is an example of how, with simple aids, you can create a more easy to use user interface for your fax users. You are welcome to look in both xfax and faxadm scripts to get your own ideas on how the tools in XFAX can be used.

4.9 Document codes

In order to facilitate transmission from an environment where it is not possible to give a fax number in a simple way, the faxsend command can handle codes that the user places in the document. During conversion faxsend searches for these codes and makes use of the information. The actual code is naturally removed and is not included in the finished fax.

The code is given in the document within square brackets (if it is not defined with the aid of the keywords CODE_START and CODE_END), e.g. [[FAX=123456]].

Note. If an area code given in the telephone number corresponds with that which is defined by LOCAL_PREFIX in the configuration file, it is automatically removed before the fax is placed in the queue. This means that it is possible to always give the area code, e.g. in the telephone book, without any problems arising during transmission.

Thus it is only necessary to give:

# cat newsletter | faxsend -

It must be borne in mind that the text that contains the document codes must come up as ASCII text, even when printing out. If, for example, a font in Windows is used which is not in the printer, screen data will be generated for the text from the font descriptions in Windows. An XFAX cannot interpret this. The typefaces which can be used are those which are included in a Microsoft Z1A font cassette and they are indicated in font lists in Windows with a small printer.

The following codes are available:

Gives the recipient's fax number. Several fax numbers can be given after one another and should then be separated with semi-colons ";" or colons ":".
Indicates that the symbol set, id, should be used. For lists of permitted values see the Appendix: Commands - faxsend.
Indicates that the character set, id, should be used. For lists of permitted values see Appendix: Command reference - faxsend.
Indicates at what time the transmission of the fax should start.

4.10 The telephone cost file ETCDIR/cost

In order to be able to calculate the approximate costs for the fax transmissions that are made in the system, it is possible to include the actual telephone tariffs in the file ETCDIR/cost. A number of keywords are used in the file as follows:

Indicates that debiting is done per minute and not using marks and mark intervals. This is Telia's new way of debiting in Sweden.
The cost of one mark is given in kronor (Swedish Crowns). Not used today in Sweden. Bear in mind VAT costs.
Gives the minimum debiting. In Sweden 0.29 kronor including VAT (November 1995).
Gives the zone that should be used when the area code is not included in the telephone number, i.e. with local calls. E.g.:
Here one area code is given per line and to which zone the area code belongs. E.g.

031 AREA 3
0091 USA

The codes above (AREA 3 etc.) are arbitrary and can be changed, see also below under ZONES.

It is worth noting that the system goes through all area codes each time and if several lines match the area code in question, the last found always applies. The above means that it is possible to use ABROAD as a standard cost for foreign calls (which of course begin with 009) while for certain countries to which you often ring the cost can be specified exactly, as for USA in the example above. If the line with 009 ABROAD had not been there with the above, a number which began with e.g. 00949 (Germany) would not have been able to be matched against any line in the table and consequently would have been considered as a local call.

ZONES time 1 [time 2 [...]] <...>

Here the tariff zones that are to be found are given plus the cost per minute or the interval between marks at different times of the day. E.g.:

ZONES 0 8 18<
LOCAL   0.29  0.58  0.29
REGION  0.36  0.71  0.36

The above means that with e.g. local calls made between 0.00 and 8.00 the price is 29 öre per minute. Note that the names above, LOCAL and AREA 3, are arbitrary and can be chosen according to opinion and taste. However, the same name must of course be used in the AREA_CODES section so that the right area code can be paired with the right cost.

Table of ContentsPreviousNextIndex