Hi Dynamicweb,
I have an issue with a custom recipient provider due to this check:
LogEvent(_message, "Verifying Quarantine Period of {0} minutes.", _message.QuarantinePeriod)
Dim now = DateTime.Now
Dim quarantinePeriod = _message.QuarantinePeriod
Dim keys = Recipient.GetRecipientKeysWithLatestSentTimeByMessageId(_message.Id)
If keys.Count > 0 Then
For i = _recipients.Count - 1 To 0 Step -1
Dim r = _recipients(i)
Dim rKey = r.RecipientKey
Dim totalMinutesSinceLast = now.Subtract(keys(rKey)).TotalMinutes
If keys.ContainsKey(rKey) AndAlso totalMinutesSinceLast < quarantinePeriod Then
_recipients.RemoveAt(i)
LogEvent(_message, "Removed recipient '{0}' due to Quarantine Constraint. Last sent time (minutes ago): '{1}', Quarantine Period: '{2}'.", r.RecipientKey, totalMinutesSinceLast, _message.QuarantinePeriod)
End If
Next
End If
Where you on this line: Dim totalMinutesSinceLast = now.Subtract(keys(rKey)).TotalMinutes assumes that the same recipients is available in the recipient list each time and causes this exception:
Message: The given key was not present in the dictionary.
StackTrace: at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Dynamicweb.EmailMessaging.MessagingHandler.SaveRecipients() in E:\Program Files (x86)\Jenkins\jobs\Release DW87\workspace\Dynamicweb\EmailMessaging\MessagingHandler.vb:line 254
at Dynamicweb.EmailMessaging.MessagingHandler.Process() in E:\Program Files (x86)\Jenkins\jobs\Release DW87\workspace\Dynamicweb\EmailMessaging\MessagingHandler.vb:line 104
As I see it you should add this:
If keys.ContainsKey(rKey) Then
Dim totalMinutesSinceLast = now.Subtract(keys(rKey)).TotalMinutes
If keys.ContainsKey(rKey) AndAlso totalMinutesSinceLast < quarantinePeriod Then
_recipients.RemoveAt(i)
LogEvent(_message, "Removed recipient '{0}' due to Quarantine Constraint. Last sent time (minutes ago): '{1}', Quarantine Period: '{2}'.", r.RecipientKey, totalMinutesSinceLast, _message.QuarantinePeriod)
End If
End If
Please make a hotfix this as soon as possible for this to work.
Best regards, Anders