Skip to content



Cloudron has a built-in mail server that can send and receive email on behalf of users and applications. By default, most of it's functionality is disabled and it only sends out mails on behalf of apps (for example, password reset and notification emails).

When Cloudron Email is enabled, it becomes a full-fleged mail server solution. Each user gets a mailbox username@domain and can send mails using SMTP and receive mails using IMAP. Users can also setup server side mail filtering rules using ManageSieve.

Features of this mail solution include:

  • Multi-domain support
  • Enable mailboxes for users and groups on a domain level
  • Per-user mail aliases
  • Group email addresses that forward email to it's members
  • Email account sub-addressing by adding + tag qualifier
  • Setup mail filters and vacation email using ManageSieve
  • Catch all mailbox to receive mail sent to a non-existent mailbox
  • Relay all outbound mails via SendGrid, Postmark, Mailgun, AWS SES or a Smart host
  • Anti-spam. Users can train the spam filter by marking mails as spam. Built-in rDNS and zen spamhaus lookup
  • Webmail. The Rainloop and Roundcube apps are already pre-configured to use Cloudron Email
  • Completely automated DNS setup. MX, SPF, DKIM, DMARC are setup automatically
  • Let's Encrypt integration for mail endpoints
  • Domains and IP addresses blacklisting
  • Server-side mail signatures (can be set per domain)
  • REST API to add users and groups
  • Secure out of the box

Email settings are located under the Email menu item.


Mail Server Location

By default, the location of the email server defaults to the Cloudron dashboard location i.e This can be changed in the Mail settings view. Cloudron will automatically setup the required DNS records for all the domains when you change the mail server location. Any installed webmail clients will be automatically re-configured as well. Be sure to adjust the settings of any mobile and desktop mail clients accordingly.

Enable Email

By default, Cloudron's mail server only sends email on behalf of apps. To enable users to receive email, turn on the option under Settings.

When the Setup Mail DNS records now option is checked, Cloudron will automatically update the MX, SPF, DKIM, DMARC DNS records of the domain.

Required ports

The following TCP ports must be opened in the firewall for Cloudron to send email:

  • Outbound Port 25

If outbound port 25 is blocked by your server provider, setup an email relay. You can check if outbound port 25 is blocked by sending yourself a test email from the Cloudron.

The following TCP ports must be opened in the firewall for Cloudron to receive email:

  • Inbound and Outbound Port 25
  • Inbound Port 587 (SMTP/STARTTLS)
  • Inbound Port 993 (IMAPS)
  • Inbound Port 4190 (ManageSieve for email filters)

Mail server status

Make sure that all the mail checks are green in the Email UI. Please note that the UI below displays the check list depending on whether incoming email is enabled and whether a mail relay is setup.

If one or more checkboxes are not green, see the debugging section.



Mailboxes can be created for Users and Groups on a per-domain level. To do so, simply create them in the Email view.

The Mailbox Owner dropdown can be used to select an existing user. The user can then access their email using the new email and the Cloudron password. i.e The user johannes can now use his password to access the mailbox using SMTP and IMAP.

Mailboxes have the following naming restrictions:

  • Only alphanumerals, dot and '-' are allowed
  • Maximum length of 200 characters
  • Names ending with .app are reserved by the platform for applications
  • Names with + are not allowed since this conflicts with the Subaddresses and tags feature.


Use the delete button to delete a mailbox.

After deletion, emails to this mailbox will bounce. If you have a catch-all address set, then emails will get delivered to that mailbox.

Deleting old emails

Deleting the mailbox does not remove old emails. You can remove the emails by removing the directory /home/yellowtent/boxdata/mail/vmail/<>.

Mail aliases

One or more aliases can be configured for each mailbox. Aliases can be on the same domain or another domain. You can do this by editing the mailbox configuration:

Authenticating with alias is not supported

Currently, it is not possible to login using the alias for SMTP/IMAP/Sieve services. Instead, add the alias as an identity in your mail client but login using the Cloudron credentials.

Mailing Group

A Mailing group forwards emails to one or more email addresses. A list can be created in the Email view.

Use the 'Restrict posting to members only' option to allow only members to post to the list. When enabled, non-members will get a bounce.

To support forwarding mails to external address, Cloudron implements SRS. SRS translation is performed using the mailing list domain before forwarding the mail.

No subscribe/unsubscribe feature

Cloudron does not support creating a mailing list (i.e) a list that allows members to subscribe/unsubscribe.

Catch-all address

A Catch-all or wildcard mailbox is one that will "catch all" of the emails addressed to non-existent addresses. You can forward such emails to one or more user mailboxes in the Email section. Note that if you do not select any mailbox (the default), Cloudron will send a bounce.

Email Client Configuration


Use the following settings to receive email via IMAP:

  • Server Name - Use the mail server location of your Cloudron (default: my subdomain of the primary domain)
  • Port - 993
  • Connection Security - TLS
  • Username/password - Use the email id as the username and the Cloudron account password

