Remove extraneous content from incoming emails

:bookmark: This guide explains how to remove extraneous content, such as signatures, from incoming emails in Discourse.

:person_raising_hand: Required user level: Administrator

Discourse has a built-in system for handling incoming emails, which includes automatic trimming of signatures and other extra content. This guide will explain how to control this feature and view the original email content.

Controlling email content trimming

By default, Discourse automatically trims signatures and other “extra” content from incoming emails. This detection system converts emails to markdown content that Discourse uses for posts. However, some site administrators may prefer to keep this type of content for various reasons.

To enable or disable this feature:

  1. Go to your site’s admin panel
  2. Search for trim incoming emails in the site settings
  3. Toggle the setting on or off as desired

If you disable this setting, Discourse will no longer automatically trim email signatures or filter out additional email content beyond the main body of incoming emails.

Always showing trimmed content

A related setting, always show trimmed content, controls whether trimmed content is appended to the post inside a collapsible section (a <details> block with a “···” toggle). When enabled, the trimmed portion will be visible to readers who expand it.

Note: for private messages, trimmed content is always appended regardless of this setting.

Viewing original email content

Staff members (administrators and moderators by default) can view the original, untrimmed content of an email by following these steps:

  1. Find the post created from an email
  2. Look for the :email: icon in the upper right corner of the post
  3. Click on the :email: icon

The view raw email allowed groups site setting controls which groups can access this feature. By default, it is set to admins and moderators.

After clicking the :email: icon, you’ll see three tabs displaying different versions of the incoming email:

  1. Raw: Shows the raw email content

  2. Text: Displays the plain text version of the email

  3. HTML: Shows the HTML version of the email

These views allow administrators to see the full original email, including any content that may have been trimmed in the final post.

When to use this feature

You might want to disable email trimming if:

  • Your users frequently send important information in their email signatures
  • You need to preserve the full email content for legal or documentation purposes
  • Your community relies on information typically included in email footers

However, keep in mind that leaving this feature enabled can help keep posts cleaner and more focused on the main content of the emails.

Last edited by @hugh 2024-07-30T03:26:33Z

Last checked by @hugh 2024-07-30T03:26:37Z

Check documentPerform check on document:
7 Likes