# Handle\_mail support for Postmark webhook

**URL:** https://meta.discourse.org/t/handle-mail-support-for-postmark-webhook/173316
**Category:** Development
**Created:** [December 15, 2020, 12:25am UTC](https://meta.discourse.org/t/handle-mail-support-for-postmark-webhook/173316 "2020-12-15T00:25:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mcaruanagalizia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcaruanagalizia/32/203310_2.png) [@mcaruanagalizia](https://meta.discourse.org/u/mcaruanagalizia)
#### Post date: [December 15, 2020, 12:25am UTC](https://meta.discourse.org/t/handle-mail-support-for-postmark-webhook/173316/1 "2020-12-15T00:25:03Z")

</div>

First time Discourse user, impressed at how well made but at the same hackable the app is! In order to avoid running a mail server I want to get Postmark working with Discourse. They have a webhook for inbound mail, that sends a JSON payload containing the parsed email. For example, it parses the From field into several attributes, same for the CC field, et c.

Optionally, you can tell Postmark to include the raw email in a `RawEmail` attribute. Unfortunately the name of the attribute cannot be changed to `email`, which is what Discourse’s `handle_mail` endpoint expects.

There are two options I can think of:

1. add a one line bodge to `handle_mail` to rename the `RawEmail` attribute to `email` if present
2. create a new endpoint that will add the ready parsed email to the job queue, then add a new method to the receiver to handle ready-parsed email objects

Any preference for a PR/way forward?

---

<div class="post-metadata">

### Author: ![mcaruanagalizia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcaruanagalizia/32/203310_2.png) [@mcaruanagalizia](https://meta.discourse.org/u/mcaruanagalizia)
#### Post date: [January 8, 2021, 3:37pm UTC](https://meta.discourse.org/t/handle-mail-support-for-postmark-webhook/173316/2 "2021-01-08T15:37:32Z")

</div>

@codinghorror are there any plans to replace existing handlers with Rails 6’s ActionMailbox in Discourse? It has ingresses for different services, including Postmark, built in.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 29, 2021, 4:09am UTC](https://meta.discourse.org/t/handle-mail-support-for-postmark-webhook/173316/3 "2021-01-29T04:09:09Z")

</div>

No there are no current plans to swap in action mailbox, but I would be open to review a PR that swaps it in if you want to do a proof-of-concept.
