Project OWNOpen Web Node
GitHub

05Hosting

Email

Project OWN (Open Web Node) can host email for your sites' domains: mailboxes, forwards, mail signed so it arrives, a spam filter that learns, and webmail. It's optional, and uses about 40 MB of memory.

What you get

  • Postfix sends and receives, Dovecot keeps the mailboxes, and OpenDKIM signs outgoing mail. All three come from the system's own packages, so they get its security updates.
  • A mail domain is a site's domain: you@shop.example.com belongs to the site shop.example.com.
  • Any mail app works, with the site's own certificate.
  • Mail is part of the site's backups, and can be restored on its own.

Before you rely on it

Mail your server sends only arrives if other mail servers trust it. Check first:

  1. Open Doctor and click Check email sending under Email. It checks that port 25 is open for sending, that the server's address has a reverse DNS name, and that it isn't on spam blocklists. To do that, it asks a few outside services: OpenDNS (for the server's public address), Gmail's mail server and three spam blocklists.
  2. Many cloud providers block port 25 at first. If the check says so, ask your provider to open it.
  3. Ask your provider to set the reverse DNS (PTR) of the server's IP address to the mail server's name. On the Email page, admins can set that name under Mail server name; empty means the first domain with email.

Install email

Open Email and click Install email (or install Email from Packages). It opens ports 25, 465, 587 and 993 in the firewall. On a cloud server, open them in the provider's firewall too.

Turn on email for a site

  1. On Email, under Turn on email for a site, pick the site and click Turn on.
  2. Add the DNS records the page shows (below), so mail finds its way.
  3. Add mailboxes.

The site needs a certificate for mail apps to trust it: get a free one if it hasn't got one yet.

DNS records

Each mail domain's card has a DNS records section. Add each record at the company that runs the domain's DNS, using the copy buttons, then click Check DNS: each one shows Found, Missing or Different.

RecordWhat it does
MXTells other servers to deliver the domain's mail here. Mail needs this one.
SPFSays which servers may send the domain's mail.
DKIMThe public key that proves the domain's mail is signed by this server.
DMARCTells other servers what to do with mail that fails those checks.

The others make sure mail from the domain arrives instead of landing in spam. Doctor warns when the MX record is missing ("Mail for DOMAIN doesn't come here") or the DKIM record is ("Mail from DOMAIN isn't signed in DNS").

Mailboxes

  1. In the domain's card, under Mailboxes, type the part before the @ (such as alice) and pick a size limit: 1 GB, 5 GB, 10 GB or No limit.
  2. Click Add mailbox.
  3. Save the password shown, with the settings for mail apps: it isn't shown again. You can always make a new one.
  • The list shows how full each mailbox is.
  • New password makes a new one. The old one stops working at once, in every mail app that uses it.
  • Size limit changes the limit.
  • Delete deletes the mailbox and its mail (the site's backups still have it). Mail sent to it afterwards bounces.

Set up a mail app

Outlook, Apple Mail, Thunderbird, a phone's mail app: any of them works with these settings. The username is always the whole address.

ServerPort and security
Reading mail (IMAP)The domain, such as shop.example.com993, SSL/TLS
Sending mail (SMTP)The same465, SSL/TLS (or 587, STARTTLS)

Signing in needs TLS. Signed-in people can send only as their own address, or as a forward that comes to them, so one mailbox can't pretend to be another. Strangers can't send mail through the server.

Forwards

A forward sends an address on to mailboxes here or to addresses anywhere, such as info@ to two people.

  1. In the domain's card, open Add a forward.
  2. Type the address (such as info) and, under Goes to, one or more addresses separated by commas.
  3. Click Add forward.

The mailboxes here that a forward goes to can also send as its address. Remove deletes a forward; mail sent to it afterwards bounces.

The spam filter

Without it, every message that arrives lands in the inbox. With it, Rspamd checks the mail that arrives:

  • mail that looks like spam goes to the mailbox's Junk folder;
  • obvious spam is refused;
  • every message gets an X-Spam-Status header with its score.

It checks block lists, SPF, DKIM, DMARC and Rspamd's shared fingerprints of known spam (fingerprints only, never the mail itself). Mail you send, and mail the server makes itself, isn't held back.

To add it, click Install the spam filter under Spam filter and webmail on the Email page, or install Spam filter (Rspamd) from Packages. It takes about 125 MB of memory, and isn't offered on servers with less than 1 GB.

How it learns

The spam filter learns what spam looks like for your server, from two things:

  • mail that's clearly spam, or clearly not;
  • what people move in any mail app: moving a message into Junk teaches it "spam", and moving one out of Junk teaches it "not spam".

What it learns stays in a store only the spam filter can open. It starts using what it learned once it has seen 200 of each, spam and not spam, and the Email page shows how far along it is.

Rspamd's own web interface stays off, since it trusts anyone on the server.

Webmail

Webmail lets people read and send mail in the browser. It's Roundcube webmail, from the app catalogue.

  1. On the Email page, click Add Roundcube from Apps (or find it on Apps, under Email).
  2. Click Install, give it an address such as webmail.example.com, and point that at the server.
  3. Get its site a free certificate.

The Email page then shows where webmail is. People sign in with their mailbox's full address and its password. It needs email installed, and a server has one. Wrong passwords typed into it ban the person typing them (with fail2ban), never the webmail itself.

The mail log

Each domain's card has a Mail log button for people who manage its site: what the mail servers did with mail to and from the domain, newest at the bottom. Look here when a message didn't arrive.

Backups of mail

A site's email is in its backups. To bring mail back, restore a backup of the site and choose Email only: the domain's mailboxes come back as they were then, and mail that came since is lost. Restoring the site itself never touches its email. See Restore a backup.

Turn email off for a domain

Click Turn off email on the domain's card. Its mailboxes and forwards are removed, and mail sent to the domain bounces. Its mail stays on the server, and comes back if you turn email on again, unless you tick the box to delete it now.

Keeping it safe

  • Only mailboxes made in the panel can sign in, never the server's own Linux accounts.
  • Passwords are stored only as hashes, in a file only Dovecot can read.
  • With fail2ban installed, addresses that keep guessing mail passwords are banned.
  • Every change (domains, mailboxes, new passwords, size limits, forwards) is in the activity log. Changing a domain's email needs manage access to its site.

Moving from cPanel? Mail accounts come over with their passwords and mail: see Moving in from cPanel.

Something wrong or unclear on this page? Open an issue on GitHub.