# "Chatwoot not sending emails: Sidekiq stopped or wrong SMTP" | Nuvits

Source: [https://nuvits.net/en/blog/chatwoot-not-sending-emails-sidekiq-smtp](https://nuvits.net/en/blog/chatwoot-not-sending-emails-sidekiq-smtp)

Published 2026-11-30, by Fernando Chagas.

When self-hosted Chatwoot does not send the agent invite or the password reset email, the screen and the API answer as if everything worked. The email is queued and the Sidekiq worker is what sends it, so the error only shows up in its log or in Redis. There are two causes: Sidekiq is not running, or the SMTP settings in `.env` are wrong. The errors below were reproduced on 30 November 2026 with Chatwoot v4.20.2 on Docker, on Ubuntu 24.04.5 LTS, using the Compose from [How to install self-hosted Chatwoot with Docker and Caddy](https://nuvits.net/en/blog/install-chatwoot-docker-caddy-vps).

![Diagnosis table for Chatwoot v4.20.2 when email does not arrive: with Sidekiq stopped the job waits in the default queue and goes out when the worker returns; with an empty SMTP_ADDRESS the error is Mail::Sendmail::DeliveryError; with a wrong host, port or password the job fails four times and moves to the dead set in about 1 minute 40 seconds](https://nuvits.net/blog/chatwoot-not-sending-emails-sidekiq-smtp/chatwoot-email-sidekiq-smtp-diagnosis.webp)

## How the problem shows up

The agent invite returns `200`, with the agent created and `"confirmed":false`. "Forgot password" answers that an email with instructions will be sent. Nothing arrives.

The health endpoint does not help: in the test, `/api` kept reporting `"queue_services":"ok"` with Sidekiq stopped. The `rails` log only shows the job being queued:

```text
[ActiveJob] Enqueued ActionMailer::MailDeliveryJob (Job ID: f2c84772-...) to Sidekiq(default) with arguments: "Devise::Mailer", "confirmation_instructions", "deliver_now", ...
```

Account emails (invite, confirmation and password reset) go into Sidekiq's `default` queue, not `mailers`.

## Step 1: is Sidekiq running?

```bash
cd ~/chatwoot
sudo docker compose ps -a sidekiq
sudo docker compose exec redis redis-cli SMEMBERS processes
sudo docker compose exec redis redis-cli LLEN queue:default
```

With the worker stopped, `ps -a` shows `Exited`, `SMEMBERS processes` comes back empty and `LLEN queue:default` shows the jobs waiting. `docker compose ps` without `-a` simply does not list the service, which is easy to miss.

Start the worker:

```bash
sudo docker compose up -d sidekiq
sudo docker compose logs --tail=50 sidekiq
```

Nothing is lost in this case. In the test, two emails requested while Sidekiq was stopped stayed in `queue:default` and arrived 22 seconds after `up -d`, with no new request. This is the line that proves the send:

```text
[ActiveJob] [ActionMailer::MailDeliveryJob] [f2c84772-...] Performed ActionMailer::MailDeliveryJob (Job ID: f2c84772-...) from Sidekiq(default) in 807.59ms
```

Chatwoot does not log a "Delivered mail" line; look for `Performed ActionMailer::MailDeliveryJob`.

If Sidekiq shows `Restarting` or keeps dying, check why with `sudo docker compose logs --tail=100 sidekiq`. On a VPS that is short on memory, also check `sudo docker inspect --format '{{.State.OOMKilled}}' chatwoot-sidekiq-1`.

## Step 2: test SMTP directly, without the queue

This command sends an email from inside the `rails` container, with the variables currently applied, and shows the error right away. Change the recipient:

```bash
sudo docker compose exec rails bundle exec rails runner 'ActionMailer::Base.mail(from: ENV["MAILER_SENDER_EMAIL"], to: "you@example.com", subject: "Chatwoot SMTP test", body: "ok").deliver_now; puts "SENT"'
```

It takes 7 to 12 seconds, almost all of it loading Rails. With working SMTP it prints `SENT`. On failure it ends with the exception and its class in parentheses. The lines about `IP_LOOKUP_API_KEY` and `redis-namespace` always appear and have nothing to do with email.

## Step 3: read the error

Every row in this table was reproduced. The error looks the same in the Step 2 command and in the Sidekiq log, after `Error performing ActionMailer::MailDeliveryJob`.

| Error                                                                                          | Cause                                                                            |
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `Mail::Sendmail::DeliveryError (Delivery failed with exitstatus 1: ["/usr/sbin/sendmail", ...` | `SMTP_ADDRESS` empty or missing                                                  |
| `Socket::ResolutionError (getaddrinfo: Name does not resolve)`                                 | the `SMTP_ADDRESS` host does not exist                                           |
| `Errno::ECONNREFUSED (Connection refused - connect(2) for ...`                                 | wrong port in `SMTP_PORT`                                                        |
| `Net::OpenTimeout (Timeout to open TCP connection to ... (exceeds 5 seconds))`                 | port blocked along the way or server down                                        |
| `Net::SMTPAuthenticationError (535 5.7.8 Authentication credentials invalid`                   | wrong username or password                                                       |
| `530 5.7.0 Authentication required (Net::SMTPAuthenticationError)`                             | the server requires login and `.env` has no `SMTP_USERNAME`                      |
| `502 5.5.1 Command not implemented`                                                            | `.env` sends a username and password, even empty ones, to a server with no login |
| `SSL_connect ... wrong version number (OpenSSL::SSL::SSLError)`                                | `SMTP_TLS=true` on a port without implicit TLS, such as 587                      |

Three details that cause confusion:

- **Without `SMTP_ADDRESS`, Chatwoot uses `sendmail`.** The `config/initializers/mailer.rb` file switches the delivery method to `sendmail` when the variable is blank. The container does have a `sendmail`, the BusyBox one, which tries `127.0.0.1` and fails with `can't connect to remote host (127.0.0.1): Connection refused`.
- **Empty `SMTP_USERNAME=` and `SMTP_PASSWORD=` are not the same as missing.** The official `.env.example` ships both lines empty. Against a server with no authentication, such as an internal relay, they cause the `502`. Delete or comment out the lines.
- **Port 587 uses STARTTLS, not `SMTP_TLS`.** Keep `SMTP_ENABLE_STARTTLS_AUTO=true` and do not set `SMTP_TLS`.

The variables are listed in the [Chatwoot documentation](https://developers.chatwoot.com/self-hosted/configuration/environment-variables).

## Step 4: apply `.env` by recreating the containers

After fixing `.env`, a `restart` is not enough. In the test, `docker compose restart sidekiq rails` kept the old `SMTP_ADDRESS` value in both containers. The `env_file` is only read when the container is created:

```bash
sudo docker compose up -d
sudo docker compose exec sidekiq printenv SMTP_ADDRESS
```

`up -d` recreates only `rails` and `sidekiq`, the services that use `.env`. Check with `printenv` and run the Step 2 command again.

## Step 5: trigger again what died

With broken SMTP, Chatwoot gives up quickly. `config/sidekiq.yml` sets `max_retries: 3`: in the test, the job ran 4 times in about 1 minute 40 seconds and moved to the dead set. See how many are there:

```bash
sudo docker compose exec redis redis-cli ZCARD retry
sudo docker compose exec redis redis-cli ZCARD dead
```

If you fix `.env` while the job is still in `retry`, the next attempt delivers the email. In the test, an invite that failed with a wrong password arrived on its own after the fix. What is already in `dead` is not sent again: request the email again, by resending the invite or repeating "forgot password".

> **Careful when repeating "forgot password".** Chatwoot limits that request to 5 per IP in 30 minutes and 5 per email in 1 hour. After that it answers `429`, which looks like a new problem. Use the Step 2 command to test instead.

To see the dead jobs with the error of each one, sign in at `/super_admin` with the account created during installation and open `/monitoring/sidekiq/morgue`, Sidekiq's list of dead jobs. Without that login, the address answers `404`.

## What was not tested

The SMTP server in the test was a local capture server (Mailpit v1.34.0), not a real provider. Deliverability, SPF, DKIM, real STARTTLS, port 465, certificate errors and conversation and notification emails, which may use another queue, were left out. The screens were not checked in a browser, only the HTTP responses.

If Sidekiq dies for lack of memory, [How much RAM and vCPU for n8n, Evolution API and Coolify](https://nuvits.net/en/blog/how-much-ram-vcpu-n8n-evolution-api-coolify-vps) helps split RAM between services. To run Chatwoot with headroom, see the [Docker VPS](https://nuvits.net/en/docker-vps) and [Linux VPS](https://nuvits.net/en/linux-vps) plans.
