How to configure the EXM dispatch retryer


Description

Message dispatch might be paused in cases where the SMTP connection has been rejected with any SMTP failure, except for ConnectionLost, Timeout, or GreetingError reasons. The following related exceptions can be found in the log records:

smtpSocketConnect:
   socket2Connect:
     connect2:
       ConnectFailReason: Connection rejected
     --connect2
   --socket2Connect
   Failed to connect to SMTP server…
 --smtpSocketConnect
ERROR Message sending error:
System.AggregateException: One or more errors occurred. ---> Sitecore.EDS.Core.Exceptions.TransportException: Internal failure.
   at Sitecore.EDS.Core.Net.Smtp.ChilkatTransportClient.SendAsync(Email message)
   at Sitecore.EDS.Core.Net.Smtp.ChilkatMessageTransport.<RetryOnFault>d__10.MoveNext()
ERROR Exception: Sitecore.Modules.EmailCampaign.Exceptions.EmailCampaignException
Message: Failed to connect to the email server. Please try again later.
Source: Sitecore.EmailCampaign
   at Sitecore.Modules.EmailCampaign.SendingManager..ctor(Boolean checkConnection, MessageItem message, Boolean isService, ILogger logger, ISenderManager senderManager, IDispatchManager dispatchManager)
   at Sitecore.Modules.EmailCampaign.SendingManager..ctor(Boolean checkConnection, MessageItem message, Boolean isService, ILogger logger)
   at Sitecore.Modules.EmailCampaign.Core.Dispatch.SendingHelper.SendStandardMessage(String messageId, RecipientId recipientId, Boolean async, ILogger logger)

To configure the dispatch retryer so that the dispatch is not paused for some specific exceptions, consider the following solution.

Solution

  1. Solution configuration:
    • There are two retryers. The first one is used during initialization dispatch and the second one is used during sending operations.
    • Both of these are managed with the same parameters as the dispatch provider.
    • Every time a retryer is used, an INFO log entry is added in the EXM log file.
    • All exceptions that are caught with the retryer are still written into the log files.
    • If the number of attempts is exceeded, the message is paused. That is the default behavior of EXM.
    • If the message is paused, it is not retried.
  2. To add a retryer, consider one of the following options: