**Mandrill, Postmark:** Normalize soft-bounce webhook

events to event_type 'bounced' (rather than 'deferred').

Fixes #56
This commit is contained in:
medmunds
2017-03-16 15:30:44 -07:00
parent 68c7f6ccf3
commit 23bbc3284f
2 changed files with 4 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ class MandrillTrackingWebhookView(MandrillBaseWebhookView):
'send': EventType.SENT, 'send': EventType.SENT,
'deferral': EventType.DEFERRED, 'deferral': EventType.DEFERRED,
'hard_bounce': EventType.BOUNCED, 'hard_bounce': EventType.BOUNCED,
'soft_bounce': EventType.DEFERRED, 'soft_bounce': EventType.BOUNCED,
'open': EventType.OPENED, 'open': EventType.OPENED,
'click': EventType.CLICKED, 'click': EventType.CLICKED,
'spam': EventType.COMPLAINED, 'spam': EventType.COMPLAINED,

View File

@@ -36,7 +36,7 @@ class PostmarkTrackingWebhookView(PostmarkBaseWebhookView):
'SpamNotification': (EventType.COMPLAINED, RejectReason.SPAM), 'SpamNotification': (EventType.COMPLAINED, RejectReason.SPAM),
'OpenRelayTest': (EventType.DEFERRED, None), # Receiving MTA is testing Postmark 'OpenRelayTest': (EventType.DEFERRED, None), # Receiving MTA is testing Postmark
'Unknown': (EventType.UNKNOWN, None), 'Unknown': (EventType.UNKNOWN, None),
'SoftBounce': (EventType.DEFERRED, RejectReason.BOUNCED), # until HardBounce later 'SoftBounce': (EventType.BOUNCED, RejectReason.BOUNCED), # might also receive HardBounce later
'VirusNotification': (EventType.BOUNCED, RejectReason.OTHER), 'VirusNotification': (EventType.BOUNCED, RejectReason.OTHER),
'ChallengeVerification': (EventType.AUTORESPONDED, None), 'ChallengeVerification': (EventType.AUTORESPONDED, None),
'BadEmailAddress': (EventType.REJECTED, RejectReason.INVALID), 'BadEmailAddress': (EventType.REJECTED, RejectReason.INVALID),
@@ -48,8 +48,8 @@ class PostmarkTrackingWebhookView(PostmarkBaseWebhookView):
'InboundError': (EventType.INBOUND_FAILED, None), 'InboundError': (EventType.INBOUND_FAILED, None),
'DMARCPolicy': (EventType.REJECTED, RejectReason.BLOCKED), 'DMARCPolicy': (EventType.REJECTED, RejectReason.BLOCKED),
'TemplateRenderingFailed': (EventType.FAILED, None), 'TemplateRenderingFailed': (EventType.FAILED, None),
# Postmark does not report DELIVERED # DELIVERED doesn't have a Type field; detected separately below
# Postmark does not report CLICKED (because it doesn't implement click-tracking) # CLICKED doesn't have a Postmark webhook (yet?)
# OPENED doesn't have a Type field; detected separately below # OPENED doesn't have a Type field; detected separately below
# INBOUND doesn't have a Type field; should come in through different webhook # INBOUND doesn't have a Type field; should come in through different webhook
} }