Skip to content

Mail server ​

This page covers the email services on hosting servers: setup, sending limits, email DNS checks, routing, the queue, delivery tracking, webmail, Calendars & Contacts, mailing lists, the Rspamd web interface, IPv6, and automatic email client configuration. It is written for admins and technicians.

Components ​

ServicePurposePorts
PostfixMail transfer agent (SMTP), sending and queue25, 465, 587
DovecotIMAP/POP3 server, mailbox storage, Sieve filters993, 995
RspamdSpam filter and DKIM signinglocal
RoundcubeShared webmail at https://<hostname>/webmail/, also at https://webmail.<domain>443
Radicale (optional)Calendars & Contacts (CalDAV/CardDAV) at https://<hostname>/dav/443

Postfix and Dovecot use the server hostname's Let's Encrypt certificate when there is one. Both are reloaded automatically after the certificate is renewed. See Server hostname certificate.

Email ports are opened and closed in firewalld through Security › Network & Access › Firewall ports. These ports are not protected, so they may be closed if the server does not serve email. See Security › Firewall ports.

Email & webmail page ​

Open Servers › (server) › Settings › Email & webmail.

The top shows the status of Postfix, Dovecot, and Rspamd from the agent's last heartbeat: Running, down, or Not reported.

Installing webmail ​

  1. On the Webmail card, click Install / update.
  2. Confirm.

Roundcube is installed at https://srv1.example.com/webmail/. The address is shown under Access URL. Webmail uses the hostname certificate, so the install fails if the hostname does not have a valid certificate yet.

After an update, existing webmail sessions may need to log in again.

Clients and staff open webmail from the panel with a one-time link, without typing the mailbox password:

  • the link is valid for 60 seconds and can be used once;
  • the session lasts 8 hours, with one active session per mailbox;
  • the session ends when the mailbox is disabled or deleted, the account is suspended, or the mailbox password changes.

Roundcube still accepts a regular login with the mailbox password.

Webmail on the client's domain ​

Once webmail is installed on the server, the same Roundcube also opens at https://webmail.<domain> for every main domain, addon domain, and alias of a website, like the webmail subdomain proxy on cPanel. The browser keeps showing the client's domain, and / goes to /webmail/. The client panel's Email page shows this address.

  • DNS. The Standard (web + mail) zone template has an A/AAAA record for webmail. For existing zones or zones at an external DNS provider, add an A record webmail pointing to the server IP, or a CNAME to the server hostname.
  • SSL. When the website's certificate is issued, webmail.<domain> is included if its DNS already points to this server. Names that still point to an old server or go through the Cloudflare proxy are skipped. If the issue fails because of the webmail name, it is retried without it, so the website's certificate is not affected.
  • Turning it on for existing websites. After upgrading, click Re-apply virtual hosts in Settings › Web server, then issue the website's SSL again (or wait for the automatic renewal).

Calendars & Contacts ​

Calendars & Contacts lets every mailbox sync its calendars and contacts with phones and email apps over CalDAV and CardDAV, like Calendars and Contacts on cPanel. It runs Radicale at https://<hostname>/dav/, on the same hostname as webmail.

To install it, open the server's Setup wizard, step Email, and click Install on the Calendars & Contacts row. It needs the mail stack and the hostname certificate. Running it again (Repair) fixes the configuration. See Servers › Setup wizard.

  • Users sign in with the full email address and the mailbox password. Disabled mailboxes and accounts whose email login is turned off cannot sign in.
  • Each user only sees their own calendars and contacts.
  • Deleting a mailbox, or turning off email for its domain, deletes its calendars and contacts.
  • The client panel's Email page shows a Calendars & Contacts card with setup steps for iPhone/Mac, Android, and Thunderbird once it is installed on the account's server.

Not in account backups

Calendar and contact data is stored in /var/lib/radicale, outside the account's home. It does not count toward the account's disk quota and is not included in account backups yet. Calendars and contacts from cPanel are not imported during a migration.

Repairing the mail stack ​