Multi-domain setup credentials

Use the email id as the username to access different mailboxes. For example, if email is enabled on two domains and, then use to access the mailbox and use to access the mailbox. In both cases, use the Cloudron account password.


Use the following settings to send email via SMTP:

  • Server Name - Use the mail server location of your Cloudron (default: my subdomain of the primary domain)
  • Port - 587
  • Connection Security - STARTTLS
  • Username/password - Use the full email as the username and the Cloudron account password

Multi-domain setup credentials

Use the email id as the username to send email. For example, if email is enabled on two domains and, then use to send email as and use to send email as In both cases, use the Cloudron account password.


Use the following settings to setup email filtering users via ManageSieve.

  • Server Name - Use the mail server location of your Cloudron (default: my subdomain of the primary domain)
  • Port - 4190
  • Connection Security - STARTTLS
  • Username/password - Use the full email as the username and the Cloudron account password

Multi-domain setup credentials

Use the email id as the username to access different mailboxes. For example, if email is enabled on two domains and, then use to access the mailbox and use to access the mailbox. In both cases, use the Cloudron account password.

Subaddresses and tags

Emails addressed to <username>+tag@<domain> i.e mail addresses with a plus symbol in the username will be delivered to the username mailbox. You can use this feature to give out emails of the form username+kayak@<domain>, username+aws@<domain> and so on and have them all delivered to your mailbox.

This trick works for email aliases as well.

Relay outbound mails

By default, Cloudron's built-in mail server sends out email directly to recipients. You can instead configure the Cloudron to hand all outgoing emails to a 'mail relay' or a 'smart host' and have the relay deliver it to recipients. Such a setup is useful when the Cloudron server does not have a good IP reputation for mail delivery or if server service provider does not allow sending email via port 25 (which is the case with Google Cloud and Amazon EC2).

Cloudron can be configured to send outbound email via:

To setup a relay, enter the relay credentials in the Email section. Cloudron only supports relaying via the STARTTLS mechanism (usually port 587).

Amazon SES

To setup Cloudron to relay via Amazon SES:

  • Go to Amazon SES dashboard and add a new domain to verify under Domains. Leave the Generate DKIM Settings unchecked since Cloudron has already generated DKIM keys.

    • Setup the DNS records as suggested by the Verify a New Domain. SES will automatically set these up if your domain is on AWS Route53.
  • Once domain is verified, click on SMTP Settings on the left pane and then click the Create My SMTP Credentials button.

    • Follow through the wizard to create a new IAM user that has the following policy

    "Statement": [{ "Effect":"Allow", "Action":"ses:SendRawEmail", "Resource":"*"}]

  • Setup the relay on the Cloudron under the Email section:

  • Use the Send Test Email button to verify emails are sent.

  • If you do not receive the email, please verify that your AWS SES is not in sandbox mode. In this mode, new AWS accounts are only able to send mails to verified domains or the simulator. You can check this in the Sending Statistics page and looking for a note that looks like below:

To remove sandbox, log a request to increase the sending limit to say 500 emails a day. Note that, a custom MAIL FROM domain must be set for the DMARC alignment to succeed.


When using Google to relay mail, if you encounter an error message of the form Invalid login or Please log in via your web browser and then try again, you must configure your Google account to either use App passwords or enable less secure apps. See Google Support for more information.

Office 365

To setup Office 365 as relay, add a connector under mail flow following the instructions under Option 3. Note that relaying via Office 365 requires port 25 to be open and requires a static IP.

SMTP Server

Cloudron can relay via an external SMTP server with or without authentication. Use External SMTP server option for relaying via a server with a username/password. For IP based authentication relays, use the External SMTP sever (No authentication).

Forward all emails

To forward some or all emails to an external address, create a Sieve filter. Sieve filters can be created using Rainloop, Roundcube or any other client that supports Manage Sieve.

To support forwarding mails to external address, Cloudron implements SRS.

Marking Spam

The spam detection agent on the Cloudron requires training to identify spam. To do this, simply move your junk mails to the pre-created folder named Spam. Most mail clients have a Junk or Spam button which does this automatically.

If you marked a mail as Spam incorrectly, just move it out to the Inbox and the server will unlearn accordingly.

The mail server is configured to act upon training only after seeing atleast 50 spam and 50 ham messages.

Blacklist addresses and domains

Use the spam filter configuration UI in the Email view to blacklist addresses and domains. Matched addresses will end up in the user's Spam folder. * and ? glob patterns are supported. This is a global setting and applies for incoming mail to all domains.

When an email matches the above addresses, it will have USER_IN_BLACKLIST field set in the X-Spam-Status email header.

Blocking IP Addresses

To block an IP address or an entire network, use the Firewall configuration.

Custom Spam Filtering Rules

Custom spam filter rules can be set in the spam filter configuration UI in the Email view. Spam filtering rules are global and applies for incomgng mail to all domains.

