mirror of
https://github.com/knadh/listmonk.git
synced 2024-11-10 09:02:36 +08:00
Add check for SES 'invalid domain' transient bounces. Closes #1463.
This commit is contained in:
parent
e2f1313566
commit
4b05ab1920
1 changed files with 10 additions and 1 deletions
|
@ -49,7 +49,10 @@ type sesMail struct {
|
||||||
EventType string `json:"eventType"`
|
EventType string `json:"eventType"`
|
||||||
NotifType string `json:"notificationType"`
|
NotifType string `json:"notificationType"`
|
||||||
Bounce struct {
|
Bounce struct {
|
||||||
BounceType string `json:"bounceType"`
|
BounceType string `json:"bounceType"`
|
||||||
|
BouncedRecipients []struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
} `json:"bouncedRecipients"`
|
||||||
} `json:"bounce"`
|
} `json:"bounce"`
|
||||||
Mail struct {
|
Mail struct {
|
||||||
Timestamp sesTimestamp `json:"timestamp"`
|
Timestamp sesTimestamp `json:"timestamp"`
|
||||||
|
@ -132,6 +135,12 @@ func (s *SES) ProcessBounce(b []byte) (models.Bounce, error) {
|
||||||
if m.Bounce.BounceType == "Permanent" {
|
if m.Bounce.BounceType == "Permanent" {
|
||||||
typ = models.BounceTypeHard
|
typ = models.BounceTypeHard
|
||||||
}
|
}
|
||||||
|
if m.Bounce.BounceType == "Transient" && len(m.Bounce.BouncedRecipients) > 0 {
|
||||||
|
// "Invalid domain" bounce.
|
||||||
|
if m.Bounce.BouncedRecipients[0].Status == "5.4.4" {
|
||||||
|
typ = models.BounceTypeHard
|
||||||
|
}
|
||||||
|
}
|
||||||
if m.NotifType == "Complaint" {
|
if m.NotifType == "Complaint" {
|
||||||
typ = models.BounceTypeComplaint
|
typ = models.BounceTypeComplaint
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue