SMTP Rules
For example:
<smtpRule>
<smtpError>
<errorCode>502</errorCode>
</smtpError>
...
<smtpError>
<errorCode>550</errorCode>
</smtpError>
...
</smtpRule>
Note: The priority of rules is determined by the order in which they appear in the XML file.
You can define the following types of SMTP errors:
- transport errors
For example, there is no connection to the mail server, the mail server does not exist or is not configured correctly, or the user has no access to the mail server.
Use <transport>true</transport> to include this type of error in your rules.
- recipient errors
For example, there are invalid recipients, too many recipients, or no recipients.
Use <invalidRecipients>true</invalidRecipients> to include this type of error in your rules.
- other specified errors
Any standard SMTP error code generated by the mail server.
Use <errorCode>nnn</errorCode> to include this type of error in your rules.
The following actions can be performed for each error type, and are defined as behaviors in the XML file:
- resend behavior
Specifies how many times to resend an email (n) and the resend interval in seconds (x).
Use <resends number="n" delaySeconds="x" /> to apply this behavior.
Note: To resend an email indefinitely, use <resends number="-1">.
- keep mail behavior
Specifies whether the delivery service should keep the failed email in a separate queue after it has been resent the required number of times and is unsuccessful. The queue is named SMTPBackupQueue.
Note: No further action is performed on emails in the backup queue. To add emails from SMTPBackupQueue to the regular SMTPQueue, you must change the queue name in the database table and restart the server.
Use <keepMail>true</keepMail> to apply this behavior.
- fail mail behavior
Allows you to customize the email notification that is sent when an email delivery has failed.
Use the <failMail> tag to apply this behavior.
There are two further optional attributes you can use to specify the email notification subject (<subject>) and recipient (<recipients>).
Tip: If you omit these tags, the email notification is sent by default to original recipients list with the subject "Send failed:".
To remove all current recipients, use <recipients sendToCurrentRecipients="false">.
To send an email notification to the agent owner, use <owner>true</owner> and, if required, use <recipient address="name@address.com"> to specify an email address.
- default behavior
Defines the action to perform when no matching rule is found.
Use the <defaultSmtpBehaviour> tag to apply this behavior.