Please enable JavaScript to view this site.

CopiaFacts™ Reference Manual

Introduction

Copia provides a pre-built Template DLL named CF8GWXLS.DLL for use with the SMTP gateway. This can be used to validate incoming e-mail senders using the contents of a customer-supplied XLS or XLSX file.  When this DLL is used, no sender templates are required.

Configuration

The TEMPLATE_DLL_PATH and optionally TEMPLATE_DLL_BUFFER_SIZE variables must be defined in FAXFACTS.CFG as specified for any Gateway Custom Template DLL. The buffer size required will depend on the number of columns used in your XLSX file and on the  sizes of the values they contain.

In addition, the variable GW_XLS_PATH must be defined in FAXFACTS.CFG to specify the name of the XSLX file to be used. This file will be automatically reloaded if its timestamp changes. For example:

$var_def GW_XLS_PATH "@FFBASE\MY_GW_EXCEL.XLSX"

See also the complete example below.

Method of Operation

See the parent topic Gateway Custom Template DLL. This DLL creates a 'virtual' sender template file which is used for incoming e-mail for which the sender is matched in the first column of the supplied spreadsheet. No sender template files are needed when this DLL is used.

Spreadsheet Content

The Excel Sheet to be used should be the first or only sheet in the file.

The first row of the spreadsheet must contain column headings.  The heading for column A must be SENDEREMAIL and the heading for column B must be RECIPDOMAIN. The remaining column headings will contain the names of variables you wish to set on $var_def commands in the virtual sender template file, for example OB_ANI. No more columns in the file are used after detecting an empty or blank cell in the headings row. If a header cell variable-name contains embedded blank space, double=quotes will be added unless it is already double-quoted.

Instead of a variable name in the first row you may specify a valid FS command name. Each value from later rows will be used as the parameters following the command name, in the virtual template file. The command will not be added for the row if the row cell value is empty.

The remaining rows in the sheet are used to supply the details for each allowed sender.

If the first detail row in the spreadsheet contains the keyword COMMON in the first cell, the values on this row will be used in place of any empty cell in subsequent detail rows.

The timestamp of the provided Excel file is checked every minute, and the file is reloaded if it changes. Failure to load or reload will result in a GWLOADFAIL notification, if enabled in GWMANAGER and EMSETUP.

Column Definitions

A row must be supplied for each sender e-mail address that is to be accepted for processing.

Do not use tab characters in any of the cells on the row.

The spreadsheet columns as used as follows:

AThis column must contain the e-mail address of the sender to be matched. If the incoming e-mail address is not matched in the table, the e-mail will be rejected.  The e-mail address should be in the format mailbox@domain without angle-brackets or quoted names.
BIf non-empty, the cell should contain the name of the recipient domain which the sender must use. Multiple domain names may be entered, separated by vertical bar characters (|), but there is no need to enter all of the configured domains, because an empty cell will have the same effect.
Entries in this column are therefore only needed if the Gateway is configured to receive mail for more than one domain, but the column must be present even if only one recipient domain is present. The incoming e-mail will be rejected if its destination domain fails to match.
C - ...Entries in these columns are the values to be used on the commands or variable definitions in the column header.
If the header cell value starts with $ it is assumed to be a command and the cell contents will be appended to it, preceded by a space character and with any leading or trailing spaces removed. If the command takes multiple parameters, separate them with a space character, and use double-quotes round parameters containing embedded space characters. If the cell on the row is empty, no instance of the command is added to the virtual template file.
If the header cell does not start with a $ it is assumed to be a variable name, and the cell contents will be added as the value of the variable. In all the cells of the column in this case, double-quotes are optional. Double-quotes will be added automatically if an embedded space appears in the cell value and it is not already double-quoted.

You should be aware that incorrect syntax in the spreadsheet may cause the FS file generated from the template to fail with a syntax error.

Example

When creating your Spreadsheet file from existing templates, look in specific FST files under GWTEMPLATES to find what commands and variables are in use.  For a new system using templates, the User Template.FST file in GWTEMPLATES provides a model, but much of this can be discarded depending on the Gateway features you will be using.

In FAXFACTS.CFG:

$var_def TEMPLATE_DLL_PATH "@PFC\CF8GWXLS.dll"

$var_def TEMPLATE_DLL_BUFFER_SIZE 3000

$var_def GW_XLS_PATH "@FFBASE\GWTEMPLATES\VTEMPLATES.XLSX"

In VTEMPLATES.XLSX: