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.67k stars 129 forks source link

Postmark: fix silent failures for send-time validation errors #239

Closed medmunds closed 3 years ago

medmunds commented 3 years ago

Postmark uses their ErrorCode 300 to report several different send-time validation errors, some of which identify invalid recipients that need to be handled specially, but many of which are ordinary API errors.

Rework the logic for parsing ErrorCode 300 error messages: Handle only "Invalid 'To'" or "Error parsing 'To'" (or 'Cc' or 'Bcc') as recipient errors. Otherwise raise an API error.

Fixes #238 silent failure when sending with long metadata keys.