anymail / django-anymail

Django email backends and webhooks for Amazon SES, Brevo (Sendinblue), MailerSend, Mailgun, Mailjet, Postmark, Postal, Resend, SendGrid, SparkPost, Unisender Go and more
https://anymail.dev
BSD 3-Clause "New" or "Revised" License
1.65k stars 125 forks source link

Fixed #361: AttributeError in mailgun webhooks #363

Closed izimobil closed 5 months ago

izimobil commented 5 months ago

This fixes the case of delivery-status being None in the event data posted to mailgun webhook handler. See: #361

izimobil commented 5 months ago

Hi, I realize I can reduce the raw_event in the test case to:

raw_event = mailgun_sign_payload(
    {
        "event-data": {
             "event": "accepted",
             "delivery-status": None,
        }
    }
)

Do you want me to update the PR ?

medmunds commented 5 months ago

Thanks for this. Yes, the shorter test case would probably be clearer. (Mailgun was one of Anymail's first integrations, so the existing tests tend to be more verbose than necessary.)

"delivery-status": null doesn't show up in Mailgun's event documentation. I wonder if there are any other undocumented changes to their webhook payloads?

izimobil commented 5 months ago

Thanks for this. Yes, the shorter test case would probably be clearer. (Mailgun was one of Anymail's first integrations, so the existing tests tend to be more verbose than necessary.)

OK !

"delivery-status": null doesn't show up in Mailgun's event documentation. I wonder if there are any other undocumented changes to their webhook payloads?

Well, to be honest, I don't know, we have a multi-tenant app, and the error showed up on a single tenant, probably a tenant with some weird MTA ?! I'll report the issue to mailgun ! Cheers

medmunds commented 5 months ago

(Released in Anymail 10.3)