If one of the email services is not running:

  1. On the Mail stack repair card, click Review repair impact.
  2. Read the impact:
    • the Postfix, Dovecot, and Rspamd configurations are rewritten;
    • Sieve filters and per-account sending limits are turned on again;
    • email services restart for a few seconds.
  3. Click Repair now.

INFO

Email arriving during the restart is retried by the sending servers, so it is not lost.

The repair also needs to run once on older servers after an update that adds email features, for example per-account spam thresholds. After updating to v0.9.0-rc.49, run it once on every server: it turns DKIM signing back on and sets up the local DNS resolver for Rspamd.

Rspamd web interface ​

Admins see an Rspamd card at the bottom of the Email & webmail page. It opens the Rspamd web interface: scan history, throughput, symbols and scores, maps, and spam/ham training.

  1. Click Open Rspamd to open it inside the panel, or New tab ↗ to open it in a separate tab.
  2. You are signed in automatically. The session lasts one hour.
  3. Click Close to close the embedded view.

Settings changed in the Rspamd web interface apply to the whole server. Files the panel manages in /etc/rspamd/local.d are written again by Mail stack repair.

Hourly sending limits ​

MoorCP limits the number of recipients per hour for email sent through an SMTP login. The goal is to stop a compromised account from sending spam and damaging the server IP's reputation.

Where limits come from ​

LimitSet inExample package form default
Per accountPackage: Outgoing email/hour (account)300
Per mailboxPackage: Outgoing email/hour (per mailbox)100
Custom per mailboxAccount › Email › Hourly limits-

A value of 0 means unlimited. Limits are counted per recipient in a sliding 60-minute window.

What happens when a limit is exceeded ​

ConditionResult
Over the limitThe message is deferred (450). The email app queues it and tries again later.
Deferred attempts reach 3× the limit within an hourSending from the mailbox is blocked automatically (554).
5 outgoing messages marked as spam by Rspamd within an hourSending from the mailbox is blocked automatically for outgoing spam.

Every automatic block opens the mail_send_blocked alert. Incoming email to that mailbox keeps working.

WARNING

These limits do not yet count email sent through PHP's mail() function or local sendmail. If the agent is down, email is sent without limits until the agent comes back.

Viewing usage and unblocking ​

  1. Open Accounts › (account) › Email.
  2. On the Hourly limits card, click Manage limits.
  3. The table shows each mailbox: Sent, Deferred, Outgoing spam, Limit, and Status.
  4. For a mailbox with the Blocked status, check the cause first, for example change a leaked mailbox password. Then click Unblock.

From the same table you can:

  • click Block to stop a mailbox from sending manually;
  • change one mailbox's limit in Recipients per hour. Enter 0 to follow the package default.

Email DNS checks ​

The panel checks each domain's email DNS records and compares them with the records the panel set up.

  1. Open Accounts › (account) › Email.
  2. On the Domain routing card, click Manage routing.
  3. Click Check DNS on the domain's row.

The check queries public resolvers (what receiving servers see) and the panel's DNS (to see records before propagation).

CheckPasses when
MXPoints to the server hostname or mail.<domain>. For remote routing, there is another MX.
SPFExactly one v=spf1 record that allows the server. include/redirect gives a warning. More than one record is an error.
DKIMThe public key at <selector>._domainkey matches the signing key.
DMARCThere is one v=DMARC1 record. p=none gives a warning.
PTRThe server IP's rDNS matches the server hostname.
PTR (IPv6)Only when outgoing email may use IPv6: the rDNS of the server's IPv6 address matches the hostname.

Each check's result is ok, missing, mismatch, warning, or error, with a suggested fix. Clients run the same check in the client panel under Email › Email deliverability.

Repair DNS records fixes the records in the panel's DNS zone when the zone is hosted by the panel for this account:

  • DKIM is set to the server's signing key.
  • SPF is merged, not replaced: this server (and the SMTP relay, if one is set) is added before all, and the user's own entries such as include:_spf.google.com are kept. Duplicate SPF records are merged into one. Other TXT records are not touched.
  • DMARC is only added when there is none. An existing policy is kept.
  • MX is only added when the zone has no MX and routing is local. An MX that points to another server is not changed.
  • PTR cannot be fixed by the panel.

