Examples - SMTP Rules
Here, the delivery service attempts to resend the undelivered e-mail three times at hourly intervals. If it is unsuccessful, it sends an e-mail notification using the default fail mail behavior.
<defaultSmtpBehaviour> <smtpBehaviour name="default"> <keepMail>false</keepMail> <resends number="3" delaySeconds="3600" /> <failMail /> </smtpBehaviour> </defaultSmtpBehaviour>
The second example shows how to set up a rule for a transport error. Here, the delivery service resends the e-mail indefinitely, at 30 second intervals, until it is successful.
<smtpRule> <smtpError> <transport>true</transport> </smtpError> <smtpBehaviour name="transport"> <keepMail>false</keepMail> <resends number="-1" delaySeconds="30" /> </smtpBehaviour> </smtpRule>
The third example shows how to set up a rule for a recipient error. Here, the e-mail notification is sent to the agent owner using the e-mail address stored in their user ID. The original e-mail recipients are removed from the recipient list.
<smtpRule> <smtpError> <invalidRecipients>true</invalidRecipients> </smtpError> <smtpBehaviour name="invalidRecips"> <keepMail>false</keepMail> <failMail> <recipients sendToCurrentRecipients="false"> <owner>true</owner> </recipients> </failMail> </smtpBehaviour> </smtpRule>
The fourth example shows how to set up a rule for a specified error code. Here, the undelivered e-mail is sent to the backup queue whenever error 550 occurs. It remains there until you process it manually. A customized e-mail subject is set up for the fail mail notification.
<smtpRule> <smtpError> <errorCode>550</errorCode> </smtpError> <smtpBehaviour name="specialErrorCode-550"> <keepMail>true</keepMail> <failMail> <subject>Error code 550 keep mail</subject> </failMail> </smtpBehaviour> </smtpRule>