> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Email delivery

> Send activation, invitation and password reset emails from a Kubernetes deployment.

The **web** service sends every email (activation, project invitations, password reset) from every Ayakaleaf Pro pod. The settings are the same as on the Toolkit, see [Email delivery](https://ayakaleaf-pro.mintlify.site/on-premises/configuration/overleaf-toolkit/email-delivery.md).

| | |
| - | - |
| Service | web, in every Ayakaleaf Pro pod; read when web starts |
| Pod → outside | your SMTP server (`OVERLEAF_EMAIL_SMTP_HOST`), or the Amazon SES API of `OVERLEAF_EMAIL_AWS_SES_REGION` |
| State | the sending rate limit in Redis |
| Periodic jobs | none |

### Configuration

**1. ConfigMap**

```yaml title="30-config.yaml (additions)" wrap theme={null}
  OVERLEAF_EMAIL_FROM_ADDRESS: no-reply@example.com
  OVERLEAF_EMAIL_SMTP_HOST: smtp.example.com
  OVERLEAF_EMAIL_SMTP_PORT: "587"
  OVERLEAF_EMAIL_SMTP_SECURE: "false"
  OVERLEAF_EMAIL_SMTP_USER: no-reply@example.com
  # optional
  # OVERLEAF_EMAIL_REPLY_TO: support@example.com
  # OVERLEAF_EMAIL_SMTP_IGNORE_TLS: "false"
  # OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH: "true"
```

`OVERLEAF_EMAIL_FROM_ADDRESS` turns sending on. Set it only together with the SMTP server (or SES): with the sender alone, Ayakaleaf Pro tries an SMTP server inside the pod, and every email fails. Without it, emails are not sent, only written to `web.log`.

`OVERLEAF_EMAIL_SMTP_SECURE`, `OVERLEAF_EMAIL_SMTP_IGNORE_TLS` and `OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH` are read as JSON, so use `"true"` or `"false"`: a value such as `yes` stops every service of the pod at startup.

**2. Secret**

```bash theme={null}
kubectl -n overleaf patch secret overleaf-secrets --type merge \
  -p '{"stringData":{"OVERLEAF_EMAIL_SMTP_PASS":"<SMTP password>"}}'
```

For the Amazon SES API, put `OVERLEAF_EMAIL_AWS_SES_ACCESS_KEY_ID` and `OVERLEAF_EMAIL_AWS_SES_SECRET_KEY` here instead, and `OVERLEAF_EMAIL_DRIVER: ses` and `OVERLEAF_EMAIL_AWS_SES_REGION` into the ConfigMap.

**3. Apply, restart and test**

```bash theme={null}
kubectl apply -f 30-config.yaml
kubectl -n overleaf rollout restart deployment/overleaf     # or statefulset/overleaf
```

Send yourself a password reset email from the login page. If it does not arrive, check the SMTP server is reachable from the pods and look at the web log:

```bash theme={null}
kubectl -n overleaf exec deploy/overleaf -- bash -c 'echo > /dev/tcp/smtp.example.com/587 && echo reachable'
kubectl -n overleaf exec deploy/overleaf -- grep -iE "email|smtp" /var/log/overleaf/web.log | tail
```

### Several replicas

Nothing extra. Every replica sends with the same settings, and the sending rate limit is counted in Redis across all replicas. If your SMTP server only accepts known senders, allow the addresses the pods leave the cluster with (usually the nodes').

### Tested on Kubernetes

With Mailpit as the SMTP server, on Kubernetes 1.37 with one replica, our end-to-end tests that send email pass: the activation email of an account an admin creates, the activation email of a self-registration limited to domains, the password reset email, the email telling a user their account was deleted, and what happens when the SMTP server refuses an activation or deletion email: the account is still created or deleted, and the activation email can be sent again later. With `OVERLEAF_EMAIL_FROM_ADDRESS` and no SMTP host, a password reset request failed with an error and `web.log` showed "error sending message", as described above.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.