Running it again changes nothing once all records are correct. When the zone is not hosted by the panel, the window lists the records to add at the DNS provider, with an SPF value that already includes the existing public SPF entries.

PTR

The PTR record (reverse DNS) is set at the IP provider or data center, not in the panel. Match it to the server hostname so email is less likely to land in spam.

If the server's IP has a poor sending reputation, you can send all outgoing email of the server through a smarthost, such as Proxmox Mail Gateway or an SMTP relay service. Recipients then see the relay's IP, so the relay's sending IP must be allowed in the SPF record of each sending domain. See Server settings › SMTP relay (smarthost).

Local and remote routing ​

Routing decides whether email for a domain is accepted by this server.

RoutingWhen to useResult
LocalDefault. Mailboxes live on this server.Email is accepted and stored in this server's mailboxes.
Remote MXThe domain's MX is at another provider, for example Google Workspace.Email from this server to that domain goes out through the external MX. Mailboxes here can still log in to SMTP and send, with DKIM.

To change it, open Manage routing, choose the routing on the domain's row, then confirm.

WARNING

With remote routing, email for that domain is no longer delivered to mailboxes on this server. Make sure the domain's MX already points to the other provider.

Spam filter ​

  • Rspamd scores every incoming email. Email with a very high score (15 or more) is rejected by the server.
  • Email marked as spam is moved to the Junk folder by the "spam to Junk" rule in every mailbox. This rule is on by default.
  • The default server score threshold is 6. Per account it can be changed from 1 to 14 through the Spam threshold card in the account's Email tab.
  • Every mailbox has Always allow (whitelist) and Always block (blacklist) lists under the mailbox Rules.

Per-mailbox filters and autoresponders are covered in Email in the client panel.

Mailing lists ​

Clients create simple mailing lists in the client panel under Email › Mailing lists. A message to the list address goes to all members unchanged. There is no subject prefix, List-* header, unsubscribe link, or archive.

On the server side:

  • The agent's policy service, the same one that enforces sending limits, checks who may send to a list: members and moderators (default), only moderators (announcement list), or anyone. Other senders are rejected with 554 5.7.1. This applies to email from outside and from local mailboxes.
  • Each list has an hourly message limit (default 20, at most 200). Messages over the limit are deferred with 450 4.7.1.
  • Limits: 20 lists per account, 500 members and 20 moderators per list.
  • Lists are removed when their domain's email is turned off or the account is purged.

WARNING

The sender check uses the envelope address, which can be forged. Forged mail from outside is usually stopped by SPF/DMARC in Rspamd. For sensitive lists, allow only moderators. If the agent is down, email is still delivered, but list rules are not enforced until it is back.

Mail queue ​

The server queue is in the Mail queue tab of the server's details. See Servers › Mail queue tab.

The per-account queue is in Accounts › (account) › Email › Queue & forwarder. It only shows messages whose sender is an address on the account's domains or the account's system email (for example cron). The actions are the same: Retry, Hold, Release, and Delete.

The panel opens the mail_queue_large alert when deferred messages reach 200 (warning) or 1,000 (critical).

Track delivery ​

Track delivery shows what happened to each email, like Track Delivery in cPanel. The agent reads the Postfix log and changes nothing.

WhereScope
Servers › (server) › Track deliveryEvery email on that server.
Accounts › (account) › Email › Track deliveryEmail to the account's domains, and email from those domains that was sent from this server.
Email › Track delivery in the client panelThe same as the account view, for the account owner.

Email whose sender only claims to be from an account's domain, but came from outside, does not show in that account's view, because the From address of incoming email can be forged.

Searching ​

  1. Fill Email address with a sender or recipient. Part of the address is enough.
  2. Choose a Status and a Direction: Incoming (from outside), Outgoing (sent to another server), or Local (from this server to a mailbox here).
  3. Choose the period: 24 hours, 3 days, or 7 days.
  4. Click Search.
