Skip to content

Commit ea2cf5b

Browse files
authored
chore: Update guides on email channel configuration in self-hosted Chatwoot (#557)
* chore: Update guides on email channels in self-hosted Chatwoot * fix broken link
1 parent 0532265 commit ea2cf5b

File tree

9 files changed

+424
-147
lines changed

9 files changed

+424
-147
lines changed

docs.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@
115115
{
116116
"group": "Email Channel",
117117
"pages": [
118+
"self-hosted/configuration/features/email-channel/introduction",
119+
"self-hosted/configuration/features/email-channel/google-workspace-setup",
120+
"self-hosted/configuration/features/email-channel/azure-app-setup",
121+
"self-hosted/configuration/features/email-channel/forwarding-emails-to-chatwoot",
122+
"self-hosted/configuration/features/email-channel/ingress-providers",
118123
"self-hosted/configuration/features/email-channel/conversation-continuity",
119124
"self-hosted/configuration/features/email-channel/conversation-continuity-using-sendgrid",
120-
"self-hosted/configuration/features/email-channel/amazon-ses-ingress",
121-
"self-hosted/configuration/features/email-channel/setup",
122-
"self-hosted/configuration/features/email-channel/azure-app-setup",
123-
"self-hosted/configuration/features/email-channel/google-workspace-setup"
125+
"self-hosted/configuration/features/email-channel/amazon-ses-ingress"
124126
]
125127
},
126128
{

self-hosted/configuration/features/email-channel/amazon-ses-ingress.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Configuring Amazon SES as an Ingress Provider for Chatwoot
33
description: Guide to setting up conversation continuity, inbound emails with Amazon SES
4-
sidebarTitle: SES Ingress
4+
sidebarTitle: Amazon SES Ingress
55
---
66

77
This guide explains how to set up Amazon SES as the incoming email (ingress) provider for your self-hosted Chatwoot installation. If you plan to use Chatwoot’s email forwarding option and want SES to handle inbound mail delivery into Chatwoot, this documentation is for you.

self-hosted/configuration/features/email-channel/azure-app-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ To test the changes before the app is verified for production, use the Entra ID
9090

9191
Publisher verification provides app users and organization admins with information about the authenticity of the developer's organization that publishes an app integrating with the Microsoft identity platform. If an app has a verified publisher, it means that Microsoft has verified the authenticity of the organization that publishes the app.
9292

93-
Read the publishing guidelines [here](https://learn.microsoft.com/en-us/entra/identity-platform/howto-convert-app-to-be-multi-tenant).
93+
Read the publishing guidelines [here](https://learn.microsoft.com/en-us/entra/identity-platform/howto-convert-app-to-be-multi-tenant).

self-hosted/configuration/features/email-channel/conversation-continuity-using-sendgrid.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: SendGrid Guide
33
description: Guide to setting up Conversation Continuity with SendGrid
4-
sidebarTitle: SendGrid Guide
4+
sidebarTitle: SendGrid Ingress
55
---
66

77
This doc will help you set up [Conversation continuity](https://www.chatwoot.com/docs/self-hosted/configuration/features/email-channel/conversation-continuity) with SendGrid.
@@ -80,4 +80,4 @@ You should change ``support.example.com`` to the domain you used with SendGrid.
8080

8181
## Next steps
8282

83-
You're done! Next, you should [enable the email channel](https://www.chatwoot.com/docs/self-hosted/configuration/features/email-channel/setup).
83+
You're done! Next, you should [enable the email channel](https://www.chatwoot.com/docs/self-hosted/configuration/features/email-channel/setup).
Lines changed: 30 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,53 @@
11
---
22
title: Conversation Continuity
3-
description: Configure Conversation Continuity with Email
3+
description: Continue conversations between website live chat and email
44
sidebarTitle: Conversation Continuity
55
---
66

7-
## Conversation continuity
7+
When a customer starts a conversation on your website, you don’t want the thread to break just because the user went offline. Chatwoot automatically maintains continuity between the website live chat and email, so the conversation stays in one place for both your agents and your customers.
88

9-
![101382999-9b0abf00-38de-11eb-845d-1bb1f52306df@2x](https://user-images.githubusercontent.com/73185/109548415-a1ca5c00-7af2-11eb-9b1d-fd636cf5189c.png)
10-
11-
## Configuring inbound reply emails
12-
13-
<Note>
14-
Conversation Continuity requires your chatwoot installation to have a [cloud storage configured](/self-hosted/deployment/storage/supported-providers)
15-
</Note>
9+
This guide explains how that flow works and what you should set up to ensure everything stays seamless.
1610

17-
There are a couple of email infrastructure service providers to handle the incoming emails that we support at the moment. They are
18-
Sendgrid, Mandrill, Mailgun, Exim, Postfix, Qmail and Postmark.
11+
### How Conversation Continuity Works
1912

20-
Step 1 : We have to set the inbound email service used as an environment variable.
13+
#### 1. Customer starts a conversation
2114

22-
```bash
23-
# Set this to appropriate ingress service for which the options are :
24-
# "relay" for Exim, Postfix, Qmail
25-
# "mailgun" for Mailgun
26-
# "mandrill" for Mandrill
27-
# "postmark" for Postmark
28-
# "sendgrid" for Sendgrid
29-
RAILS_INBOUND_EMAIL_SERVICE=relay
30-
```
31-
If you wish to use the same local relaying server (for example postfix) to send outbound mail as you are using to relay inbound messages and you opt not to use an external authentication mechanism like SASL which may be the case if the server is handling it own emails only. The upstream SMTP platform Action Mailer attempts to use a default authentication method if the configuration options `SMTP_AUTHENTICATION`, `SMTP_USERNAME` and `SMTP_PASSWORD` are present in your .env file. To disable this behaviour either comment out or delete these lines from your configuration. This will allow you to send outbound messages from the same server without a premium service. Please note many ISP's do not allow email servers to be run from their networks. It is your responsibility to ensure adequate access control preventing yourself becoming an open relay and ensuring your server is able to get past your recipients spam filters for example SPF, DKIM & DMARC dns records.
15+
The customer interacts with your widget and starts a conversation.
16+
If Email Collect is enabled, the widget asks the customer for their email address.
17+
This email becomes the identifier for all future messages.
3218

33-
This configures the ingress service for the app. Now we have to set the password for the ingress service that we use.
19+
#### 2. Customer goes offline, agent replies
3420

35-
```bash
36-
# Use one of the following based on the email ingress service
21+
If the agent replies when the customer is no longer online, Chatwoot delivers the agent’s reply to the customer via email.
22+
This ensures the user doesn’t miss the update.
3723

38-
# Set this if you are using Sendgrid, Exim, Postfix, Qmail or Postmark
39-
RAILS_INBOUND_EMAIL_PASSWORD=
40-
# Set this if you are Mailgun
41-
MAILGUN_INGRESS_SIGNING_KEY=
42-
# Set this if you are Mandrill
43-
MANDRILL_INGRESS_API_KEY=
44-
```
24+
#### 3. Customer replies from their email
4525

46-
### Mailgun
47-
If you are using Mailgun as your email service, in the Mailgun dashboard configure it to forward your inbound emails to `https://example.com/rails/action_mailbox/mailgun/inbound_emails/mime` if `example.com` is where you have hosted the application.
26+
The user sees your message in their inbox and simply replies to that email like any normal thread.
27+
They don’t need to come back to your website manually — replying from email is enough.
4828

49-
#### Getting Mailgun Ingress Key
50-
![mailgun-ingress-key](/self-hosted/images/mailgun-ingress-key.gif)
29+
#### 4. Chatwoot processes the email and links it to the conversation
5130

52-
### Sendgrid
31+
When Chatwoot receives the user’s email:
32+
• It reads the email headers (Message-ID / References / custom thread identifiers)
33+
• It maps the email to the correct conversation thread
34+
• It adds the user’s reply as a new message inside the same live-chat conversation
5335

54-
Ensure to set up the proper MX records for `your-domain.com` pointed towards Sendgrid
36+
To the agent, it looks like the user never left.
37+
To the user, it feels like replying to any normal email thread.
5538

56-
Configure SendGrid Inbound Parse to forward inbound emails to forward your inbound emails to `/rails/action_mailbox/sendgrid/inbound_emails` with the username `actionmailbox` and the password you previously generated. If the deployed application was hosted at `example.com`, you can configure the following URL as the forward route.
39+
### What You Need to Enable
5740

58-
```bash
59-
https://actionmailbox:PASSWORD@example.com/rails/action_mailbox/sendgrid/inbound_emails
60-
```
41+
#### 1. Email Collect Hook
42+
Make sure the widget is configured to collect the user’s email early in the conversation.
43+
This is the key to linking email replies back to the same thread.
6144

62-
When configuring your SendGrid Inbound Parse webhook, be sure to check the box labeled "Post the raw, full MIME message." Action Mailbox needs the raw MIME message to work.
45+
#### 2. Email channel configuration
46+
Make sure email forwarding is enabled as per this guide: [Forwarding Emails to Chatwoot](./forwarding-emails-to-chatwoot).
6347

64-
### Mandrill
65-
If you are configuring Mandrill as your email service, configure Mandrill to route your inbound emails to `https://example.com/rails/action_mailbox/mandrill/inbound_emails` if `example.com` is where you have hosted the application.
48+
#### 3. Mailer configuration
49+
Outbound emails should be properly configured so Chatwoot can notify the customer when the agent replies offline.
6650

67-
If you want to know more about configuring other services visit [Action Mailbox Basics](https://edgeguides.rubyonrails.org/action_mailbox_basics.html#configuration)
68-
69-
### IMAP via getmail
70-
Chatwoot receives inbound emails through the [Action Mailbox](https://edgeguides.rubyonrails.org/action_mailbox_basics.html) feature of Ruby on Rails. Action Mailbox supports various 'ingresses' by default. They are defined in [here](https://github.com/rails/rails/blob/main/actionmailbox/lib/tasks/ingress.rake) and can be executed through `bin/rails`. For example
71-
```bash
72-
cat my_incoming_message | ./bin/rails action_mailbox:ingress:postfix \
73-
RAILS_ENV=production \
74-
URL=http://localhost:3000/rails/action_mailbox/relay/inbound_emails \
75-
INGRESS_PASSWORD=...
76-
```
77-
would import the contents of the file `my_incoming_message` into a Chatwoot instance running on `localhost` - assuming `my_incoming_message` contains an [RFC 822](https://datatracker.ietf.org/doc/html/rfc822) compliant message.
78-
79-
The ingress tasks provided by Action Mailbox are a thin layer around an HTTP endpoint exposed by Action Mailbox. An alternative to using those tasks is to talk to the http endpoint directly. The following script achieves the same.
80-
```bash
81-
INGRESS_PASSWORD=...
82-
URL=http://localhost:3000/rails/action_mailbox/relay/inbound_emails
83-
84-
curl -sS -u "actionmailbox:$INGRESS_PASSWORD" \
85-
-A "Action Mailbox curl relayer" \
86-
-H "Content-Type: message/rfc822" \
87-
--data-binary @- \
88-
$URL
89-
```
90-
91-
The popular mail retrieval system [getmail6](https://github.com/getmail6/getmail6) can be used to fetch mails and import them into Chatwoot. If the curl script above is stored in `/home/chatwoot/bin/import_mail_to_chatwoot`, a configuration for doing so from an IMAP inbox is as follows.
92-
```
93-
[retriever]
94-
type = SimpleIMAPSSLRetriever
95-
server = ...
96-
username = ...
97-
password = ...
98-
99-
[destination]
100-
type = MDA_external
101-
path = /home/chatwoot/bin/import_mail_to_chatwoot
102-
103-
[options]
104-
verbose = 0
105-
read_all = false
106-
delete = false
107-
delivered_to = false
108-
received = false
109-
message_log = /home/chatwoot/logs/import_imap.log
110-
message_log_syslog = false
111-
message_log_verbose = true
112-
```
113-
114-
For mail to be imported you'll need to execute `getmail` regularly, for example using a cron job. For `IMAP` you can also run it constantly using `getmail --idle INBOX`, though that will need some care to deal with interrupted connections, etc.
115-
116-
## Configure inbound email domain environment variable
117-
118-
Add the following environment variable with the value `your-domain.com`, where `your-domain.com` is the domain for which you set up MX records in the previous step.
119-
120-
```bash
121-
MAILER_INBOUND_EMAIL_DOMAIN=
122-
```
51+
<img src="https://user-images.githubusercontent.com/73185/109548415-a1ca5c00-7af2-11eb-9b1d-fd636cf5189c.png" height="300px" />
12352

12453
After finishing the set up, the mail sent from Chatwoot will have a `replyto:` in the following format `reply+<random-hex>@<your-domain.com>` and reply to those would get appended to your conversation.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: Forwarding Emails to Chatwoot
3+
description: Guide to set up email forwarding to Chatwoot
4+
sidebarTitle: Forwarding
5+
---
6+
7+
This guide explains how to set up email forwarding to Chatwoot when you prefer not to configure IMAP. Forwarding allows your email provider to push inbound messages directly to Chatwoot, which then processes them as incoming conversations in your inbox.
8+
9+
10+
<Note>
11+
Forwarding emails to Chatwoot requires a [cloud storage configured](/self-hosted/deployment/storage/supported-providers)
12+
</Note>
13+
14+
## When to Use Forwarding
15+
16+
Forwarding is a good option if:
17+
18+
* You don’t want to use IMAP or your provider does not allow IMAP access.
19+
* You want a simple, push‑based way to deliver inbound emails to Chatwoot.
20+
* Your provider supports routing or forwarding rules (Gmail, Google Workspace, Outlook, Fastmail, Zoho, custom servers, etc.).
21+
* You already use SMTP for outbound mail and just need a lightweight inbound setup.
22+
23+
## How Forwarding Works in Chatwoot
24+
25+
Each email inbox in Chatwoot is assigned an ingress address—a unique, system‑generated email address. When your provider forwards an email to that address, Chatwoot. Note: For installations using an ingress provider (SES, SendGrid, Mailgun, etc.), you must configure an MX record pointing to the ingress provider so that inbound email is accepted and routed correctly.
26+
27+
28+
1. Ingress provider receives the email and forwards it to the configured Chatwoot URL.
29+
2. Chatwoot parses the content, attachments, headers, and thread references.
30+
3. Creates or updates the conversation in the appropriate inbox.
31+
4. Handles message threading properly via `Message-ID`, `References`, and `In-Reply-To`.
32+
33+
Outbound email continues to use your configured SMTP provider.
34+
35+
36+
## Requirements
37+
38+
To use forwarding successfully, ensure:
39+
40+
* **Email ingress is enabled on your Chatwoot installation.** Some self-hosted setups disable ingress by default for security.
41+
* **Your installation supports inbound processing** via the configured mailer/ingress pipeline.
42+
* **The forwarding rule is set to forward *all* relevant mail**, including replies.
43+
* **SPF, DKIM, and DMARC** are correctly configured on your domain for good deliverability.
44+
45+
If ingress is disabled, Chatwoot will show a warning in the UI. Your administrator must enable it before forwarding works.
46+
47+
The receiving domain should be configured in the environment variable `MAILER_INBOUND_EMAIL_DOMAIN`.
48+
49+
```
50+
MAILER_INBOUND_EMAIL_DOMAIN=
51+
```
52+
53+
54+
## Finding the Forwarding Address
55+
56+
In Chatwoot:
57+
58+
1. Go to your inbox settings.
59+
2. Select your email channel settings -> Configuration
60+
3. Copy the provided **Chatwoot ingress email address**.
61+
62+
This address is unique per inbox.
63+
64+
65+
66+
## Configuring Forwarding on Your Email Provider
67+
68+
The setup varies slightly across providers, but the steps are generally:
69+
70+
1. Open your email provider's forwarding or routing settings.
71+
2. Add the Chatwoot ingress email as a forwarding destination.
72+
3. Verify the address if the provider requires confirmation.
73+
4. Set a rule to forward all incoming email (or only relevant messages) to the ingress address.
74+
5. Save the configuration.
75+
76+
## Configuring Ingress Provider
77+
78+
For Chatwoot installations, a dedicated ingress provider (Amazon SES, SendGrid, Mailgun, etc.) is required. The provider acts as the first receiver of your domain’s email and then forwards it to the Chatwoot ingress URL.
79+
80+
See more details [here](./ingress-providers).
81+
82+
## Outbound Email Behavior
83+
84+
Forwarding affects **only inbound** messages.
85+
Outbound messages will still be sent using:
86+
87+
* The SMTP provider you configured for the inbox (recommended), or
88+
* The default SMTP provider configured in the Chatwoot installation.
89+
90+
91+
## Troubleshooting
92+
93+
Common issues:
94+
95+
### 1. Forwarding Not Enabled in Chatwoot
96+
97+
If you see: *“Support for forwarding emails is not configured. Contact your administrator.”*
98+
Your Chatwoot installation must enable email ingress. MAILER_INBOUND_EMAIL_DOMAIN configuration is missing.
99+
100+
### 2. Emails Not Appearing in the Inbox
101+
102+
Check:
103+
* Forwarding rule is enabled and active.
104+
* Provider is not suppressing or classifying forwarded mail.
105+
* No DMARC quarantine/reject issues.
106+
* The ingress address is correct.
107+
108+
### 3. Threading Issues
109+
Chatwoot relies on message headers for threading. Ensure your provider forwards headers intact.

0 commit comments

Comments
 (0)