Repository navigation
Usage
OwnMail is a mail server of its own: it receives mail for your domains, keeps it in mailboxes that mail programs read, and sends mail directly to other servers. Nothing is sent through an outside sending service. How it is built and why is in Architecture; calendars, contacts, sharing and scheduling in detail are in Groupware.
Deliverability, not the server, is the hard part of running mail yourself: whether other providers accept your mail depends on your server's address, its reverse name and your DNS records. Read Before you start.
How to run OwnMail (Docker, systemd, Coolify) is not on this page; see Running it.
Everything is reached under the mail server name, for example
https://mail.example.com:
| Address | For whom |
|---|---|
https://mail.example.com/admin/ |
administrators: domains, mailboxes, settings |
https://mail.example.com/ |
the people who use a mailbox: they sign in with their address and password and manage their own mailbox (later also a webmail program) |
https://mail.example.com/api/ |
the administration API (see Administration API) |
https://mail.example.com/dav/, /mcp, /account/api/
|
calendars and contacts, AI programs, a mailbox's own account |
The mailbox page (and the account API, calendars, contacts and AI access
behind it) only answers under the mail server name over HTTPS. The
administration works under any name the reverse proxy passes on to
OwnMail over HTTPS, and over plain HTTP only on localhost or with
-insecure-http (for test setups).
Both are in English or German. They follow the browser's language; the switch on the sign-in screens, at the top of the mailbox page and under Language in the administration's account menu (the round button at the bottom of the sidebar) changes it for that browser. Messages from the server (error messages, health checks, notes on DNS records) are still English.
- Mailboxes with a password, used with any mail program (Thunderbird, Apple Mail, Outlook, phones). Folders for Inbox, Sent, Drafts, Junk, Trash and Archive. A storage limit per mailbox, a display name, and app passwords for each device.
- Organisations: domains of one company grouped together, the boundary for sharing between mailboxes (see Organisations).
- Shared mailboxes such as info@ or support@ that several people read and send from with their own sign-in, and personal mailboxes shared with an assistant (see Shared mailboxes).
- Rooms and equipment that people book by inviting them to an event (see Rooms and equipment).
- Forwarding: extra addresses that deliver to mailboxes or to outside addresses, and an address that catches everything else on a domain. A forwarding address can be a distribution group that accepts mail only from certain senders.
- Calendars and contacts for every mailbox that sync to phones and computers, with a read-only address book of the organisation (see Calendars and contacts).
- Signed outgoing mail with a key per domain, so receivers can tell the mail really comes from your domain.
- The DNS records each domain needs, listed with copy buttons and checked. You enter them at your DNS provider yourself; OwnMail never changes DNS.
- Spam checks on incoming mail: senders' signatures and policies, blocklists, a simple score and a Junk folder. Dangerous attachments (programs, scripts, documents with macros) are refused.
- Limits on how much each mailbox and domain may send. A mailbox that behaves as if its password was stolen is stopped from sending until an administrator allows it again.
- Access for AI programs per mailbox (see AI programs).
- Server status: what stands between your server and good delivery.
- Mails to administrators when the certificate is about to expire, the disk is nearly full, backups fail, a mailbox is stopped from sending or a domain's DNS records are wrong (see Mails to administrators).
- Mail traffic on the Overview: how much mail came in, went out and was turned away over the last 24 hours or 7 days.
Not there yet: a webmail in the browser, virus scanning, reports from receivers about your mail, and outgoing encryption policies (DANE).
OwnMail is one program, ownmail serve, that runs the mail service and the
web interface together. See:
-
../docker-compose.yml: OwnMail with a small web server in front for HTTPS on the web interface, for any server with Docker. The compose file takes care of the certificate. - Docker: the image and running it with Docker.
- systemd: running it as a service on a server.
-
Coolify: one option among these, with
../deploy/coolify/docker-compose.ymland../deploy/coolify/traefik-certs.sh.
The flags (-data, -hostname, -tls, -server-ip, the mail ports and
the rest) are listed in the Reference.
- Port 25 must be open in both directions. Many hosting providers block outgoing port 25 on new servers (Hetzner, AWS, Google Cloud, Azure, many others) and unblock it on request. Ask before you rely on sending; if it stays blocked, send through a relay (see Sending through a relay). Incoming 25, 465, 587, 993 and 4190 must be reachable, and the web interface needs HTTPS (port 443) through the web server in front of OwnMail. Docker has a test command.
-
A mail server name. Pick a name such as
mail.example.comand point it at the server (A and, if the server has IPv6, AAAA record). Mail programs connect to it, other servers deliver to it, and the web interface is reached under it. - Reverse name (PTR). At your hosting provider, set the reverse name of the server's IPv4 (and IPv6) address to the mail server name. Many receivers refuse mail from addresses without a matching reverse name. This can only be set at the provider, not at your DNS provider.
-
Nothing else on port 25. Some systems come with a small mail program
(exim, postfix) for messages from cron. Stop it, e.g.
systemctl disable --now exim4. OwnMail shows a port it could not open under Server status.
-
Create the first administrator. On its first start OwnMail prints a one-time setup code to its log. Open the administration (
https://<mail server name>/admin/), enter the code, your e-mail address and a password (10 to 200 characters). The address is only what you sign in with; it can be at another provider. Without the code nobody can take over a fresh server. -
Name the mail server. Either with
-hostnamewhen OwnMail starts (then it is fixed and shown as set when the server starts), or under Settings → Name of the mail server. Until it has a name, no domain starts receiving mail and a domain's page says so, with Name the mail server leading to the setting. -
Settings also hold:
-
Addresses of the server: the public addresses the mail server name
should point to; they appear in the records your domains need. Set
with
-server-ip, or chosen here from the addresses OwnMail finds on the machine. -
E-mail for certificate notices: where the certificate authority
may write, for example before a certificate expires (
-acme-email). - Postmaster address: an address of yours that receives reports about mail problems (see Forwarding).
- Spam checks (see Spam checks).
A single value is changed right where it is shown (Change, then Save, or Escape to leave it as it was); the spam checks are a form on the page with their own Save spam checks.
The mail server's certificate comes from Let's Encrypt by default (
-tls acme), once the name points at the server and the web server in front passes port 80's challenges on; the deployment pages describe it. -
Addresses of the server: the public addresses the mail server name
should point to; they appear in the records your domains need. Set
with
-
Add a domain: Domains → Add domain, for example
example.com. OwnMail makes a signing key for it. -
Enter the DNS records: the domain's DNS records page lists every record mail needs, each with copy buttons for name and value and whether it is in place, missing or different at the domain's nameservers. Enter them at your DNS provider. Mail needs only the first four and the records of the mail server name below; the others are recommended and grouped under For setting up mail programs, closed, with how many of them are set up:
Record Name Value MX @10 mail.example.com.TXT @v=spf1 mx -all(or your existing one withmxadded)TXT <selector>._domainkeyshown on the page TXT _dmarcv=DMARC1; p=none; adkim=r; aspf=r(only if you have none)SRV _submissions._tcp0 1 465 mail.example.com.(recommended)SRV _imaps._tcp0 1 993 mail.example.com.(recommended)CNAME autoconfigmail.example.com.(recommended)CNAME autodiscovermail.example.com.(recommended)SRV _caldavs._tcp,_carddavs._tcp0 1 443 mail.example.com.(recommended)TXT _caldavs._tcp,_carddavs._tcppath=/dav/(recommended)CNAME mta-stsmail.example.com.(recommended, see below)TXT _mta-stsv=STSv1; id=…(recommended, shown on the page)TXT _smtp._tlsv=TLSRPTv1; rua=mailto:tls-reports@mail.example.com(recommended, see below)The mail server name itself needs records too, listed with every domain: A and AAAA with the server's addresses, and an SPF record
v=spf1 a -all(oraadded to an existing one), because bounces and forwarded mail are sent under its name. The page also shows whether the reverse name of the server fits; only your hosting provider can set that. The records are checked again every time the page is opened.Encrypted delivery (MTA-STS). With the two MTA-STS records, a domain tells sending servers that its mail goes only to the mail server, over an encrypted connection with a valid certificate, so nobody in between can quietly read or redirect it. OwnMail serves the policy at
https://mta-sts.<domain>/.well-known/mta-sts.txt(the web server in front must pass that name on, as forautoconfig.). A domain starts in testing: senders that follow the policy report problems but still deliver. Once the records are in place and mail arrives as it should, switch the domain to enforce under its Settings → Encrypted delivery; senders then refuse to deliver when the connection is not encrypted. That needs a certificate other servers trust (not the server's own,-tls internal). Changing the mode changes the policy's id: enter the new_mta-stsvalue shown in the list. With the API:PUT /api/mail/domains/{domain}/mta-sts({"mode": "enforce"}). Changing the signature key. Below the records, Signature key shows the key that signs the domain's mail. Change the key makes a new one; nothing changes yet. A new record "New signature key for sent mail" appears in the list: enter it at your DNS provider. As soon as it is visible at the domain's nameservers (OwnMail looks every few minutes, and every time the page opens), the new key signs the mail and the old one is replaced. The old key's record is then listed as "Previous signature key": keep it for 7 more days, so mail signed with it before the change still checks out; after that the list says it can be removed, and the row disappears once it is gone. Drop the new key stops a change that waits. Administrators get a mail when the new record is still missing after two checks of the DNS records (see Mails to administrators). With the API:POSTandDELETE /api/mail/domains/{domain}/dkim-change.Reports about encrypted delivery (TLS-RPT). With the
_smtp._tlsrecord, sending servers that support it (Google, Microsoft and others) send a daily report of how many connections to the domain were encrypted and why others failed. They go totls-reports@<mail server name>, an address the mail server takes in itself (no mailbox needed); it keeps the reports about its own domains for 100 days and drops anything else sent there. The domain's Settings → Encrypted delivery sums up the last 30 days, and when at least 3 connections and one in twenty failed in the reports of the last three days, the domain's admins get a mail (see notifications). The reports are useful before switching to enforce: a certificate the senders do not trust shows up there first. With the API:GET /api/mail/domains/{domain}/tls-reports; for AI programs the toolget_tls_reports.At Cloudflare, create every record as DNS only (grey cloud), in particular the A and AAAA records of the mail server name. Cloudflare's proxy (orange cloud) passes only web pages, not mail; OwnMail recognises its addresses and says which record to switch.
The recommended names let mail programs, calendars and contacts set themselves up from just the address and password; mail is delivered and accepted without them. Hosted mail such as Google's needs only MX, SPF, DKIM and DMARC at the domain for the same reason: its servers' own records are in the provider's DNS, and its programs know the servers. For
autoconfig.andautodiscover.to work, the web server in front of OwnMail must pass those names on to it too, with a certificate for them: the Caddy of the Docker setup gets those certificates by itself the first time a mail program asks (Docker); on Coolify, add the two names of each domain to the service (Coolify).All at once. While records are missing or different, the page has two more buttons. Both copy only those records (the ones already in place are left out); they are the same texts the administration for AI programs returns with
get_mail_records(agent_instructions,zone_file).-
Copy for an AI assistant copies step-by-step instructions for an
AI agent that can change your DNS (through the provider's API or a
repository with your DNS settings): domain, mail server name, every
record with type, name, value, cache time and what is there now, and
the rules: change only these records and never delete others, change
an existing SPF record instead of adding a second one, split TXT
values longer than 255 characters into quoted strings, and how to
check the result with
digat the domain's own nameservers. Records OwnMail cannot fix by itself (several SPF records, an SPF record that allows every server) are listed for a person to decide; records that could not be checked are listed to look at first. -
Copy as zone file copies the records as a zone file (RFC 1035:
name TTL IN TYPE value,$ORIGINthe domain, long TXT values split into quoted strings of at most 255 characters), for DNS providers that import one. What it replaces is noted in a comment next to each record. Records that need removing or a decision are only comments. If the mail server name lies in another domain, its records are comments too: enter them where that domain is managed.
Careful with importing a zone file. Some providers replace the whole zone (or every record set in the file) with an import, others only add records, and some refuse records that exist already. A record OwnMail lists as "different" also has to replace the old value, which an import that only adds does not do. What we could check (December 2026):
Provider Imports a zone file Existing records Hetzner (DNS in the Hetzner Console) yes, when a zone is created and through the API the API's import replaces all record sets of the zone (hcloud-go); only use it on a new zone Cloudflare yes, dashboard and API Cloudflare's docs do not say; community reports say it only adds, so a changed record ends up twice (docs). Untick "Proxy imported DNS records" Amazon Route 53 yes, console the import fails, and creates nothing, if a record in the file exists already (docs); use it for missing records only PowerDNS ( pdnsutil zone load)yes, on the server replaces all records of the zone (docs) Poweradmin (PowerDNS panel) yes, Tools → Zone Import you choose: add all, skip existing, or replace each set of the same name and type (docs) PowerDNS-Admin only when creating a zone, in its development branch so far not for existing zones INWX yes, Control Panel (INWX) not documented; we could not check it IONOS Cloud DNS yes, API only, into a new zone without records (docs) not documented for zones with records. We found no import for the DNS of ordinary IONOS domains When in doubt, export the zone first, or enter the records by hand.
-
Copy for an AI assistant copies step-by-step instructions for an
AI agent that can change your DNS (through the provider's API or a
repository with your DNS settings): domain, mail server name, every
record with type, name, value, cache time and what is there now, and
the rules: change only these records and never delete others, change
an existing SPF record instead of adding a second one, split TXT
values longer than 255 characters into quoted strings, and how to
check the result with
-
Wait for the domain to receive mail. The domain becomes active once its MX record points at the mail server name; OwnMail checks every few minutes, or at once with Check now. Until then its mailboxes can neither receive nor send. This protects other people's mail: nobody can claim a domain on this server that does not really point here. If mail reaches the server another way (a gateway in front, split DNS) or you are trying things out, Receive mail here now makes it active at once. Once active, a domain stays active even if its MX record changes later.
-
Create mailboxes and forwarding on the domain's Addresses page. Connect a device on a mailbox opens a page with the settings for mail programs (a new personal mailbox goes there by itself). The mailbox's own page (Show details) has everything else: display name, limits, devices and app passwords, sharing, out-of-office and forwarding, connected programs, import and download, the kind of mailbox, delete.
A domain's pages (Addresses, DNS records, Settings) are in the sidebar under the domain; on a phone, in the menu. Larger forms (importing mail, connecting a device, adding or editing forwarding) are pages of their own with an address, so the browser's back button and links work; Cancel goes back. A single value shown on a page (a display name, the name of an organisation) is changed right there.
| Server (incoming and outgoing) | the mail server name, e.g. mail.example.com, or the domain's own name for mail programs
|
| User name | the full e-mail address |
| Password | the mailbox's password, or an app password |
| Incoming (IMAP) | port 993, SSL/TLS |
| Outgoing (SMTP) | port 465, SSL/TLS, or port 587, STARTTLS |
| Filters (ManageSieve) | port 4190, STARTTLS (see Filters with a mail program) |
Most programs find these settings by themselves: Thunderbird and others
ask autoconfig.<domain> (or <domain>/.well-known/autoconfig/…),
Outlook asks autodiscover.<domain>, and some use the SRV records. These
answers exist only for active mail domains and are the same for every
address, so they never tell whether a mailbox exists. For iPhone, iPad and
Mac, Connect a device → Download setup for Apple devices gives a
profile to install with the mail account, calendars and contacts; it
contains no password and asks for it during installation (it is not
signed, so the device shows it as unverified).
By default every domain's mail programs connect to the mail server's name.
A domain can offer its own name instead (Settings → Name for mail
programs, for example mail.example.org): people see their own domain,
and the domain can later move to another server by changing DNS, without
setting up every device again. Choose how the name points here:
- Follow the mail server's name: a CNAME record to the mail server's name. Keeps working when the server's address changes.
- The server's addresses: A (and AAAA) records with the server's addresses. No other name appears when the name is looked up, which helps in networks that block names they don't know (many filters also check where a CNAME leads). These records must be changed when the server's address changes; the DNS records page then shows them as different.
The record appears under DNS records → For setting up mail programs. Once the name points here, OwnMail gets a certificate for it (like the mail server's own, within a few minutes) and presents it on the mail ports to programs that ask for that name. Only then do Connect a device, the answers for automatic setup, the Apple profile and the recommended SRV records use the name; until then (and whenever its certificate is not valid) they keep the mail server's name, so nothing breaks while DNS is being changed. An SRV record that still names the mail server is fine too.
The MX record always names the mail server (an MX must not point to a CNAME), and calendars and contacts stay on the mail server's name.
Because such filters also block by name ending, run the mail server's own
name under a widely used domain ending (.com, .net, .org, a country
ending), not a new or unusual one.
Behind a reverse proxy, port 80 of the name must reach OwnMail for the
certificate, like the mail server's name: the Caddy of the Docker setup and
the systemd example do that for every name. On Coolify, add the name to the
service's domains (works with Coolify's Caddy; with Traefik, which answers
every challenge itself, the name is not used, see
Coolify). With -tls files the
name is used when the files' certificate is valid for it too.
A mailbox can send as its own address and as forwarding addresses that deliver to it (not as addresses the catch-all covers), and for shared mailboxes it may send for (see Sending for a shared mailbox).
Display name (Change under Overview on the mailbox's page) sets the name of the person or team behind
it, at most 64 characters (no line breaks and none of <, > and ").
The mail server uses it where it writes mail itself (out-of-office replies,
invitations) and in the address book; mail programs still put their own
name into the mail they send.
An app password is a separate password for one device or mail program (for example "Phone"). Mail programs sign in with the address and the app password instead of the mailbox's password. Each one can be revoked on its own: the device using it is signed out at once, everything else keeps working.
- App passwords on a mailbox lists them with when each was created and last used, and from which network (the first three parts of an IPv4 address, the first three groups of an IPv6 address; never the full address).
- Add app password asks for the device or program and shows the password once, with a button to copy it. It is not stored anywhere in readable form, so it cannot be shown again; create a new one if it is lost. Up to 50 per mailbox.
- Delete ends it for good.
- Only allow mail programs with app passwords: when on, the mailbox's own password no longer works in mail programs (it still signs in to the mailbox's own account). Create the app passwords first, or mail programs stop working. This is the setting to use if the mailbox password might be known to others.
App passwords are created and revoked in the administration, through the administration API or the mailbox's own account, never by an AI program. Changing the mailbox's password does not revoke them, unless the person asks for it when changing it in their own account.
The people who use a mailbox manage it themselves at
https://<mail server name>/: they sign in with the full address and
the mailbox password (never an app password). The same is available to
programs through the mail service's account API at
https://<mail server name>/account/api/. The page is in English or
German: it follows the browser's language, and the switch on the sign-in
and at the top of the page changes it for that browser (messages that come
from the server stay English for now). A mailbox can
- see how much room its mail takes and the storage limit;
- set its display name (changed right at the top of the page);
- change its password (the current one is needed; 10 to 200 characters), optionally revoking every app password at the same time;
- create and revoke app passwords, see when each was last used in the last 30 days, and switch Only allow mail programs with app passwords on or off;
- turn on two-factor sign-in for this page (see Two-factor sign-in for mailboxes);
- set an out-of-office reply, forwarding and filters (see Out-of-office and filters);
- read the settings for mail programs and download the setup for Apple devices (mail, calendars and contacts in one);
- list its calendars and address books, download each as a file and
import an
.icsor.vcffile (up to 10 MB) into one; - share a calendar or address book with colleagues and remove one shared with it from its list;
- decide whether others in its organisation can see when it is busy, and whether invitations from its organisation also come by mail;
- share the mailbox with colleagues and see which mailboxes it has access to (see Sharing your own mailbox);
- list and remove connected AI programs.
For example, with curl:
curl -c jar -X POST https://mail.example.com/account/api/session \
-d '{"address":"anna@example.com","password":"…"}'
curl -b jar https://mail.example.com/account/api/me
curl -b jar -H 'X-Ownmail-Request: 1' -X POST \
https://mail.example.com/account/api/app-passwords -d '{"name":"Phone"}'Changing requests need the header X-Ownmail-Request: 1 (the same as
the administration API's) and are refused when the browser
says they come from another site. Bodies are JSON; errors are
{"error": "…"} in plain words, and 401 means the session ended. The
routes:
| Method | Path below /account/api
|
What |
|---|---|---|
POST, DELETE
|
/session |
sign in with {"address", "password"}, sign out; with two-factor sign-in on, 202 with "code": "two_factor_required"
|
POST |
/session/two-factor |
finish that sign-in with {"code"} (a code from the app or a backup code) |
GET |
/two-factor |
{"available", "enabled", "backup_codes_left"} |
POST |
/two-factor/setup, /two-factor/enable, /two-factor/disable, /two-factor/backup-codes
|
set it up (the key and a code to scan), turn it on or off and make new backup codes ({"code"}; on and new codes answer with the backup codes, only this once) |
GET |
/me |
address, display name, storage, app passwords, settings for programs, sharing, AI access, the two calendar settings |
PUT |
/password |
{"current_password", "new_password", "revoke_app_passwords"} |
PUT |
/display-name |
{"display_name"} |
PUT |
/app-passwords-only |
{"app_passwords_only"} |
POST, DELETE
|
/app-passwords, /app-passwords/{id}
|
create ({"name"}, the password is in the answer only this once), revoke |
GET |
/apple-setup |
the setup for Apple devices |
PUT |
/delegations |
{"grants": [{"address", "rights"}]}: who the mailbox is shared with, the full list |
GET |
/filters |
out-of-office, forwarding and filters; ?mailbox=<address> for a mailbox it has the Manage right on |
PUT |
/out-of-office, /forwarding, /filters
|
change them (also with ?mailbox=) |
PUT |
/free-busy, /invitation-mail
|
{"shown"}, {"on"}
|
GET |
/collections, /collections/received, /collections/people
|
calendars and address books, those shared with it, people it may share with |
GET, PUT
|
/collections/{kind}/{name}/shares |
who a calendar or address book is shared with |
DELETE |
/collections/received/{id} |
remove one shared with it from its list |
GET, POST
|
/collections/{kind}/{name}/export, /import
|
a calendar as .ics or an address book as .vcf
|
GET, DELETE
|
/connected-programs, /connected-programs/{id}
|
connected AI programs |
Only the mailbox password signs in there, also when mail programs may only use app passwords; app passwords never do. A session ends after 30 minutes without use and after 12 hours in any case, and at once when the password is changed elsewhere (on another device, or by an administrator) or the mailbox is deleted. Too many wrong passwords from one network hold back further tries for 15 minutes. The account API answers only under the mail server name.
A mailbox can ask for a second step when signing in to its page: a code from an authenticator app on the person's phone, as for administrators (see Two-factor sign-in). Under Sign-in and devices, Set up two-factor sign-in shows a code to scan and the key to type in; the 6-digit code from the app turns it on and shows ten backup codes once. From then on the page asks for the code after the password; each code from the app and each backup code works once, wrong codes are held back after 5 within 15 minutes, and the step must be finished within 5 minutes. Turning it off and new backup codes need a code too.
- Mail programs are not affected. Phones and mail programs keep signing in with the mailbox password or app passwords, without a code (switch on Only allow mail programs with app passwords so the password alone opens nothing but this page).
- AI programs connected by address sign in on this page, so they ask for the code as well.
-
Lost the phone and the backup codes? An administrator of the whole
server, or of the mailbox's domain, chooses Turn off two-factor
sign-in on the mailbox's page (it is there only while it is on; with
POST /api/mail/mailboxes/{id}/two-factor/off, signed in with a password, never with an access token). The mailbox then signs in with its password alone and can turn it on again. The mailbox's page in the administration shows whether it is on.
The app's key is stored encrypted with the mail service's own key,
mail/secret.key in the data directory, made on the first start; it is in
every backup of the mail. Without it, nobody can finish the second step
until an administrator turns it off. Backup codes are stored only as
fingerprints. Turning it on or off and new backup codes are in the activity
log.
Changes made there show up in the web interface and the activity log with the mailbox as the one who made them (never with a password). There is no "forgot password" by e-mail: an administrator can set a new password at any time, which ends the person's sessions.
To manage the server from an AI program (domains, mailboxes, records,
settings) use /api/mcp with an access token or by signing in, see
MCP. This
section is about the mail of one mailbox.
Every mailbox can be used from AI programs (Claude Code, Cursor and other
programs that speak the Model Context Protocol) at
https://<mail server name>/mcp. Such a program can list the
mailboxes the person may use (their own and shared or delegated ones),
list folders, search, read messages and attachments, mark them read or
flagged, move, copy and delete them, create, rename and delete folders,
save drafts, set the out-of-office reply, and send, reply and forward. The
tools are listed in Groupware.
Connect a program set up by hand: create an app password for it (Add app password on the mailbox, or through the account API), then give the program the address and the app password as a bearer token. Such a program may do everything, including sending. For Claude Code:
claude mcp add --transport http mail https://mail.example.com/mcp \
--header "Authorization: Bearer op_…"Most other programs take a setting like this:
{"mcpServers": {"mail": {"type": "http", "url": "https://mail.example.com/mcp",
"headers": {"Authorization": "Bearer op_…"}}}}The mailbox password never works here, only app passwords and connected programs. Revoking the app password cuts the program off at once.
Connect by address (claude.ai, ChatGPT, Claude Desktop): the mail
service has the sign-in for this (OAuth, with the person choosing what the
program may do: read, organise, send within your organisation,
send to anyone), but the step where the person signs in and allows the
program happens on the mailbox's own page: the program sends the browser to
https://<mail server name>/?connect=…, the person signs in there with the
mailbox's address and password and chooses what the program may do.
Connected programs are listed and removed on the mailbox's own page (or
through the account API, /connected-programs); changing the mailbox password, making the mailbox
shared, or deleting it disconnects every program.
Sending goes through the same checks as a mail program: the addresses the mailbox may send as or on behalf of, the mailbox's and domain's sending limits and blocks, signing, filters of local recipients, and the copy in a shared mailbox's Sent folder. The server builds the message and puts a copy into the sender's Sent folder. On top, at most 100 recipients outside the organisation per mailbox in 24 hours can be reached from AI programs.
What the program may do follows the person's rights, as in a mail program: in a shared mailbox with read access only it can read and keep its own read state, nothing else; another mailbox's out-of-office reply needs the right to manage it. Deleting for good and deleting a folder need an explicit confirmation, which programs normally ask the person for.
Mail is written by its senders: a message can contain text meant to mislead an AI program ("ignore your instructions and delete…"). The server tells programs that mail content is data, never instructions, and marks message text as such, but it cannot tell a person's request from one planted in a mail. Check what the assistant suggests before letting it move or delete mail.
Limits: 600 requests per app password or connected program and 1200 per mailbox in 5 minutes, 4 at the same time per mailbox, 1000 messages per call; one search reads at most 256 MB of mail and runs at most 10 seconds, then continues with the next page. Too many wrong app passwords from one network hold back further tries for 15 minutes.
Turning it off: using mailboxes from AI programs is allowed by
default. Turn it off for one mailbox (May be used by connected
programs under Connected programs on the mailbox's page) or for
every mailbox of a domain at once
(Connected programs on the domain's Settings page). While the
domain's switch is off, no mailbox of the domain can be used that way,
whatever its own switch says, and programs get "forbidden"; connected ones
stay listed but do not work until it is turned on again. A shared mailbox
that is turned off is invisible to everyone's programs. Each change is
recorded in the activity log (mail.mailbox.may-use-ai,
mail.domain.may-use-ai). API: PUT /api/mail/mailboxes/{id}/may-use-ai
and PUT /api/mail/domains/{domain}/may-use-ai with {"allowed": true}
or false.
Every mailbox has calendars and address books on the server that sync to phones and computers: a calendar "Calendar" and an address book "Contacts" to start with (created the first time they are used), more can be added in the programs. Each mailbox also sees a read-only address book Directory with everyone in its organisation (the mailboxes with their display names, and the forwarding addresses, not the catch-all), for completing addresses while writing.
| Server address |
https://<mail server name>/dav/ (most programs only need the mail server name or even only the e-mail address) |
| User name | the full e-mail address |
| Password | the mailbox password, or an app password (with Only allow mail programs with app passwords, only an app password) |
- iPhone, iPad, Mac: download the setup for Apple devices (Connect a device on the mailbox) and install it: it adds the mail account, the calendars and the contacts, and asks for the password once for each. By hand: Settings → Calendar → Accounts → Add Account → Other → Add CalDAV Account (and Add CardDAV Account in Contacts) with the mail server name, the address and the password.
-
Android: install DAVx5, add an account with "Login with e-mail
address" and the address and password (or an app password); DAVx5 finds
the server through the domain's records. If it does not, choose "Login
with URL and user name" and enter
https://<mail server name>/dav/. -
Thunderbird: its automatic mail setup cannot carry calendars. In
Thunderbird 115 or later: Calendar → New Calendar → On the Network, enter
the address and as location the mail server name (or
https://<mail server name>/dav/); it lists the calendars to add. Address books: Address Book → New Address Book → Add CardDAV Address Book, with the address andhttps://<mail server name>/dav/. -
Outlook (Windows): Outlook has no built-in support. Use the free
add-on CalDav Synchronizer with the server address
https://<mail server name>/dav/calendars/<address>/calendar/for the calendar andhttps://<mail server name>/dav/addressbooks/<address>/contacts/for contacts. - GNOME, KDE, Evolution and others: add a CalDAV/CardDAV account with the server address above.
Programs find the server by themselves through the records
_caldavs._tcp and _carddavs._tcp of the address's domain (recommended
in the domain's DNS records) and through
https://<mail server name>/.well-known/caldav.
Calendars and contacts count towards the mailbox's storage limit: when it is full, programs cannot save new entries until something is deleted. Limits: 1 MB per entry or contact (photos included), 100 calendars and address books per mailbox, 100 000 entries per calendar or address book.
Moving from Google or Microsoft 365: export the calendar as .ics
(Google Calendar: Settings → Import & export; Outlook on the web: share or
publish the calendar and download the .ics) and the contacts as .vcf
(Google Contacts: Export → vCard; Outlook: export as CSV, which a program
like Thunderbird can turn into .vcf), then import the files through the
account API (POST /account/api/collections/{kind}/{name}/import). An
entry that is there already (same UID) is replaced, so the same file can
be imported again.
A mailbox shares a calendar or address book with people of the same
organisation, can view or can view and change, through the account
API (PUT /account/api/collections/{kind}/{name}/shares).
The people it is shared with see it in their calendar or contacts program next to their own, with their own sign-in, named "Calendar (Anna)" until they rename it; their name and colour for it are their own and change nothing for anyone else. With can view and change they add, change and delete entries; these count towards the storage of the mailbox it belongs to. Removing it from their list (or deleting it in their program) takes it away from them only; the calendar and its entries stay with its owner.
Sharing works only between mailboxes of one organisation. If that changes (a domain moves to another organisation, a mailbox becomes a shared one), the sharing stops at once and is kept: it shows as not in effect, and it works again once the mailboxes are in one organisation again. Deleting a calendar, an address book or a mailbox deletes what it shared and what was shared with it. Removing someone or making their access view-only takes effect with their program's next request.
Shared mailboxes have a calendar "Calendar" and an address book "Contacts" too (a team calendar). Everyone who may read the shared mailbox sees them in their programs, named "Calendar (Team name)"; those who may change its mail may also change the entries. Entries count towards the shared mailbox's storage.
Limits: a calendar or address book can be shared with 100 people, and a mailbox can receive 200 shared calendars and address books.
Calendar programs connected to the server leave sending invitations to it: when you add people to an event, the server mails them the invitation from your address (signed like your other mail, counted against your sending limits). Changing the date, time, place or title, or cancelling or deleting the event, tells them too; people you remove get a cancellation. Their answers arrive as mail, and the server marks in your event who accepted or declined, but only when the answer really comes from that person's address (its domain vouches for it, or it comes from a mailbox on this server).
Inside your organisation, invitations go straight into calendars:
within a few seconds the event appears in each person's calendar (the one
they chose for invitations in their program, else "Calendar", else their
first calendar that takes events), waiting for an answer. Each person also
gets a short message about it ("Anna Example invited you to …"), which
they can turn off (PUT /account/api/invitation-mail); the message has no
buttons to answer, the event in the calendar is where they answer. At most
10 such messages an hour and 50 a day come from one organiser; after that,
changes only show in the calendar for a while. When they accept, decline
or delete it, your event shows their answer right away, and the other
people invited see it too (after a minute or so). When you cancel or
delete the event, or remove someone, their copy stays in their calendar
marked as cancelled. A team calendar of a shared mailbox gets invitations
to the shared mailbox (no message, as nobody signs in to it); everyone who
may change it can answer for it. People of other organisations on this
server and outside get the invitation as mail.
When someone outside invites you, the invitation stays a mail; your program offers to accept it, and when you accept, decline or delete the event in your calendar, the server sends your answer to the organiser. Deleting it with "don't notify the organiser" sends nothing.
Things to know:
- Moving an event to another of your calendars sends nothing. Deleting a whole calendar or importing a file never sends anything.
- Someone you shared a calendar with can change your events, but no invitations go out in your name; the people concerned are marked as "not sent" in the event.
- At most 100 people per event; an event that changes more than 5 times in a minute, or a change past your sending limit, is saved but its invitations are not sent. A person gets at most 50 new events from you a day.
- Programs that still send invitations themselves (an option some offer) are left alone.
Busy times: when you invite people of your organisation, your program
can show when they are busy (only the times, never what they are doing).
PUT /account/api/free-busy with {"shown": false} turns this off for a
mailbox (on by default). People outside your organisation never see your
busy times. Events marked as free or cancelled and invitations you
declined don't count; ones you haven't answered or accepted tentatively
show as maybe busy.
Invitations sent to a group address you belong to (such as all@) are not treated as your own: answer them from your own address.
How scheduling works in detail is in Groupware.
By default every mail domain stands on its own. When several domains belong
to one company (for example example.com and example.de), group them:
create an organisation under Organisations → Add organisation, then
choose it under Organisation on each domain's Settings page.
Rename (there or under Organisations) changes the name in place.
Mailboxes can only share mail, calendars and contacts with mailboxes of the
same organisation, and the Directory address book lists the mailboxes
of the organisation; nothing else is shared just by grouping. Taking a
domain out lets it stand alone again; deleting an organisation lets all its
domains stand alone. The activity log records every change.
A shared mailbox (for example info@example.com) receives mail and has
folders and a storage limit like any mailbox, but nobody signs in to it: it
has no password and no app passwords. The people who work with it read and
send from it with their own mailbox and their own sign-in.
On the domain's Addresses page, Add mailbox and choose Shared mailbox under Kind of mailbox (no password is asked for). The mailbox list marks it Shared.
Under People with access on the shared mailbox, Give a person access and tick what they may do:
| Right | What the person can do |
|---|---|
| Read | see the folders and messages; mark them read or unread for themselves |
| Write | also flag, move and delete messages, create, rename and delete folders (includes Read) |
| Manage | the shared mailbox's out-of-office reply, forwarding and filters (see For a shared mailbox) |
| Send as | send with the shared address as sender |
| Send on behalf | send for the shared address, showing who sent it |
- Only personal mailboxes of the same organisation can get access (see Organisations); a domain that stands alone is its own organisation. Administrators cannot cross organisations either.
- At most 100 mailboxes per shared mailbox.
- Changes take effect at once. When access is taken away, a mail program that has one of its folders open is disconnected and no longer shows them after reconnecting; when Write is taken away, the open folder becomes read-only.
- If a domain later moves to another organisation, access across the new boundary stops working and shows as not in effect; it works again when the domains are grouped again.
Nothing needs to be set up: the folders of every mailbox a person may read
appear in their own account under Shared, for example
Shared/info@example.com/INBOX and Shared/info@example.com/Sent
(Thunderbird, Apple Mail and iOS show them by themselves; they are always
subscribed, so programs that show only subscribed folders show them too).
Mail programs never take these folders as the person's own Sent, Drafts or
Trash. Messages can be copied and moved between one's own folders and
shared ones as far as the rights allow; moved mail counts towards the
storage limit of the mailbox it lands in. Personal folders cannot be named
Shared/<address>/….
Read state: in a shared mailbox everyone has their own read and unread state, so a message one person read stays unread for the others; flags and everything else are the same for all. Messages that were already read before the mailbox became shared, and imported messages, start as unread for everyone. In a personal mailbox shared with an assistant (see below) the read state is the owner's, shared by everyone with access, and Read alone means nothing can be changed there.
- Send as: the message goes out from the shared address (or one of its forwarding addresses); receivers see only the shared address.
- Send on behalf: the message goes out from the shared address with the person's own address as Sender; many receiving programs show "Anna on behalf of info@example.com". This needs a mail program that sets the Sender field; most do not offer it, so give Send as if people use Thunderbird, Apple Mail or iOS.
To send as the shared address, add it as another sender address in the mail program, using the person's own account and outgoing server:
- Thunderbird: Account Settings → Manage Identities… → Add: your name and the shared address as Email Address. Choose it in the From field when writing.
- Apple Mail (Mac): Settings → Accounts → the account → Email Address → Edit Email Address… → add the shared address. It then appears in the From menu.
- iPhone and iPad: Settings → Mail → Accounts → the account → Account → Email → Add Another Email.
Replies and bounces go to the shared mailbox. The sending limits of the shared mailbox and of the person both count; a shared mailbox that was stopped from sending cannot be sent for.
Keep a copy of mail sent for this mailbox in its Sent folder: stores everything sent for it there (marked read for the sender), so the team sees what was answered. If the mail program also saves a copy there, it is not stored twice.
A person can share their personal mailbox with colleagues of the same
organisation (for example an assistant who reads and answers the boss's
mail), with the same rights, through the account API
(PUT /account/api/delegations). Administrators see these shares under
Sharing on the mailbox's page and can remove them (for people who
left), but not add them.
- Make shared removes the mailbox's password and app passwords, signs out every mail program and its account sessions, and ends its access to other mailboxes. The mail stays.
- Make personal needs a new password; people who had access keep it, now as if the owner had shared the mailbox. Keeping copies of sent mail is turned off.
Import mail works for shared mailboxes as for any other.
A room or equipment (for example room2@example.com or a projector) is a
mailbox nobody signs in to, like a shared mailbox. People of the
organisation book it by inviting it to an event in their calendar
program; its calendar answers at once, before the program hears back from
the server.
Add mailbox, choose Room or equipment, an address and a display name ("Meeting room 2"). It has no password. Existing mailboxes can be turned into one with Make a room or equipment (a personal mailbox loses its password and app passwords, as when making it shared). Make shared turns it back into a shared mailbox and removes its booking rules; Make personal needs a password.
Booking rules on the page of the room or equipment, saved with Save booking rules:
| Rule | Default | Effect |
|---|---|---|
| What it is | room | Calendar programs show a room or equipment |
| When someone books it | at once | Wait for approval: free times are held until someone with write access accepts or declines |
| Who may book it | everyone of the organisation | A list of personal or shared mailboxes of the organisation. A shared mailbox listed lets everyone with write access to it book from its team calendar |
| Days ahead | 365 (1 to 730) | How far ahead it can be booked. A series that runs longer is accepted when its dates within this time are free |
| Longest booking | 480 minutes | Longer dates are declined |
| Minutes per organiser | 2400 | What one organiser may have booked within the days ahead, all bookings together |
| People it holds | not given | For information only |
An invitation is declined as a whole when any of its dates collides with another booking or a blocked time, breaks a rule, has more than 500 dates within the days ahead, or lies entirely in the past or beyond the days ahead. Events that repeat more often than hourly, extra dates with a length of their own, and times without a time zone are declined too. The organiser's event then shows the room as declined, with the reason (for a collision, up to three of the dates); rescheduling the event to free dates books it again. Someone not allowed to book gets no answer from the room.
Give people access under People with access, as for a shared mailbox:
- Read: they see the room's calendar with every booking (title, times, location, organiser and attendees; no descriptions, attachments, links or alarms).
- Write: they also accept, decline and cancel bookings there (they cannot move them: the times stay the organiser's), and with Wait for approval they get a mail when a request waits (at most one an hour per event). Accepting a request that now collides with another booking is refused. They can also block a time with an event of their own (repairs, cleaning).
Everyone of the organisation sees when a room or equipment is busy, in the free/busy view of their calendar program; nobody can hide this. Invitations from outside the organisation (and from other organisations on this server) arrive as ordinary mail in the room's inbox and are never answered.
Not tested with real programs yet: the room pickers of calendar programs (Apple Calendar's location search in particular). Rooms work everywhere when added as an attendee by address.
Every mailbox can sort its incoming mail and answer it automatically. The person sets this up through the account API or in a mail program that can edit server filters (see below); administrators set out-of-office and forwarding on the mailbox's page. Filters run when mail arrives, for mail from outside and for mail between mailboxes of this server, so an out-of-office reply also answers colleagues.
-
Out-of-office reply: on or off, a subject, the text, an optional first
and last day, and how often the same sender gets it (once every 1 to 90
days, 7 by default). It is sent only when the mailbox's address (or a
forwarding address that delivers to it) is in To or Cc, and never to
mailing lists, automatic messages, bulk mail, the empty sender,
MAILER-DAEMON,owner-…,…-request,LISTSERV, its own address, or mail judged as spam. It goes only to senders whose address is confirmed: SPF passed for the sender's domain, or a DKIM signature of that domain passed (mail between mailboxes of this server always counts). Senders of domains without SPF or DKIM get no reply, so forged senders never receive one. Replies are signed for the domain and count against the mailbox's sending limit; when the limit is reached, or sending is blocked for the mailbox, no reply is sent (the mailbox is not blocked for it). - Forwarding: every message also (or only) goes to another address.
- Filters: rules of conditions (from, to or cc, subject, mailing list; contains or is; all or any of them) and actions (move to a folder, mark as read, forward to an address, delete). The first rule that matches ends the list. At most 50 rules.
On the mailbox's page, the Rules group lists the filters. Each rule is
added and changed on a page of its own (/rules/new, /rules/<place in the list>, with ?mailbox=<address> for a mailbox the person manages), which
saves it as soon as it is added or changed; Cancel and the browser's
back button return to the list. Moving a rule up or down and deleting one
take effect at once too.
Mail judged as spam still lands in Junk unless a filter moves it somewhere else; it is never forwarded and never answered. A filter that fails, or a folder that no longer exists, keeps the message in the inbox: filters never lose mail. Forwards and replies leave only once every mailbox the message is for has stored it, so a message the sender has to send again is never forwarded twice.
Forwarding by filters follows the same rules as forwarding addresses (rewritten return address, the domain's hourly limit) and in addition: they count against the mailbox's own hourly and daily limits, nothing is forwarded while sending is blocked for the mailbox, at most 5 addresses per message, never to the mailbox's own addresses, and not for mail that this mailbox already forwarded once (two mailboxes that forward to each other stop after one round). The activity log notes a message that was not forwarded and says why.
For someone who left: open the mailbox, Out-of-office and forwarding: set or clear an out-of-office reply and forwarding for it. The activity log records it, and the person sees who set it. The web interface shows whether an out-of-office reply is on (also in the list of mailboxes), but not the text the person wrote, nor one written for the mailbox by someone with the Manage right; it shows the text only when an administrator set it. Saving there replaces what the person set up. There you can also turn off Filters of this mailbox may forward mail (on by default).
When the person's filters were written in a mail program, the web interface shows that and offers to replace them.
Nobody signs in to a shared mailbox, so the people with the Manage right on it set its out-of-office reply, forwarding and filters (see Give people access); administrators can too, as for any mailbox.
- Through the account API,
?mailbox=<shared address>on/filters,/out-of-office,/forwardingworks on that mailbox instead of their own. The same works for a personal mailbox someone shared with them with Manage (for example an assistant who sets the boss's out-of-office reply). Whether someone may still do it is checked on every change. - The filters run when mail for the shared mailbox arrives. The out-of-office reply comes from the shared address (or one of its own forwarding addresses), never from the address of the person who set it.
- Read state: a filter's "mark as read" has no effect in a shared mailbox: everyone there has their own read state, so new mail stays unread for everyone. Moving, deleting, forwarding and other flags work as usual.
- In a mail program that edits filters (below), sign in with your own address and password and enter the shared address as the user to act for (the setting is usually called authorization; the Sieve add-on for Thunderbird has it in its server settings). The program then shows the shared mailbox's filters.
Mail programs that can edit filters on the server connect to the mail server name on port 4190 with STARTTLS and sign in with the full address and the mailbox password or an app password (with Only allow mail programs with app passwords on, only an app password works). The connection is encrypted before any password is sent.
In Thunderbird this needs the add-on Sieve. In its
settings for the account: server = the mail server name (for example
mail.example.com), port 4190, security STARTTLS, user name = the full
address, password = the mailbox password or an app password. Other programs
and phones that speak ManageSieve take the same settings.
- A mailbox keeps up to 10 filter scripts of at most 64 KB each; one of
them is active at a time. The filters set through the account API or by
an administrator are the script called
ownmail. - A script with a mistake is refused with the line and the problem; it is not saved, so the filters in use stay as they were.
- The active script cannot be deleted; switch to another one (or to none) first.
- Changing the password, revoking the app password or deleting the mailbox signs the program out at once. Three wrong passwords end the connection, and too many from one network hold back further tries for a while, as for IMAP.
A forwarding address (Add forwarding on the domain's Addresses
page, or in the sidebar; each one has its own page at
/admin/#/domains/<domain>/forwarding/<address>) delivers to one or more mailboxes of this server or to outside
addresses, at most 50. All other addresses catches mail to every
address of the domain that has no mailbox or forwarding of its own.
Where the web interface asks where mail goes (Deliver to of a forwarding address, Forward to of a mailbox or a filter), typing suggests matching addresses: for administrators every mailbox and forwarding address of the server, for the people with a mailbox the mailboxes of their organisation. Pick one, or type any other address and press Enter or a comma; each address shows as a chip, and Backspace in the empty field removes the last one. Pasted lists separated by spaces, commas or semicolons are split into addresses. A mailbox and a filter forward to one address, so a new one replaces the old.
Mail forwarded to an outside address keeps its original sender in the message, but the server uses a rewritten return address so that the receiving server still accepts it; bounces come back and reach the original sender. Mail judged as spam is not forwarded.
postmaster@ and abuse@ of every domain always receive mail: through a
forwarding address of that name if there is one, else into the domain's
first mailbox, else to the postmaster address from the settings. The
postmaster address may be outside (at another provider): then that mail is
forwarded to it like a forwarding address. Without one, that mail is held
back and Server status warns.
A forwarding address that delivers to several mailboxes is a distribution group. Who may write to this address limits who can send to it:
- Anyone (default): also people outside the organisation, for example customers.
- Only addresses of this organisation.
- Only its members: the addresses it delivers to (and their forwarding addresses, or a member sending as a shared mailbox).
Mail from anyone else is refused with "This address accepts mail only from certain senders". Mail arriving from outside under one of your own addresses must pass that domain's sender checks (SPF or signature), as all such mail does, so faking a member's address does not get through. Only the address written to is checked, not groups it forwards to. Not available for the catch-all.
Hide from the address book keeps the address out of the organisation's Directory address book.
| Default | |
|---|---|
| Storage per mailbox | 5 GB |
| Messages per mailbox | 100 per hour, 500 per day (at most 10 000 and 100 000) |
| Messages per domain | 300 per hour |
| Size of a message | 50 MB |
| Recipients of a message | 100 |
| Mailboxes with access to one mailbox | 100 |
Administrators change the limits of a mailbox with Limits on it. One message counts once, whatever the number of recipients.
A message nested more than 20 levels deep (attachments inside attachments) or with more than 500 parts is delivered whole, but mail programs see everything below that as one attachment, and searching on the server does not look into it.
When a mailbox hits its hourly limit three times in a day, or signs in from more than ten different networks in an hour, the mail server stops it from sending (receiving goes on) and the activity log says so. Only an administrator can allow it to send again, with Allow sending on the mailbox. Change its password first if it may have been stolen.
Server status shows whether the mail service runs with the latest changes, the connections it accepts, the certificate and the mail waiting to be sent, and under How the mail server is doing, looked up the way other mail servers see it:
- the mail service runs with the current settings,
- the mail server name points at this server's addresses,
- the mail server name has an SPF record that allows this server
(
v=spf1 a -all, oraadded to an existing one): bounces and mail forwarded to other servers are sent under that name, - each address of the server has the mail server name as reverse name,
- connections to port 25 of other mail servers get through,
- the certificate is valid,
- every port is listening (another mail program may hold one),
- postmaster mail has somewhere to go,
- no blocklist refused to answer this server in the last 7 days,
- the server's public addresses are not on the blocklists receivers commonly use (Spamhaus, SpamCop, PSBL, Mailspike; see Checking delivery),
- mail programs, calendars and contacts can connect to the mail server name securely.
When something needs an administrator, OwnMail sends them a mail instead of waiting until someone opens the administration. The administrators of the whole server get one when:
- the mail server's certificate expires in less than 14 days (it is renewed well before, so renewing failed) or has expired,
- the server's disk is nearly full: below twice the free space the mail service needs to accept mail (1 GB), and again once it refuses new mail,
- a backup failed (one cut off because OwnMail stopped is not: it runs again after the start),
- a place for backups had no backup that worked for longer than its set number of days,
- a public address of the server is on a blocklist (not while mail goes through a relay, see Checking delivery).
About a domain, its administrators get one too (and those of the whole server) when:
- a mailbox was stopped from sending because it behaved as if its password was stolen (see Limits),
- DNS records the domain needs are missing or have another value, in two checks in a row; each active domain is checked every 6 hours, and a check whose lookups fail counts for nothing,
- the certificate of the domain's own name for mail programs expires in less than 14 days or has expired,
- other servers reported that they could not deliver to the domain encrypted: at least 3 connections and one in twenty in the reports of the last three days (see reports about encrypted delivery).
The mail comes from no-reply@<mail server name> to each administrator's
e-mail address, with a link to the page that shows more. What is found at
the same time comes in one mail. While a problem lasts, the mail is sent
again once a week; when it is over, no mail is sent, and if it comes back,
a new one is. OwnMail looks every hour, right after each backup and when a
mailbox is stopped from sending. Each mail sent is listed under
Activity. No mail goes out while the mail server name is not set.
Each administrator turns the mails off or on for themselves under Mails about problems in the account menu (the round button with their initials at the bottom of the sidebar); the list of administrators shows who gets them. Turning them off needs a sign-in with a password, not an access token.
The Overview shows under Mail traffic how much mail flowed in the last 24 hours or 7 days, with a chart of received and sent mail per hour. The counts are the whole server's, so only administrators of the whole server see them:
- Received: messages from other servers that were accepted, counted once per message however many mailboxes got it.
- Sent: recipients on other servers the mail was delivered to. Below it, how many recipients could not be reached in the end (a bounce went back to the sender).
- Turned away: recipients and messages refused for good: unknown addresses, mail the sender's domain asks to refuse, dangerous attachments, a sender that cannot be read, servers on a spam list.
- Junk: received messages that went to the Junk folder.
Only numbers are kept, per hour, for 8 days: no addresses, senders or
content. Mail held back the first time by Hold back first mail from
unknown servers is not counted as turned away (most senders try again
and their mail is then counted as received); the API and the AI programs
report it on its own as greylisted, and messages sent from mail programs
and the web as submitted. The numbers are written every minute, so they
survive a restart.
Whether mail from a domain lands in the inbox elsewhere depends on how other servers see it. Two checks look at it from outside:
-
A test message. A domain's Settings → Delivery check →
Send a test message sends a short message from
ownmail-check-<random>@<domain>to a checking service that answers automatically, by defaultcheck-auth@verifier.port25.com. The message goes out like any mail of the domain: signed with its key, from this server or through the relay. The answer comes back to that address within a few minutes (the mail server takes it in itself, no mailbox needed, ahead of a catch-all) and the section shows what it says: whether the message came from a server the domain allows (SPF), whether its signature was valid (DKIM), whether it followed the domain's rules against forged mail (DMARC), the name of the sending server and the spam filter's verdict, with the whole answer to open below. An answer only counts for the test message sent last, so nobody can make one up; answers are kept for 30 days, at most 20 per domain. Without an answer after 15 minutes the section says so. Administrators of a domain can check it; an access token needs access "write". Another service that answers the same way can be set under Settings → Sending → Checking service for test messages. With the API:POSTandGET /api/mail/domains/{domain}/deliverability; for AI programs the toolscheck_deliverabilityandget_deliverability_check. - Blocklists. Server status looks the server's public addresses up in Spamhaus (the list set under Spam checks, so a Data Query Service key is used here too), SpamCop, PSBL and Mailspike (IPv6 addresses only in Spamhaus), at most every 30 minutes. A listed address is shown there and mailed to the administrators of the whole server; each list's website tells why an address is listed and how to have it removed. While mail goes through a relay, receivers do not see these addresses, so a listing is only shown.
When the hosting provider blocks outgoing port 25 and does not unblock it, mail can go through another mail provider's server instead (a relay or smarthost, for example a transactional mail service). Under Settings → Sending → Relay for outgoing mail → Change, enter its server, port, user name and password. Test connection connects and signs in without sending anything; Save sends all mail to other servers through it from then on, Send directly goes back to port 25.
- The connection is always encrypted and the relay's certificate is checked: port 465 starts encrypted, any other port (usually 587) must offer encryption, or nothing is sent.
- Mail stays signed with each domain's own key. Add the relay provider's
servers to the SPF record of each domain, as the provider describes
(usually an
include:), or receivers may treat the mail as spam. - When the relay cannot be reached or refuses the sign-in, mail waits in the queue and is tried again, as with any server that is down, for up to 5 days.
- The password is stored sealed and never shown again; it is kept when you change the port, but enter it again for another server or user name.
- Only an administrator of the whole server signed in with a password can
set or test the relay, never an access token: a relay sees every
message sent out. With the API:
mail_relayinPUT /api/settings({"host": "", …}removes it) andPOST /api/settings/relay/test.
Server status then shows the relay instead of the port 25 check.
Settings → Spam checks:
-
Lists of known spam senders: by default
zen.spamhaus.org(Use the recommended list). Mail from a server Spamhaus lists as a spam source is refused; a listing on any other list adds points towards Junk. You can Use my own lists or Don't check. Spamhaus answers queries from large public DNS resolvers with a refusal; Server status shows it when that happens. With a free Spamhaus key, enter<key>.zen.dq.spamhaus.net: the key is stored encrypted and only shown masked. - Points for Junk (1–50, default 5): every sign of spam adds points (failed sender checks, suspicious content). Mail with at least this many points goes to the Junk folder and is not forwarded to outside addresses.
- Hold back first mail from unknown servers (off by default): the first message from a server that cannot show it may send for its domain is accepted only when it tries again. Real mail servers do, so such mail arrives some minutes later; much spam never comes back.
Mail that claims to come from one of your own domains but was not sent by its servers (no passing SPF or signature) is refused. So is mail from other servers whose sender (the From line) cannot be read, because it could hide such a claim.
What each check adds is listed in Architecture.
Each mailbox has Import mail and Download all mail (under Moving mail on its page). Both are noted in the activity log.
- Choose Import mail at the mailbox (a page of its own), then From another mail account.
- Enter the user name (usually the full address), the password and the incoming mail server your provider names for mail programs (for well-known providers it is filled in from the address). Keep the encrypted connection (port 993) unless the provider says otherwise.
- Check the account: OwnMail signs in and lists the folders with the number of messages and their size, and whether they fit into the mailbox. Nothing is copied yet. Untick folders you don't want; junk and deleted mail are left out unless you switch them on.
- Start copying. The import runs on the server; you can close the page. The mailbox shows its progress, what was copied, skipped as already there or not copied, and the messages that were left out with the reason.
The old account is only read: its messages stay unread there and nothing is deleted. The password is used while copying and never saved, so an import that was paused (the provider limits downloads per day; Gmail allows about 2.5 GB a day) or interrupted (OwnMail was restarted) asks for it again under Continue and goes on where it stopped.
Providers:
-
Gmail: needs an app password: turn on 2-step verification in your
Google account, then create one under Security › App passwords and enter
it instead of your password. Google Workspace administrators can forbid
this. Server
imap.gmail.com. Large Gmail accounts are better moved this way than with Takeout (no file size limit, can be repeated). -
Yahoo: also an app password (Account security), server
imap.mail.yahoo.com. iCloud: an app-specific password from account.apple.com, serverimap.mail.me.com. - IONOS, Strato, GMX, web.de and others: the normal password usually works; some (GMX, web.de) need access by mail programs turned on in their settings first.
- Microsoft 365 and Outlook.com are not supported yet: they only allow a sign-in through Microsoft's own page. Export the mail as a file, or move it with a mail program that has both accounts.
Choose From a file and upload a .mbox, .eml or .zip of those (up to
20 GB). The file is sent in parts; if the connection breaks, the upload goes
on where it stopped; stay on the page until it is done (leaving it stops the
upload). OwnMail then reads the file and shows the same folder overview. A
file that was read but not started yet stays in the mailbox's list of
imports; Choose folders and start there opens the folder overview again.
- Google Takeout: at takeout.google.com select only Mail, choose the .zip format (not .tgz), download it and upload the zip. Gmail labels become folders; mail without a label goes to Archive.
-
Thunderbird: right-click a folder and export it (with the ImportExport
add-on) as
.mbox, or put theMail/ImapMailfolder of your profile into a.zip: subfolders are recognised. -
Apple Mail: Mailbox › Export Mailbox, then compress the exported
folder into a
.zip. - A
.zipfrom Download all mail brings back every folder with its read and flagged state, and includes Junk and Trash.
- Add the domain and create the mailboxes; leave the MX record pointing at the old provider for now. Use Receive mail here now if you want to import before the MX record moves.
- Import each mailbox from the old account.
- Switch the MX record to this server (see Set it up) and set up the mail programs.
- A day later, run the same import again: only mail that arrived at the old provider in between is copied; what is there already is skipped.
Download all mail gives one .zip with a .mbox file per folder and a
list of the folders. Thunderbird (ImportExport add-on), Apple Mail and most
mail programs can open the .mbox files; OwnMail imports the zip back
without loss. One download per mailbox runs at a time.
The zip also holds the mailbox's calendars (calendars/<name>.ics) and
address books (contacts/<name>.vcf). Importing the zip into a mailbox
brings back the mail only; import the calendar and contact files through
the account API.
Large providers judge new addresses by their history. For the first weeks,
send moderate amounts of mail that people expect and answer, check the
blocklists Server status mentions, send a test message from each domain
(see Checking delivery), and keep the DMARC record at p=none
until everything is signed correctly. Raise it to p=quarantine later.
Administrators lists everyone who can sign in to the administration
(/admin/). Add administrator asks for an e-mail address, an initial
password and what they manage; each administrator changes their own
password with Change password.
There are two kinds of administrators:
- The whole server: every domain, mailbox and setting. Everyone who was an administrator before this choice existed stays one of these.
- Only some domains (for example one customer's): they choose the domains when adding someone, or later with Change domains on the administrator's row. Such an administrator sees only these domains with their mailboxes, forwarding, records and organisations, and manages them as anyone would: mailboxes, passwords, app passwords, forwarding, sharing, out-of-office, AI access, moving mail in and out. Domains they don't manage, and everything in them, don't exist for them: asking for one answers "not found", the same as for a domain that isn't there. What stays with administrators of the whole server: adding and deleting domains, turning on receiving before the domain's mail points here, raising limits or removing the quota, letting a blocked mailbox send again, restoring from backups, and everything about the server itself (other administrators, settings, server status, mail traffic, spam checks, backups, updates, the activity log). The sidebar shows them only their domains.
Some details for administrators of some domains:
- Forwarding and aliases may deliver to an address in another domain on this server, as to any address outside; that gives no access to the other domain.
- Organisations they see are the ones with one of their domains (and ones without domains they made themselves), listing only their domains. They rename or delete an organisation, or put a domain into it, only when all its domains are theirs, since the mailboxes of an organisation share an address book and calendars. Giving access to a shared mailbox or booking a room works only for mailboxes in their domains.
- Access tokens they make, and programs they connect by signing in, act as them: the same domains and nothing more. A change of their domains takes effect at once, also for their tokens, programs and open sessions.
- The last administrator of the whole server cannot be removed or limited to some domains, and nobody changes what they manage themselves. A session ends after 3 days without use and after 30 days in any case. Wrong passwords hold back further tries for 15 minutes: after 5 for one address from one client, or 50 for one address from all clients together; a client with many wrong tries for different addresses is answered "too many attempts" for further wrong ones, but a right password still signs in. These counts survive a restart. A lost password is reset on the server, see Reference.
Each administrator can ask for a second step after the password: a code from an authenticator app on their phone (Google Authenticator, Microsoft Authenticator, Aegis, or a password manager that shows sign-in codes). Someone who learns the password still cannot sign in.
- Turn it on under Two-factor sign-in in the account menu (or with the button next to your own row in Administrators): Set up shows a code to scan and the key to type in by hand; enter the 6-digit code the app shows and choose Turn on.
- You then get ten backup codes, shown only this once. Each one signs you in one time instead of a code from the app; keep them apart from your phone. New backup codes replaces them (the old ones stop working).
- From then on, signing in asks for the code after the password. Codes from the app change every 30 seconds and each works once; wrong codes are held back after 5 within 15 minutes. The step must be finished within 5 minutes of the password.
- Turn off needs a code from the app or a backup code too, so a computer left signed in is not enough. Setting it up, turning it off and new backup codes only work when signed in with a password, never with an access token.
- Access tokens are not affected: programs using one keep working without a code. Programs connected by signing in ask for the code when they are connected, not afterwards.
-
Lost the phone and the backup codes?
ownmail admin reset-passwordon the server sets a new password and turns two-factor sign-in off for that administrator.
The app's key is stored encrypted with the server's secret.key; without
that file nobody with two-factor sign-in can sign in until it is reset on
the command line. Backup codes are stored only as fingerprints.
Administrators can set any mailbox's password, and with it read the mailbox and its calendars and contacts; they can also download all of its mail, calendars and contacts. Mailbox owners should know this.
Activity lists what was changed, by whom (an administrator, a mailbox through its own account, or the mail service), and what the mail service reported (a blocked mailbox, an import that finished, mail that was not forwarded). It never shows passwords or message contents.
Everything in the web interface is also available under /api/. Sign in
with POST /api/session and {"email", "password"}; the answer sets a
session cookie. With two-factor sign-in on, it answers 202 with
"code": "two_factor_required" and a short-lived cookie instead; finish
with POST /api/session/two-factor and {"code"} (a code from the app or
a backup code), which sets the session cookie. Every changing request with the cookie needs the header
X-Ownmail-Request: 1. CONTRIBUTING.md has a short
example. Errors are {"error": "…"}.
| Area | Routes |
|---|---|
| Setup and session |
GET/POST /api/setup, GET/POST/DELETE /api/session, PUT /api/session/password, POST /api/session/two-factor, PUT /api/session/notices ({"on": false} turns the mails about problems off; signed in with a password only) |
| Two-factor sign-in |
GET /api/session/two-factor, POST /api/session/two-factor/setup, POST …/enable, POST …/disable, POST …/backup-codes (with {"code"}; signed in with a password only) |
| Administrators |
GET/POST /api/admins ({"email", "password", "all_domains", "domains"}; without either, the whole server), PUT /api/admins/{id}/access ({"all_domains": false, "domains": ["example.com"]}), DELETE /api/admins/{id}
|
| Settings |
GET/PUT /api/settings (mail_host, postmaster_address, server_ips, acme_email, mail_blocklists, mail_blocklists_default, mail_junk_score, mail_greylisting, mail_check_service ("" for the default); values set by flag are locked) |
| Status |
GET /api/mail/status, GET /api/mail/traffic?range=24h|7d (hourly counts: totals and series), GET /api/mail/health, GET /api/mail/readiness?host=, POST /api/mail/checks/outbound, GET /api/activity
|
| Reverse proxy |
GET /api/mail/proxy-certificate?domain=<name> (no sign-in): 200 when <name> is autoconfig. or autodiscover. of an active domain, else 404; Caddy's on_demand_tls ask (see Docker) |
| Domains |
GET/POST /api/mail/domains, GET/DELETE /api/mail/domains/{domain} (delete with {"confirm": "<domain>"}), POST …/check, POST …/activate, GET …/records, PUT …/mta-sts ({"mode": "enforce"}), GET …/tls-reports, GET/POST …/deliverability, PUT …/organisation, PUT …/may-use-ai, PUT …/client-host ({"name": "mail.example.com", "record": "cname"} or "address"; {"name": ""} removes it) |
| Mailboxes |
GET/POST /api/mail/domains/{domain}/mailboxes, GET /api/mail/mailboxes, GET/PATCH/DELETE /api/mail/mailboxes/{id}, POST …/password, PUT …/kind, PUT …/keep-sent-copy, PUT …/booking, PUT …/grants, DELETE …/grants/{grantee}, GET/POST …/app-passwords, DELETE …/app-passwords/{app}, POST …/unblock, POST …/two-factor/off, GET …/rules, PUT …/out-of-office, PUT …/forwarding, PUT …/may-forward, PUT …/may-use-ai, GET …/apple-profile, GET /api/mail/mailbox-kinds
|
| Forwarding |
GET/POST /api/mail/domains/{domain}/aliases, GET /api/mail/aliases, GET/PUT/DELETE /api/mail/aliases/{id}
|
| Organisations |
GET/POST /api/mail/organisations, PATCH/DELETE /api/mail/organisations/{id}
|
| Import and export | below /api/mail/domains/{domain}/mailboxes/{local_part}: POST /imports/check, POST/GET /imports, GET/DELETE /imports/{id}, POST /imports/{id}/start, POST /uploads, PUT /uploads/{id}?offset=N, GET /export
|
Passwords of other accounts given for an import go to the mail service only and are never stored, logged, returned or written to the activity log.
In <data>/mail, next to OwnMail's own database <data>/ownmail.db, its
secret key and its certificates (see Architecture).
Calendars and contacts are stored there too, next to the mail. Deleting a
mailbox or a domain deletes its stored mail, calendars and contacts. Back
up the whole data directory.
- The domain stays waiting for its mail records: its MX record does not name the mail server yet, or the change has not reached its nameservers. The page shows what was found.
- Mail to Gmail or Outlook lands in spam or is refused: check Server status (reverse name, blocklists), that all records show as in place, and that outgoing port 25 is unblocked (or a relay is set up, with its servers in each domain's SPF record).
- Mail programs cannot connect: check that 993, 465 and 587 (and 4190 for filters) are open in the firewall and that the certificate check in Server status is ok.
-
Logs: OwnMail's log (
docker logs ownmail, orjournalctl -u ownmailwith systemd). Logs never contain message contents or passwords.
This wiki is copied from docs/ in the repository; changes go there, in a pull request.