The sender templates validation option allows the use of fax broadcast type templates to both validate senders and to provide additional fax customization or alternative processing of the email message based upon sender and domain. When this option is selected, the gateway parses the sender's email address into the sender's mailbox name and domain. It then checks for the presence of a folder corresponding to the sender's domain and a template file corresponding to the sender's mailbox. The domain folder must be located in the folder specified in the Sender/Recipients Templates section at the bottom of the validation section tab. If the domain folder is not found, the email is rejected and the sender receives an SMTP 500 error message. If the domain folder is present, then the gateway searches it for the presence of a template file for the sender. The template file has the same file extension (.FST) as the fax broadcast templates and may contain any valid FS (fax send) file commands. If no template file is found for this sender, the gateway checks the domain folder for a file named DEFAULT.FST, which is the default sender template for the domain. This template is optional and allows email to be received from any senders from the specified domain. The default template will then be used to provide additional FS file commands for these senders. If there is no default sender template and no matching sender template, the email will be rejected with an SMTP 500 error message.

You may also use sender templates without validating senders. The gateway will always use a sender template to provide additional customization capabilities for individual senders if a matching or default sender template is found. You may also specify a global default sender template to be used when no matching sender template or default template for the sender domain is found. Generally you would not use a default global sender template unless you wished to perform custom processing for email sent to the gateway that could not be validated against existing senders. You could provide a custom script for unrecognized senders that forwards email from these senders to an administrator for evaluation and further action. You also have the ability to restrict individual senders from using the gateway to send fax messages.

Some earlier releases of the gateway required a global default sender when sender validation was required in order to handle special email such as remove requests that could be sent from anyone. Now, anyone may send email to special mailboxes unless the mailbox is specifically restricted to valid senders. Email addressed to these special recipient mailboxes no longer uses global notification options either.

The global default sender template is named SENDER.FST and should be located in a folder named DEFAULT located in the sender/recipients template folder along with the other domain folders. You should be extremely cautious about providing such capability when your gateway is open to the Internet to avoid spam. We recommend using the option flags to restrict fax operations for the global default sender or using the worker box option to completely control the processing of email messages allowed under the global default sender.

Sender templates may be maintained within the gateway manager application (see Working with Templates) or separately using COPIAEDIT and/or Windows utilities such as Notepad or Wordpad. We recommend not using Notepad or Wordpad if you have select a Unicode encoding for FS and FST files.  The templates are plain text files containing valid FS file commands. COPIAEDIT allows you to edit any CopiaFacts configuration or command file and provides a hot link to the appropriate topic in this file for help with the commands.

The Template DLL

To avoid the need to maintain a large number of sender templates, larger users may write a DLL to give full dynamic control over the template without the need for separate files.  This DLL can use whatever sources are convenient to validate senders.  The DLL path name must be supplied as the value of a FAXFACTS.CFG variable TEMPLATE_DLL_PATH, and you may also specify, as TEMPLATE_DLL_BUFFER_SIZE (default 2048 Unicode characters), the maximum size of the template text you will return from the DLL.

The DLL is passed the recipient domain, the sender From: address, and the sender IP.  It can return -1 to reject the message, 1 to accept the message and use the passed template text instead of looking for a sender template file, or zero to accept the message if it there is a normal sender template for it.

Custom Template DLL Specification

The next topic describes the use of Recipient Templates.