DFsendfax — Fax or email a plain text, PDF, or TIFF file to one or more recipients
DFsendfax
[-2]
[-A4]
[-F from]
[-w #]
[-r #]
[-d #]
[
[-p password]
| [-P]
]
[-c string]
[-sANY string]
[-sEACH string]
[-sALL string]
[-sFIRST string]
[-fANY string]
[-fEACH string]
[-fALL string]
[-fFIRST string]
{file}
{recipients...}
DFsendfax transmits any plain text, PDF, or TIFF file to one or more recipients.
DFsendfax interacts with a DFdiscover outbound daemon. You must have at least one
outbound daemon configured before DFsendfax will work. DFsendfax makes a
temporary copy of the file to be sent.
By default, this is in /usr/tmp, although
it may be your home directory if there is no space available in
/usr/tmp.
The
temporary copy of the file becomes owned by user
datafax.
DFsendfax places its
options into a structure that it then sends to the outbound daemon. Which
outbound daemon is used is determined by the DFdiscover master using a round-robin
scheduling algorithm. The outbound daemon then makes a queue entry for the fax
request in its work directory. It also copies (or remote copies, if necessary)
the temporary file to a data file in its work directory. The outbound daemon
then manages the queue entry until the scheduled time for sending arrives. At
this point, the data file is passed to the system email service, DFprotusfax or HylaFAX,
which attempts delivery of the document. If the transmission is successful,
that status is forwarded to the outbound daemon which then executes zero or more of the success
commands. If the transmission has failed, the outbound
daemon either waits the number of minutes specified by the retry delay if one
or more retries are still possible, or executes one or more of the failure
commands. Finally, if the outbound daemon never receives a reply
regarding the disposition of a fax, the outbound daemon de-queues the fax and
executes the appropriate failure commands.
When specifying success or failure commands to execute at the completion of a fax session, you can reference the values of various arguments that you supplied in your original DFsendfax command. The values that you can reference are:
$FaxID | the faxid# of the outgoing fax |
$DataFile | the name of the file to be sent, <file> argument |
$Requestee | the username of the person executing DFsendfax |
$Callees | the <recipient list> argument |
$Comments | the <comments> argument |
$Number | the fax number (or email address) that the success or fail reply was generated from. This will be one of the fax numbers (or email addresses) from the original <recipients list> ($Callees). |
If your fax is successfully queued, DFsendfax echoes back the name of the file to be sent, the phone number of the recipients, the scheduled fax time, and the faxid of the queue entry. This faxid is unique within the system and can be used to monitor the status of the fax with DFfaxq, or to de-queue the fax with DFfaxrm. You should be aware that depending on how your outbound daemons are configured, it may take several seconds for a fax queued with DFsendfax to be detected so that it appears in the output of DFfaxq.
![]() | DFsendfax and DF_QCfax |
|---|---|
|
The standard DFdiscover report program, DF_QCfax, uses DFsendfax to send
Query Reports to participating sites in a study. If a Query Report is
successfully transmitted, DFqcsent.rpc is executed (via
the |
DFsendfax can schedule a fax for transmission at a specified time, rather than
the default which is immediately. This is specified by the
-w option. The
possible arguments to this option can have the following syntax:
now | today | tomorrow | <time spec> [<offset>]
(1) (2)
|
| |
|
and
|
If the time specified is in the past then this is the
same as specifying now.
|
transmit the fax in fine mode. The default is standard mode. | |||
| transmit the fax using A4 sizing. The default is US letter size. | |||
| identify any files transmitted via email as originating
from sender | |||
| the time that the file should be sent or emailed. The default is now. The specification of the time is similar to that allowed by the UNIX at. | |||
| the number of attempts to refax the file if the first attempt fails. The default is 2. The total number of attempts is the number of retries plus 1. Multiple attempts do not apply to emails as DFdiscover has no way of determining whether or not an email was delivered. | |||
| time, in minutes, between refax attempts. The default is 10 minutes. If the number of retries is 0, this value is ignored. | |||
| encrypt the file to be emailed using the supplied
| |||
| any comment string that you want to attach to the fax command. You can reference this comment field later when executing success or failure commands. | |||
| the file to be sent (required). It can be any text, PostScript®, TIFF, or PDF file. For faxing, DFdiscover uses HylaFAX to convert any non-TIFF file into a TIFF file. For emailing, PostScript® files are converted to PDF first (other formats are sent unchanged), and then sent as a MIME attachment to the specified email address. You must have at least read permission on any file to be sent. | |||
| a white-space delimited list of fax
numbers or email addresses for recipients of the file (required).
For each fax number include all long
distance codes, etc. as required. Be careful not to include white-space
characters inside a fax number as it will be interpreted as multiple fax
numbers. Each email address must be in the format
|
DFsendfax provides commands that can be executed upon successful or unsuccessful completion of the transmission. Completion occurs after the specified number of retries have been attempted, if necessary. The command is executed in a Bourne shell as a background child process of the outbound daemon on the machine that the DFsendfax command was originally specified. There are four levels of commands that can be specified. They can be specified individually or in any combination. It is the user's responsibility to ensure that any concurrency issues that may arise as a result of more than one command executing simultaneously are planned for.
| execute the command specified in
|
| execute the command as soon as the file is successfully sent to all recipients in the recipients list. |
| execute the command each time the file is successfully sent to a recipient. |
| execute the command as soon as the file is successfully sent to the recipient specified first in the recipients list. |
| execute the command when the file cannot be successfully transmitted to a recipient. The command is executed only once, immediately after the first failure. |
| execute the command if the file cannot be sent to any of the recipients in the recipients list; that is, all send attempts to all recipients have failed. |
| execute the command for each recipient that the file cannot be successfully sent to. |
| execute the command if the file cannot be successfully sent to the recipient first specified in the fax list. |
DFsendfax exits with one of the following statuses:
| The command was successful. |
| The requested fax could not be scheduled for sending. |
Example 3.69. Send the file /etc/printcap
to one recipient at 5551212
% DFsendfax /etc/printcap 5551212
Fax /etc/printcap
scheduled for sending to 5551212
at Thu Dec 3 08:45:26 1992
->Faxid is 317
Example 3.70. Schedule a fax for transmission at 11:00pm tonight and send it to two recipients, one via email (with a specific from email address)
% DFsendfax -w 23:00 -F repltyo@company.com /etc/fstab 9876543 mailto:luckyuser@hotmail.com
Fax /etc/fstab
scheduled for sending to 9876543 mailto:luckyuser@hotmail.com
at Thu Dec 3 23:00:00 1992
->Faxid is 318
Example 3.71. Schedule a fax for transmission 30 minutes from now and be informed via email that the fax was either successfully transmitted or failed
The line break is for presentation purposes only.
% DFsendfax -w 'now + 30 minutes' \
-sEACH 'echo $DataFile faxed to $Number | mail $Requestee' \
-fEACH 'echo $DataFile FAILED to $Number | mail $Requestee' \
/etc/magic 1-800-555-1212 9876543