Configuring incoming email to create new topics or group messages

:bookmark: This guide explains how to set up incoming emails to create new topics or group messages in Discourse, including configuration of site settings and category or group-specific settings.

:person_raising_hand: Required user level: Administrator

This guide covers:

  • Enabling and configuring incoming emails
  • Choosing between category and group for incoming emails
  • Setting up incoming emails for a group
  • Setting up incoming emails for a category
  • Deciding how forwarded emails are handled

:information_source: If you have already set up reply via email, or you are on a hosting plan that pre-configures your incoming email, you’re now ready to set up Starting a New Topic via Email.

Configuring site settings

To enable incoming emails, you need to configure three main site settings:

  1. email_in: This setting must be enabled for incoming emails to work.
  2. email in allowed groups: Users must belong to this group to send an email to Discourse.
  3. enable_staged_users: This setting allows the creation of staged users for unknown email addresses.

To configure these settings:

  1. Go to your site’s Admin panel
  2. Navigate to Settings
  3. Search for each setting and configure as needed

:information_source: Staged users are special user accounts in Discourse created to support incoming emails from anyone. They have limited functionality:

  • Can’t be mentioned or searched for
  • Don’t receive digests
  • Can only be notified of and reply to topics they started or were invited to
  • Will be promoted to a normal user if they create an account using the same email address

Choosing between categories and groups

Decide whether you want incoming emails to create topics in a category or messages in a group.

Using a group

Benefits of using a group:

  • Useful for setting up a support-like workflow
  • Creates a message sent to all group members
  • Messages appear in /my/messages
  • Anyone can send an email to the group
  • Any group member can read, reply, delete, or archive the message
  • Each group member has their own read tracking state

Using a category

Benefits of using a category:

  • Simulates a mailing list
  • Creates a topic in the specified category
  • Anyone with access to the category can read and reply via web interface or email
  • Respects category security settings
  • Respects the email in allowed groups site setting
  • Allows disabling staged users on a per-category basis

Setting up incoming emails for a group

To configure incoming emails for a group:

  1. Go to the Groups page from the main menu

  2. Click on the group name (or create a new group)

  3. For a new group, find the “Custom incoming email address” field at the bottom of the form

  4. For an existing group, go to the Manage tab, then click Interaction in the left side menu

  5. Enter the email address(es) you want to associate with the group (separate multiple addresses with |)

  6. Click Save to apply the changes

:warning: For Discourse hosted sites, check the “Accept incoming emails sent to:” box and forward your custom email(s) to this address for proper functionality.

Setting up incoming emails for a category

To configure incoming emails for a category:

  1. Go to the category page (e.g., /c/<category_slug>)

  2. Click the Edit button

  3. In the Edit category modal, click the Settings tab

  4. Look for “Accept emails from anonymous users with no accounts” and “Custom incoming email address” fields
    Category email settings

  5. Enable “Accept emails from anonymous users with no accounts” if you want to create staged users for unknown email addresses

  6. Enter the email address(es) you want to associate with the category

  7. Click Save Category to apply the changes

:warning: For Discourse hosted sites, check the “Accept incoming emails sent to:” box and forward your custom email(s) to this address for proper functionality.

Forwarded emails behavior

You can decide how forwarded emails appear in Discourse using the forwarded emails behaviour site setting, which has the following options:

  • hide - a new new topic or PM will be created with the forwarded text included as hidden text that can be expanded to view
  • quote - a new topic or PM will be created with the forwarded text included as quoted text.
  • create replies - a new topic or PM will be created authored by the original sender. Replies will be created authored by participants in the email. If the user accounts do not already exist matching the sender email addresses, they will be created as staged user accounts.

Additional resources

Last edited by @tobiaseigen 2024-10-11T16:50:49Z

Last checked by @hugh 2024-08-06T05:58:13Z

Check documentPerform check on document:
49 Likes

3 posts were split to a new topic: Can’t set email-in for existing group?

A post was split to a new topic: Can ai automatically respond to email

Hello, thanks for this information. It may no longer be accurate.

I use an installation with version 3.2.2, and wish to set a custom email address for my category.

Under “Setting up incoming emails for a category”, there is no “Accept incoming emails sent to:” tick box in the settings.

Also I don’t understand how the custom incoming email address works. Discourse does not control the email server, right? Do I need to do anything with the email server?

1 Like

A few thoughts on the incoming option for redirected emails (because original recepient address is saved instead of changing to redirected address).

Case: I have an Atlassian Confluence account with a linked my personal email lee@dot.com. I wanted to receive emails about any changes to the space and collect them in one place of a forum. So I created a subscription to the whole space. Such auto-generated emails contain the phrase “Stop watching”, which I planned to use as a filter pattern.

In the mailbox settings, I have enabled a redirect rule for emails that include this pattern, as shown in the image below. The email should redirect to bob@ex.com. This email corresponds to a specific forum category. After processing, this email is automatically deleted from my lee@dot.com mailbox, so I don’t have to deal with the flood of emails.

As it turned out, emails directly addressed to bob@ex.com were correctly assigned to the forum category. But the redirected emails for some unknown reason went to the uncategorized section.

Perhaps someone will be looking for a solution to the same problem as mine. So I will describe what the problem was.

When I looked carefully at the log section at /admin/email/received, I found that the TO field of redirected emails contains not the address that I set in the category property, but my personal email. And that is what I should put in the category as the incoming mail address.

Explanation:

  • â„–1 (straight email) goes to correct category
  • â„–2 and â„–3 (redirected emails) go to uncategorized

Thus, the popup hint helped me to understand what address is used in the TO field. Maybe it’s correct here, or maybe it will be fixed in the future, but right now it works like this.