The Error Handling tab allows you to define custom script processing and/or email notification for errors that result in rejected emails and/or recipient errors.

Error Reporting Options

There are three ways in which errors can be reported:

If the screen above contains an 'email to' address and selected error types, an FS file will be generated to send a normal CopiaFacts e-mail containing an error report.  The success of this notification depends on the CopiaFacts server and/or file server being available and a COPIAFACTS node running to send the e-mail.

E-Mail notification contents:
Message ID: <Message base>
Message Error: <Error message text (error number)>
Message Subject: <Message subject including password>
Message Sender: <Message sender email address>
Message Recipient: <First recipient in message>
Date Received: <Date message received – MM/DD/YYYY>
Time Received: <Time message received – HH:MM:SS>
Sender Template: <Full path name of sender template selected>

If the screen above contains an script name (infobox filename, without the '.IIF') and selected error types, a worker-box FS file will be generated to run your provided script.  The success of this notification depends on the CopiaFacts server and/or file server being available and a COPIAFACTS node running to run the worker-box script.

Worker-box variables:
Variable  -  Value
SMTP_ERROR_NUMBER  the rejection error code:
1 – no fax recipients
2 – unable to get FS number
3 – error writing FS file
8 – invalid or missing sender password
9 – no message sender
10 – invalid message sender
11 – no/invalid recipient list folder
12 – no sender worker box for recipient list
13 – error creating recipient list
14 – error loading sender template
15 – error loading recipient template
16 – invalid or missing recipient password
17 – no worker box for special recipient
18 – invalid sender for special recipient
99 – system or internal error
SMTP_ERROR_MESSAGE text of error message
SMTP_FROM message from (name <email address>)
SMTP_MSGBASE 8-digit base name of message files
SMTP_MSGFOLDER folder where message files written
SMTP_RCV_DATE date message received (MM/DD/YYYY)
SMTP_RCV_TIME time message received (HH:MM:SS)
SMTP_RECIPIENT first recipient email address
SMTP_REPLYTO message reply to list
SMTP_SENT_DATE date message sent (MM/DD/YYYY)
SMTP_SENT_TIME time message sent (HH:MM:SS)
SMTP_SENDER_EMAIL sender email address
SMTP_SENDER_TEMPLATE sender template file

If EMSETUP has been configured on the machine running the CFGATEWAY service, and has suitable triggers defined, an e-mail notification will be sent using EMDIRECT.  The success of this notification depends on the machine being connected to the Internet.  The errors shown in red on the above dialog are those more likely to have been caused by server failure; these may be more reliably notified using triggers than by attempting to write an FS file.

For error notifications which generate an FS file, the additional fields on the lower part of the Errors tab must be completed.  A user profile is required, and if you specify a script name, you must ensure that it has a $script_locn command which allows the script to be found.  The TOSEND queue to be used can be selected separately for e-mail notifications and script generation.  The e-mail subject is set to "CopiaFacts SMTP Gateway Error" if not overridden.

Processing Sequence for Errors

Incoming valid messages are normally renamed to .BAK and left in the folder specified for saved messages along with a .MIF (message information) file.  When errors occur, the files may be moved.  Errors may be detected either during the receipt of the message by the SMTP server, or when the saved messages are processed to create FS files.

If you are using sender templates to validate senders, the SMTP server normally rejects invalid senders before an email is accepted. However, if the email is addressed to a mailbox for which you have created a recipient template, the email is temporarily accepted, saved, and processed by the saved message scanner. If it turns out that the email has no sender either in the message headers or the message envelope after that initial acceptance, the message will be rejected with error number 8 – message has no sender. If it turns out that there was a problem with the recipient template or the recipient template required a valid sender, the message may then be rejected at this point with error number 10 – message sender was invalid.

Messages from valid senders may also be rejected if they have no fax recipients and no recipient has a corresponding recipient template. In that case the message will be rejected with error number 1. A message from a valid sender may also be rejected if the password is missing in the subject line or the subject line does not contain a valid password. These messages may be re-submitted after editing the subject line in the message and adding the correct password.

In summary:

If the message is rejected by the SMTP server, it is placed (either as a MSG file or as a MSG/MIF pair of files) in the folder specified for rejected messages.  No further processing of this message is done, but if you fix a configuration error which caused the rejection, you can manually move the file(s) back to the saved message folder to be reprocessed.

If the message is rejected by the message scanning process, the MSG and MIF files are placed in the folder specified for rejected messages.  It is possible that some message recipients will have been processed even though the message is rejected:

All of the fax recipients in a message are processed before any special recipients.

If an error occurs while processing the fax recipients, the remaining fax recipients and any special recipients in the message are not processed. However, most errors related to fax recipients are caused by problems with the sender template, in which case no fax recipients are processed before the message is rejected.

Special recipients may be skipped without rejecting the message if there are problems with the syntax of the recipient template or the recipient template requires a valid sender and/or password.

Usually a message is addressed to a number of fax recipients or a single special recipient so that no partial processing of a message occurs unless there is an I/O error writing the FS file for a fax recipient in a message that contains multiple fax recipients and where a recipient list is not being created.

When creating a recipient list, errors writing the list file also cause the message to be rejected. Since recipient list creation does not result in individual FS files for each individual, an error creating the list means that the message can be re-processed after the problem is corrected without consideration of any partial message processing that may have been done.

On some internal errors, or if the renaming or moving a message fails, the Gateway attempts to rename the saved message file to .XXX to prevent the file being repeatedly picked up.