Please enable JavaScript to view this site.

CopiaFacts™ Reference Manual

Introduction

This topic is provided as a starting point for users who need special handling of inbound faxes, and it assumes that the Accept Fax option has been selected in CFHWL for the receiving channel. The examples below show some if the techniques which can be used in post-receive processing.
We recommend that the Receive Fax option is used instread, with the Copia-provided standard post-receive scripts. These allow the usual post-processing tasks to be selected by editing a variable listing the task names, and then by setting a few parameters for each of the tasks. If you are using the standard scripts, with Receive Fax, the remainder of this topic is not relevant.

CopiaFacts can forward received faxes by e-mail, by using a 'post-receive' process to generate an e-mail FS file. The fax channels and the e-mail channels can be on the same node or on different nodes.

In addition to the use of custom Post-Receive processes based on the examples below, you can also create a program to scan for MCF files in the folder specified for accepted faxes. The MCF file will be written either after a received TIF has been saved or after reception has failed. Your program should move or delete the MCF after processing.

In general, any file format conversion must be done as an e-mail pre-process rather than as a fax post-receive process. This is because in high-volume systems it is important to get the fax channel freed-up as soon as possible, in case it is needed to handle another incoming call.

This section shows examples of the received fax being included with the e-mail in three different formats: as a TIFF file attachment, as a PDF file attachment, and embedded in the e-mail in GIF format.

If you need to send an incoming fax to multiple recipients, you will need multiple chained infoboxes, each causing one FS file to be created.

Preparation

For Accept Fax, it is normal for the $default_profile for the channel to be used, which defaults to FAX.USR. This specifies image locations for finding IIF files as the SCRIPTS and DEMOIMG folders in FAXFACTS. For the mailbox file, 00000000.MBX will be used, if you have supplied one; if not, this file will be created with default settings to save the incoming MCF and TIF files, and a specification of POSTREC1.IIF as the post-receive process.

If you also create USR files in the USERPROF folder with numeric filenames which match the incoming DNIS value, these files will be used as the user profile for incoming faxes and it is then assumed that the USR file defines a variable USERINFO_EMAIL containing the address to which the e-mail is to be sent, and that the MBX file specifies a $post_receive process of type infobox. The MBX command should be:

$post_receive POSTRECx infobox

In addition, a $script_locn command in the USR file should specify the folder name for the POSTREC.IIF file.

Fax attached as TIF

This example is supplied as SCRIPTS\POSTREC1.IIF. The infobox contains the following:

; POSTREC1.IIF

 

$type FSFILE

$next_box        s:IIF_PROC_COMPLETE ; (state 191) required command

 

; the following are FS file commands, now in the IIF

 

$fax_user        "@@FFUSER\email.usr"  ; general-purpose e-mail USR

$email_address   `EMAIL_NOTIFY         ; or replace with specific address

 

$email_subject   "Fax received from `PR_FAXCSID"

$email_text      "This fax was received on `DATE6 at `TIME2"

$email_attach    "`PR_FAXPATH" "image/tif; name=""`PR_FAXFILE"""

The recipient will see the attachment with a unique numeric filename (with extension .TIF) derived from the name of the MCF file created when the fax was received.

Fax attached as PDF

This example is supplied as SCRIPTS\POSTREC2.IIF. The infobox contains the following:

; POSTREC2.IIF

 

$type FSFILE

$next_box        s:IIF_PROC_COMPLETE ; (state 191) required command

 

; the following are FS file commands, now in the IIF

 

$fax_user        @@FFUSER\email.usr

$email_esender   copiafacts@copia.com

$email_address   `USERINFO_EMAIL (from USR file)

$email_subject   "Fax received from `PR_FAXCSID"

$email_text      "This document was received on `DATE6 at `TIME2"

$email_attach    "`PR_FAXPATH" "application/Pdf; name=""`PR_FAXPDF"""

 

The recipient will see the attachment with a unique numeric filename (with extension .PDF) derived from the name of the MCF file created when the fax was received.

Fax embedded in MHTML e-mail

This example is supplied as SCRIPTS\POSTREC3.IIF. It is complicated by the fact that converting a multi-page document to GIF format results in multiple separate .GIF files, one for each page. The $email_attach command automatically creates a separate attachment specification for each page, but the pages must also be referenced in the HTML body text at the point where each image is to be included.

In the example, commands to be executed, and variables to be expanded, when the FS file is processed (at e-mail send time) and not when the infobox is processed (at fax post-receive time) should have doubled special characters $$, @@ or ``. Without the doubling of these characters, the processing is done at post-receive time.

The value of variable EMBED_COUNT is determined when the $email_attach command is processed, so it should not be used until after this command has appeared in the FS file.

The infobox contains the following:

; POSTREC3.IIF

 

$type FSFILE

$next_box        s:IIF_PROC_COMPLETE ; (state 191) required command

 

; the following are FS file commands, now in the IIF

 

$fax_user        @@FFUSER\email.usr

$email_esender   copiafacts@copia.com

$email_address   `USERINFO_EMAIL (from USR file)

$email_text      "This document was received on `DATE6 at `TIME2"

$email_attach    "`PR_FAXPATH" "EMBEDDED:image/gif"

$email_subject   "``EMBED_COUNT-page fax received from `PR_FAXCSID"

 

$email_text      "The fax received is attached as a series of GIF images"

$email_text      "(This text is displayed only to non-MIME-compliant mailers)"

 

$email_alttext   "<HTML>"

$email_alttext   "<HEAD><TITLE>Fax forwarded by E-Mail</TITLE>"

$email_alttext   "</HEAD>"

$email_alttext   "<BODY>"

 

$if              @PR_FAXPAGES > 0

  $set_var count = 1

  $repeat

    $email_alttext "<H1>Fax page number `count:</H1>"

    $email_alttext " "

    $email_alttext "<IMG SRC=""cid:image`count.``EM_MSGID"" HEIGHT=1145 WIDTH=864"

    $email_alttext "ALT=""Page `count"">"

    $email_alttext " "

  $until         @count >= @PR_FAXPAGES

$endif

$email_alttext   "</BODY></HTML>"

 

A recipient with a MIME-compliant, MHTML-capable mail client will see the fax embedded in the email rather than as an attachment which needs to be clicked on to open. Other mail readers will see a series of GIF attachments, one for each page.

Note that in the above example, the $repeat block is executed at post-receive time, generating an FS file with exactly the right number of image references to match the number of attachments. The count variable is also expanded at post-receive time, to control the repeats. However the EMBED_COUNT and EM_MSGID variables will be empty in the post-receive infobox and must not be expanded until the e-mail FS file is processed.

The use of a normal plain-text body and a separate alternate body with the HTML mail is recommended. There are known to be e-mail scanning services which reject any mail which does not have a plain-text section, because this is a characteristic of much junk mail.