Introduction

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

In general, any file format conversion should 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 the purposes of these examples, it is assumed that the system has been set up using DNIS to select a USR/MBX pair of command files, 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 postrec 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 DEMOIMG\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

$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" "image/tiff; 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 DEMOIMG\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 DEMOIMG\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

$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 x = 1

  $repeat

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

    $email_alttext " "

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

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

    $email_alttext " "

    $set_var x +1

  $until @x > @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.