mirror of
https://github.com/knadh/listmonk.git
synced 2025-12-06 00:10:03 +01:00
Handle Postmark spam complaints. (#2679)
The code attempts to do this by handling the `SpamComplaint` `Type` however this is sent with a `RecordType` of `SpamComplaint` rather than `Bounce` so is ignored. Accepting this additional `RecordType` solves the issue. This behaviour is described in Postmark's documentation. > Note that that spam complaints, unsubscribes/subscribes, or manual deactivations have their own webhooks and are not trigged via the Bounce webhook. > > https://postmarkapp.com/developer/webhooks/bounce-webhook https://postmarkapp.com/developer/webhooks/spam-complaint-webhook#spam-complaint-webhook-data
This commit is contained in:
@@ -60,8 +60,8 @@ func (p *Postmark) ProcessBounce(b []byte, c echo.Context) ([]models.Bounce, err
|
|||||||
return nil, fmt.Errorf("error unmarshalling postmark notification: %v", err)
|
return nil, fmt.Errorf("error unmarshalling postmark notification: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore non-bounce messages.
|
// Ignore irrelevant messages.
|
||||||
if n.RecordType != "Bounce" {
|
if n.RecordType != "Bounce" && n.RecordType != "SpamComplaint" {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user