# Understanding email in functionality

**URL:** https://meta.discourse.org/t/understanding-email-in-functionality/74097
**Category:** Support
**Tags:** email
**Created:** [November 15, 2017, 11:27am UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097 "2017-11-15T11:27:42Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Neil\_Brooks2](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@Neil\_Brooks2](https://meta.discourse.org/u/Neil_Brooks2)
#### Post date: [November 15, 2017, 11:27am UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/1 "2017-11-15T11:27:42Z")

</div>

HI,

I notice that its possible to turn on the facility for people to send an email to a specific email address which in turn will post their reply as a new topic or perhaps a response to a topic.

Does this person need to be an existing registered user for this to happen, or can Discourse be set up to allow anonymous posts by email?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 15, 2017, 11:49am UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/2 "2017-11-15T11:49:13Z")

</div>

> [@Neil\_Brooks2](#):
>
> Does this person need to be an existing registered user for this to happen, or can Discourse be set up to allow anonymous posts by email?

There is a site setting “enable staged users”. If it is enabled, “staged” user accounts will be created for that email address. If it is disabled, the email will be bounced.

There’s a brief description of staged users at the top of this topic: [Configuring incoming email to create new topics or group messages](https://meta.discourse.org/t/start-a-new-topic-via-email-e-mail/62977)

---

<div class="post-metadata">

### Author: ![Neil\_Brooks2](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@Neil\_Brooks2](https://meta.discourse.org/u/Neil_Brooks2)
#### Post date: [November 15, 2017, 12:00pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/3 "2017-11-15T12:00:35Z")

</div>

Perfect! Thank you. If we wanted to create a third party form, hosted on potentially another server, allowing anonymous users to fill in said form which in turn would post into Discourse as staged users using their email address in the reply-to header of the email, would this be possible?

Or would the email be treated as SPAM by the Discourse system?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [November 15, 2017, 12:07pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/4 "2017-11-15T12:07:24Z")

</div>

See my post in [Can Email-In be used to "ingest" a mailing list? - #3 by gerhard](https://meta.discourse.org/t/can-email-in-be-used-to-ingest-a-mailing-list/74096/3)

---

<div class="post-metadata">

### Author: ![Neil\_Brooks2](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@Neil\_Brooks2](https://meta.discourse.org/u/Neil_Brooks2)
#### Post date: [November 15, 2017, 12:26pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/5 "2017-11-15T12:26:48Z")

</div>

@gerhard thanks for the post, although from what I understand, this is to suck in some pre-defined mailing lists. Ideally what I want to do is have the same function that’s provided by staged users via email, but through a form thats always open and the end user still gets their topic updates by email.

I hope that makes sense?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [November 15, 2017, 12:51pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/6 "2017-11-15T12:51:09Z")

</div>

Sorry, I got a little bit confused by the other topic 😊

I think if you want to use your own form you’ll either need to use the API or make your form send an email to your Discourse. But you’ll lose a lot of of features that the Discourse UI provides for creating posts.

---

<div class="post-metadata">

### Author: ![Neil\_Brooks2](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@Neil\_Brooks2](https://meta.discourse.org/u/Neil_Brooks2)
#### Post date: [November 15, 2017, 12:55pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/7 "2017-11-15T12:55:43Z")

</div>

Yes, I’m thinking that sending an email from a third party form, using a third party email address is also going to cause issues with email validation and spam filtering too.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 15, 2017, 1:36pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/8 "2017-11-15T13:36:05Z")

</div>

Discourse itself doesn’t include any spam filtering (beyond checking for the auto-generated header), so even if SPF/DKIM records don’t match it should work. If you have spam checks upstream of discourse then you may run into problems.

A “better” solution would definitely be to use the API.

---

<div class="post-metadata">

### Author: ![Neil\_Brooks2](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@Neil\_Brooks2](https://meta.discourse.org/u/Neil_Brooks2)
#### Post date: [November 15, 2017, 2:01pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/9 "2017-11-15T14:01:26Z")

</div>

I agree @david I’ll need to take a look at the API to see what it provides in terms of methods. Thanks for the great advice.

---

<div class="post-metadata">

### Author: ![BrianGillespie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/briangillespie/32/105563_2.png) [@BrianGillespie](https://meta.discourse.org/u/BrianGillespie)
#### Post date: [November 28, 2017, 11:13pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/10 "2017-11-28T23:13:12Z")

</div>

> [@Neil\_Brooks2](#):
>
> post into Discourse as staged users using their email address in the reply-to header of the email

I’ve got exactly the same desire. Some orders from our customers need to be approved before we charge their credit card and process the order. We currently do this by sending emails to our sales team. Sometimes the sales team needs to get in touch with the original user, and wants to reply.

So for us, the original email headers could be:

```plaintext
From: "Web Order Bot" <order-bot@our-domain.com> # (clearly whitelisted)
To: discourse-ingestion@discoursemail.com
Reply-To: "New Customer" <never-been-to-discourse@customer.com>
Subject: Order 192831

```

What I’d love to see is a new Discourse staged user `never-been-to-discourse@customer.com` get created, and the incoming message be _from_ that user. Our team could then reply directly to the customer in Discourse. As it stands, they reply to `order-bot@our-domain.com` which doesn’t work very well.

If we need to use an API to do this, can you point me to the APIs for creating new posts and staged users?

---

<div class="post-metadata">

### Author: ![BrianGillespie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/briangillespie/32/105563_2.png) [@BrianGillespie](https://meta.discourse.org/u/BrianGillespie)
#### Post date: [November 30, 2017, 5:33pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/11 "2017-11-30T17:33:45Z")

</div>

@sam @supermathie is there a way to make the above work?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [November 30, 2017, 5:40pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/12 "2017-11-30T17:40:21Z")

</div>

Using the API rather than email is a good way to do this, you’re right, though I’ll check with one of my team members more familiar with the API to say exactly which calls to make.

Or, you could probably modify the headers to be:

```plaintext
Sender: "Web Order Bot" <order-bot@our-domain.com> # (clearly whitelisted)
To: discourse-ingestion@discoursemail.com
From: "New Customer" <never-been-to-discourse@customer.com>

```

and that should work as you expect (I think, I haven’t actually tested that).

---

<div class="post-metadata">

### Author: ![BrianGillespie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/briangillespie/32/105563_2.png) [@BrianGillespie](https://meta.discourse.org/u/BrianGillespie)
#### Post date: [November 30, 2017, 9:06pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/13 "2017-11-30T21:06:44Z")

</div>

> [@supermathie](#):
>
> Sender: “Web Order Bot” \<order-bot@our-domain.com\> # (clearly whitelisted)  
> To: [discourse-ingestion@discoursemail.com](mailto:discourse-ingestion@discoursemail.com)  
> From: “New Customer” \<never-been-to-discourse@customer.com\>

No Dice. Unfortunately, I can’t send emails using a `From` header to send email outside our domain. And understandably so - that’s a fantastic way to obfuscate email for SPAM purposes.

So, my only options as I see it are for “reply-to” to work, or an API solution.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [December 1, 2017, 1:19pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/14 "2017-12-01T13:19:14Z")

</div>

> [@BrianGillespie](#):
>
> What I’d love to see is a new Discourse staged user `never-been-to-discourse@customer.com` get created, and the incoming message be _from_ that user. Our team could then reply directly to the customer in Discourse. As it stands, they reply to `order-bot@our-domain.com` which doesn’t work very well.

The only supported way right now is to “`enable forwarded emails`” and **forward** an email from `never-been-to-discourse@customer.com`.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [December 1, 2017, 10:42pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/15 "2017-12-01T22:42:54Z")

</div>

> [@BrianGillespie](#):
>
> Unfortunately, I can’t send emails using a From header to send email outside our domain.

That’s too bad - we use exactly this workflow here on meta.

> [@zogstrip](#):
>
> The only supported way right now is to “enable forwarded emails”

I bet if you do that and have your system craft an email from web-order-bot that _looks_ like a forwarded email from the end user, it should work as you expect!

---

<div class="post-metadata">

### Author: ![BrianGillespie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/briangillespie/32/105563_2.png) [@BrianGillespie](https://meta.discourse.org/u/BrianGillespie)
#### Post date: [December 1, 2017, 11:02pm UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/16 "2017-12-01T23:02:22Z")

</div>

> [@supermathie](#):
>
> That’s too bad - we use exactly this workflow here on meta.

Thinking with a little bit clearer head, rather than doing our send via Amazon SES (how we do most of our mail delivery), if I just send to [mx-sjc1.discoursemail.com](http://mx-sjc1.discoursemail.com) directly, I can set the mail headers the way you want them set.

… and it even works!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 31, 2020, 11:15am UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/17 "2020-01-31T11:15:54Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 21, 2023, 4:39am UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/18 "2023-12-21T04:39:28Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 21, 2023, 8:49am UTC](https://meta.discourse.org/t/understanding-email-in-functionality/74097/19 "2023-12-21T08:49:10Z")

</div>