StatusMeaning
SentDelivered to the receiving server.
DeliveredDelivered to a mailbox on this server.
DeferredNot delivered yet. Postfix keeps trying.
BouncedRejected by the receiving server.
ExpiredPostfix gave up after the queue lifetime.
RejectedRefused by this server, either by the spam filter (Rspamd) or by the SMTP server (policy or recipient check, sending limits).

Each row is one recipient of one message. Newest events come first. Click Load more for older events. Details shows the server response, DSN code, relay, delay, attempts, size, client, queue ID, and Message ID.

A message that is Still in queue can be handled right from its details: Retry now, Delete from queue, or Open mail queue (in the admin panel).

Log retention

The agent keeps its own mail log, /var/log/moorcp-mail.log, rotated daily for 7 days. /var/log/maillog stays as it is. Right after an upgrade, older events are read from the OS mail log.

IPv6 and outgoing email ​

When the server has an IPv6 address (see Server settings › General):

  • Postfix accepts email over IPv6 when the MX or hostname has an AAAA record. Postfix only listens on IPv6 when the server really has a global IPv6 address.
  • Outgoing email uses IPv4 by default, even to destinations whose MX only has IPv6.

Change this per server in Settings › General › IPv6 › Outgoing email:

ChoiceResult
IPv4 only (default)Postfix only sends over IPv4.
IPv4 and IPv6Postfix may send over either, from the server's IPv6 address.
Prefer IPv6Postfix tries IPv6 first, from the server's IPv6 address.

With IPv4 and IPv6 or Prefer IPv6:

  • the suggested SPF for a mail domain becomes v=spf1 mx a:<hostname> ip6:<IPv6> ~all;
  • the panel adds ip6:<IPv6> to existing SPF records of hosted zones, before all or redirect=. SPF records that end in -all without a sender mechanism, records with only third-party include:, and records that already have that ip6: are not changed;
  • the email DNS check warns when SPF only covers the server's IPv4, and checks the IPv6 PTR.

Switching back to IPv4 only does not remove ip6: from SPF records. That is harmless.

WARNING

Set the IPv6 PTR record to the server hostname at your IP provider before you allow outgoing email over IPv6. Many receiving servers reject or junk email from IPv6 addresses without a matching PTR.

Checking a mailbox from the command line ​

On the hosting server, as root:

bash
moorcp-agent mail check user@example.com

It shows the owning account, the mail directory, its format (Maildir or cPanel mdbox), the number of messages and folders, size, owner and SELinux label, what Dovecot (doveadm) sees, and suggested fixes. It only reads.

Mailboxes imported from cPanel in mdbox format are converted to Maildir during the import. To convert a mailbox that was left behind:

bash
moorcp-agent mail convert-mdbox USERNAME --dry-run
moorcp-agent mail convert-mdbox USERNAME user@example.com

--dry-run only lists the account's mdbox mailboxes. Without it the mailbox is converted; without an address, every mdbox mailbox of the account is converted. The original data is put back if a conversion fails, and the action is written to the agent log. Output is in English; set MOORCP_LANG=id for Indonesian. See CLI.

Automatic email client configuration ​

Clients' email apps can discover the server settings on their own.

AppHow
Thunderbird/.well-known/autoconfig/mail/config-v1.1.xml on every website.
Outlook/autodiscover/autodiscover.xml on every website, and the _autodiscover._tcp SRV record.
Other apps (RFC 6186)SRV records _submission._tcp, _submissions._tcp, _imaps._tcp, _pop3s._tcp.

Settings provided:

ProtocolServerPort
IMAPserver hostname993 SSL
POP3server hostname995 SSL
SMTPserver hostname465 SSL or 587 STARTTLS

The login is the full email address. SRV records are added automatically when email is enabled for a domain whose zone is hosted by the panel.

INFO

Older websites need their vhost applied again to serve autoconfig and Autodiscover. Use Re-apply virtual hosts in Settings › Web server. Outlook asks for a one-time confirmation of the server.

See also ​

MoorCP Shared, a shared hosting panel for server fleets.