---
title: "Configure the Gitea mailer over SMTP"
description: "Mailer settings in app.ini with an explicit PROTOCOL and FROM, then Send Testing Email in Site Administration."
url: https://www.unitpost.com/docs/smtp/gitea
section: SMTP
updated: 2026-11-02
---
# Configure the Gitea mailer over SMTP

## Connection settings

- **Host**: smtp.unitpost.com
- **Username**: unitpost (always this literal value)
- **Password**: Your Unitpost API key (must carry emails:send)
- **Port (STARTTLS)**: 587 (or 2587 if blocked, or 25)
- **Port (implicit TLS)**: 465 (or 2465 if blocked)
- **Security**: TLS 1.2 or 1.3 (required before AUTH)
- **From address**: Any address on a verified domain

## Configure the Gitea mailer over SMTP

> Mailer settings in app.ini with an explicit PROTOCOL and FROM, then Send Testing Email in Site Administration.

Gitea sends account confirmations, password resets and issue or pull request notifications through the `[mailer]` section of `app.ini`. Set `PROTOCOL` yourself: left empty, Gitea guesses from the port and treats anything other than 25, 465 or 587 (such as 2587) as `smtps`. Set `FROM` too: it defaults to `USER`, and with `USER = unitpost` Gitea refuses to start with `Invalid mailer.FROM (unitpost)`.

### 1. Create a send-only key

In Unitpost, open Settings → SMTP and create a send-only key. `FROM` must be an address on a verified domain (/docs/domains).

### 2. Edit app.ini

Gitea only sends credentials over TLS, so use `smtp+starttls` on 587 or `smtps` on 465.

```ini
[mailer]
ENABLED = true
PROTOCOL = smtp+starttls
SMTP_ADDR = smtp.unitpost.com
SMTP_PORT = 587
USER = unitpost
PASSWD = pk_live_...
FROM = gitea@yourdomain.com
```

> For port 465, set `PROTOCOL = smtps` and `SMTP_PORT = 465`. Gitea's docs recommend implicit TLS where the server supports it.

### 3. Restart Gitea

Gitea reads `app.ini` at startup, so restart the service or container after editing it.

### 4. Send a testing email

Sign in as an admin and open Site Administration → Configuration → Summary. Under Mailer Configuration, enter your address next to Send Testing Email and click Send.

### 5. If it fails

`unable to infer unspecified mailer.PROTOCOL` in the log means `PROTOCOL` is empty on a nonstandard port. `535 5.7.8` means `USER` isn't `unitpost`. `550 5.7.1` means `FROM` isn't on a verified domain.

## Related

- [Send email with Nodemailer over SMTP](https://www.unitpost.com/docs/smtp/nodemailer): createTransport pointed at Unitpost — Node, Next.js, or NestJS.
- [Send Supabase auth email over SMTP](https://www.unitpost.com/docs/smtp/supabase): Magic links and confirmations from your verified domain.
- [Send WordPress email over SMTP](https://www.unitpost.com/docs/smtp/wordpress): WP Mail SMTP pointed at Unitpost instead of PHP mail().
