Postmark bounce support?

I’m a big fan of Postmarkapp.com

We use their bounce API to create tickets when emails need attention.

What would it take to expand Discourse’s Bounce Processing to support Postmark?

See:

3 Likes

We only support adding these sorts of things for mail services that have a free tier. Otherwise it doesn’t benefit enough people.

And for our hosted customers, we handle all email, so there’s no reason to do it for our customers.

3 Likes

Also, we haven’t used any “Bounce API” but rather “Bounce Webhooks” which is documented here

5 Likes

Would you consider a PR for postmark bounce webook support now? mailgun, one of the officially supported bounce providers, has now moved away their free tier. I get the impression that free-tiers are generally going away in this industry: Tell HN: Mailgun lowers free-tier API from 10k to 625 emails per month | Hacker News

3 Likes

A PR would certainly be considered. Please communicate early if this providers differs too much from the current supported ones so we can offer feedback on the mergeability of your approach.

6 Likes

I’ve got this that I’m about to submit a PR.

Using the test curl command that they document here on my development instance it looks like it will work.

I included spec tests for both hard and soft bounces.

EDIT: I’ve now done tests triggering from their webhook test interface and it looks like it actually works.

I think this should be OK: https://github.com/discourse/discourse/pull/8919

6 Likes

It’s merged! Thanks!

5 Likes

@wesochuck suggests the following changes to Bounce types (see Bounce API | Postmark Developer Documentation for definitions of bounce types, though I’ve included them below).

To hard_bounces add:

  • BadEmailAddress – “Invalid email address — The address is not a valid email address.”
  • Blocked " ISP block — Blocked from this ISP due to content or blacklisting."

To Soft bounces add:

  • SMTPApiError – " SMTP API error — An error occurred while accepting an email through the SMTP API."
  • DMARCPolicy – “DMARC Policy — Email rejected due DMARC Policy.”

I think that blocked makes sense, but I’m not sure about the rest. Let me know what you think and I’ll make the PR accordingly.

More info — The Postmark PR to handle webhooks doesn’t work

Sorry, but my PR doesn’t work.

First, Postmark throws away the message-id by default.

Second, the MessageID that Postmark includes in the webhook isn’t the Message-ID that is in the message.

From: Sending with SMTP | Postmark Developer Documentation

Is there an easy way to add a X-PM-KeepID: true header in outgoing mail? Could that be added to core?

If that problem gets solved, then I’ll see about whether there is a way to have the actual Message-ID included in the webhook payload and process it accordingly.

4 Likes