The Mail Services field-set controls the mail features Yioop offers to signed-in users. The top dropdown chooses one of four overall modes; the sub-options below it are only meaningful when MailSite is selected. Defaults for new installs disable all mail features entirely.
These sub-options only apply when the mode is MailSite or MailSite and External Mail Accounts. They are hidden from the form otherwise.
:* Allow Insecure: users may authenticate over cleartext, and inbound mail that arrives without TLS is delivered normally. No MTA-STS policy is published. Appropriate for testing or a trusted local network. :* Spam Insecure: cleartext authentication is not allowed, and inbound mail that arrives without TLS is filed in Junk unless its sender is on the recipient's trusted-sender list. An MTA-STS policy is published in testing mode so senders report (but do not yet enforce) TLS results. This is a good middle setting while you confirm everything works. :* Require Secure: cleartext authentication is not allowed and an enforce MTA-STS policy is published, asking senders to refuse cleartext delivery to you. Use this once you are confident your TLS setup is correct. :When no certificate is configured in SERVER_CONTEXT, the secure ports cannot bind, so the posture is forced to Allow Insecure and the secure-port fields, the STARTTLS checkbox, and the secure postures are hidden, with a warning shown in their place.
For mail to be trusted by, and securely exchanged with, other servers (especially the large providers such as Gmail, Yahoo, and Outlook, which quietly discard or junk unauthenticated mail), MailSite-hosted domains should publish a small set of DNS records and serve an MTA-STS policy. Four mechanisms work together: the first three tell receivers whether a message claiming to be from your domain is genuine, and the fourth protects the connection itself. You need not deploy all four at once; a reasonable order is SPF, then DKIM, then DMARC in report-only mode, then MTA-STS once TLS is confirmed working.
When MailSite is enabled, the settings page shows a Suggested DNS Records panel that lists the records to publish in each mail domain's DNS zone. The panel adapts to the current Delivery Security posture and to whether a DKIM key has been generated. The values are starting points; adjust them to match your environment before publishing.
SPF (Sender Policy Framework) is a single DNS TXT record at your domain's apex naming the hosts allowed to send mail for the domain. Yioop suggests:
v=spf1 mx ~all
This authorizes the hosts named by your domain's own MX records (the mx mechanism) and asks receivers to soft-fail mail from anywhere else (~all), a conservative starting point. Once every legitimate sender is covered, tighten the trailing mechanism to -all (hard fail). MailSite also evaluates SPF on inbound mail, feeding the DMARC decision below.
DKIM (DomainKeys Identified Mail) signs each outgoing message with a private key held only by your server and publishes the matching public key in DNS, so a receiver can verify the message genuinely came from your domain and was not altered. The DKIM section of Server Settings manages the key pair; generating a key creates an RSA private key (kept in the work directory's security folder, never published) and the public-key record, published at:
<selector>._domainkey.<domain>
with a value of the form v=DKIM1; k=rsa; p=<base64 public key>. The selector is a short label that lets a domain rotate or run several keys. Because RSA-2048 keys are long, some DNS providers require splitting the value into several quoted strings, which they rejoin automatically.
MailSite signs with RSA-2048. RFC 8463 defines a newer, shorter Ed25519 signature, but as of 2026 the largest providers still do not reliably validate it, so RSA remains the choice trusted everywhere. Outgoing messages are also oversigned: each signed header is listed once more than it appears, so that if a relay later injects an extra copy of a header (a spoofing trick), the signature no longer verifies. MailSite verifies DKIM on inbound mail as well, feeding the DMARC decision.
DMARC (Domain-based Message Authentication, Reporting, and Conformance) ties SPF and DKIM to the visible From address and publishes, in DNS, what a receiver should do on failure. It is a TXT record at:
_dmarc.<domain>
Yioop suggests starting in report-only mode:
v=DMARC1; p=none; rua=mailto:<your report address>
p=none takes no action on failures but sends you aggregate reports (to the rua address). Watch those until all legitimate mail passes, then tighten to p=quarantine (failing mail goes to Junk at the receiver) and eventually p=reject. A message passes DMARC when either an SPF pass or a DKIM pass is for a domain that aligns with the From domain. Alignment in relaxed mode (the default) needs only the same organizational (registrable) domain, so mail.example.com aligns with example.com; strict mode requires an exact match.
When Enforce DMARC is checked (above), MailSite applies this same logic to inbound mail: it runs SPF, verifies DKIM, looks up the From domain's policy, and on failure files the message in Junk for a quarantine policy or refuses it for a reject policy. The organizational-domain calculation recognizes common multi-label public suffixes (such as co.uk and com.au); an unusual suffix falls back to the last two labels, erring toward applying policy.
MTA-STS (SMTP MTA Strict Transport Security) protects the connection over which mail is delivered to you, closing the gap where an attacker strips the optional STARTTLS upgrade and downgrades to cleartext. It has two parts: a DNS TXT record at _mta-sts.<domain> of the form v=STSv1; id=<number> (the id changes whenever the policy changes so senders re-fetch it), and a policy file served over HTTPS at https://mta-sts.<domain>/.well-known/mta-sts.txt. Yioop serves the policy file itself when clean URLs are enabled, and lists the _mta-sts TXT record and the mta-sts host record in the Suggested DNS Records panel. The mode follows Delivery Security: Spam Insecure publishes testing, Require Secure publishes enforce, Allow Insecure publishes no policy. Two deployment requirements: the mta-sts.<domain> host must resolve to this Yioop web server, and its TLS certificate must cover that host name (a wildcard or a subject-alternative name), since senders fetch the policy over HTTPS and validate the certificate.
The Spam Insecure posture is a pragmatic middle ground: rather than refusing cleartext mail outright (as Require Secure does), it treats mail that arrives without TLS as suspicious and files it in the recipient's Junk folder. Each user keeps a per-user trusted-sender list; mail from a trusted sender lands in the inbox even when it arrived insecurely, letting a user rescue a known correspondent whose mail server does not yet use TLS without weakening the posture for everyone else.
MailSite delivers outbound mail directly to each recipient domain's mail servers (the hosts named by its MX records), acting as a peer mail server rather than relaying through a smarthost. Delivery uses opportunistic STARTTLS: it connects on port 25 and upgrades to TLS when the far side offers it. Because some networks block outbound port 25, MailSite falls back to port 587 when the port 25 connection cannot be established at the TCP layer. The fallback is deliberately narrow: it triggers only on a connection-level failure, never on an SMTP-level rejection, so a recipient server that simply refuses a message is not retried on a different port.
Stored external-IMAP passwords are encrypted at rest using libsodium (sodium_crypto_secretbox) with a master key kept in the Yioop private database. An attacker who obtains only the public-database dump cannot read the stored credentials without also obtaining the private-database key. This raises the bar but does not protect against an attacker with read access to both databases or to the running process memory; for high-value accounts, prefer using an application-specific password (provider-supplied) rather than the account's main password.
Mail listeners exposed externally should always require TLS for both SMTP submission (SMTPS, or STARTTLS on the SMTP port) and IMAP access (IMAPS, or STARTTLS on the IMAP port). Cleartext credentials over an untrusted network are a non-starter for any deployment intending to be reachable from the public internet.