aghstrategies / com.aghstrategies.airmail

Unified CiviCRM bounce event handler for SMTP services
Other
8 stars 13 forks source link

Receiving a "Dropped" event from SendGrid doesn't place an email on hold #22

Closed MegaphoneJon closed 1 year ago

MegaphoneJon commented 2 years ago

Airmail treats a "Dropped" event from SendGrid as identical to a bounce. However, CiviCRM determines the bounce type based on a regex that analyzes the bounce_reason. If it doesn't match any regex, the bounce reason defaults to "Syntax" - and you need 3 bounces of type "Syntax" to be placed on hold.

However, if SendGrid is dropping your email, it will never be delivered, so the bounce reason should be "Invalid" or "Spam", depending on the reason it was dropped.

This adds an installer/upgrader that adds the following patterns to civicrm_mailing_bounce_patterns: 'Dropped: Bounced Address', 'Dropped: Invalid', 'Dropped: Spam Reporting Address'.

It's a very small change, it looks big because I ran civix generate:upgrader.

agh1 commented 1 year ago

This makes perfect sense. Merging now to do some testing alongside other changes