A simple Spam Assassin configuration rule to mark all emails containing the word 'discount' in the subject looks like this:

header SUBJECT_HAS_DISCOUNT  Subject =~ /\bdiscount\b/i
describe SUBJECT_HAS_DISCOUNT    I hate email discounts

See this guide for writing custom rules.

Change FROM address of an app

By default, Cloudron allocates the mailbox for each installed app. When an app sends an email, the FROM address is set to The mailbox name can be changed in the configure dialog of the app.

Disable FROM address validation

By default, the Cloudron does not allow masquerading - one user cannot send email pretending to be another user. To disable this, enable masquerading in the Email settings.

Max mail size

The maximum size of emails that can be sent can be set using the Maximum Mail Size setting.

Vacation mail

An out of office / vacation mail message can be setup using Sieve filters. When using Rainloop, a vacation message can be set in Settings -> Filters -> Add filter -> Vacation message action.


A disclaimer, confidentiality information or legalese can be appended to every outbound email via the Email Signature setting. This setting is per-domain.

Event log

Mail server activity can now be monitored using the Eventlog UI.

Alternate MX

A failover/alternate/backup MX can be setup for a domain on Cloudron. To set this up, do the following:

  • Enable incoming mail for the Cloudron domain

  • Cloudron has a anti-spoof feature to ensure that only it can generate emails for the incoming domains. This feature will prevent the external MX from forwarding emails to it. However, Cloudron skips this spoof check for servers listed in the domain's SPF record. So, white list the MX's IP address block in the domain's SPF record. Note that it is necessary to specifically whitelist the server(s). Just a permissive SPF with ~all and ?all is not enough.

Import email

Existing mail can be imported into Cloudron via IMAP using a tool like imapsync.

The steps to import email are:

  • Add the domain for which you would like to receive email. To give the import a test run, uncheck the Setup Mail DNS records now option when enabling email for the domain. This will allow you to continue to use the email with your current provider.

  • Create the mailbox(es) to import in Cloudron

  • Use a tool like IMAP Sync to import Email into Cloudron. For example, to import from GMail, use the following command:

    ./imapsync --gmail1 --user1 --password1 MASKED --host2 --user2 --password2 MASKED --maxbytespersecond 20000 --useheader=X-Gmail-Received --useheader Message-Id --automap --regextrans2 s,\[Gmail\].,, --skipcrossduplicates   --folderlast [Gmail]/All Mail --exclude "\[Gmail\]/Spam"
  • Once imported, you can verify if the mails look correct using apps like Rainloop or Roundcube.

  • Once all mailboxes are imported, Cloudron has to be set as the mail server in the DNS. This can be done by clicking the Re-setup DNS button in the Email -> Status page.

Archived Emails

When deleteing a mailbox, you can choose whether to delete the content (emails) inside the mailbox. If you choose to keep the emails, then you can find the archived emails at /home/yellowtent/boxdata/mail/vmail/.


Auto discover is a feature where an email client is able to automatically detect the SMTP and IMAP configuration from the email address. Setting up auto discover is very client specific. We have outlined the approach for some of the popular email clients.


The autoconfig.xml config format is supported by Thunderbird, K-9, KMail, Evolution, Kontact & others. The mail client makes a HTTP request to OR a fallback

If the domain is being hosted on Cloudron, you can simple create this file under /home/yellowtent/boxdata/well-known/ Alternately, you can installer the Surfer app under the autoconfig subdomain and make it serve up mail/config-v1.1.xml.

Here is a sample config file for the domain

<?xml version="1.0" encoding="UTF-8"?>

<clientConfig version="1.1">
  <emailProvider id="">
    <displayName>Cloudron Mail</displayName>
    <incomingServer type="imap">
    <outgoingServer type="smtp">

    <documentation url="">
       <descr lang="en">Configure Thunderbird for Cloudron Email</descr>


You can check if your setup is correct by curl


Doesn't work

This method does not seem to work with Microsoft Outlook 2016, Microsoft Outlook 2019 or Microsoft Outlook for Office 365. Your mileage may vary.

Outlook performs an HTTP POST request to the following in order:

  • DNS SRV lookup of and use the response to look up https://srvresponse/autodiscover/autodiscover.xml. The SRV record is of the format0 0 443`.

Because, it is a POST request, you cannot use some static hosting setup. For example, you can use a PHP file like below (there are also more sophisticated attempts):

$raw = file_get_contents('php://input');
$matches = array();
preg_match('/<EMailAddress>(.*)<\/EMailAddress>/', $raw, $matches);
header('Content-Type: application/xml');
<Autodiscover xmlns="">
  <Response xmlns="">
      <EMailAddress><?php echo $matches[1]; ?></EMailAddress>
        <LoginName><?php echo $matches[1]; ?></LoginName>
        <LoginName><?php echo $matches[1]; ?></LoginName>