> ## Documentation Index
> Fetch the complete documentation index at: https://flashrdp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up Your Own Mail Server

> Run your own mail server on a FlashRDP Linux VPS: request port 25, set reverse DNS, install Mail-in-a-Box or Postfix and Dovecot, and add SPF, DKIM and DMARC.

**To run your own mail server on FlashRDP, first ask support to open outgoing port 25 (it's blocked by default), then set reverse DNS for your mail hostname, install a mail stack such as Mail-in-a-Box, and publish MX, SPF, DKIM and DMARC records.** Without all of these, other providers will reject or junk your mail.

Running a mail server takes some Linux experience and ongoing care. You need a [FlashRDP Linux VPS](https://flashrdp.com/docs/linux-vps/overview.md) and a domain name you control.

## Step 1: Request outgoing port 25

> [!WARNING]
>
> **Outgoing port 25 is blocked by default** on every FlashRDP server to protect our IP addresses from spam listings. Until it's opened, your server can't deliver mail directly to other mail servers.
>
> [Open a ticket](https://new.flashrdp.com/support/new) with a short business justification (what you send, to whom, and roughly how much). Sending spam is prohibited under the [Acceptable Use Policy](https://flashrdp.com/docs/terms/use-of-service.md), and an IP that ends up on a blocklist such as Spamhaus breaks it.

## Step 2: Set the hostname and reverse DNS

1. Pick a mail hostname, for example `box.yourdomain.com` (Mail-in-a-Box's convention) or `mail.yourdomain.com`.
2. Create an **A record** for that hostname pointing to your server's IP.
3. Set the server's reverse DNS to the same hostname from the **Network** tab of your server in the [Billing Portal](https://new.flashrdp.com/servers). See [Configure Reverse DNS](https://flashrdp.com/docs/control-panel/reverse-dns.md). Most large mail providers check that forward and reverse DNS match.

## The core components

A mail server is several programs working together:

* **Postfix (SMTP):** sends mail to other servers and receives mail for your domain.
* **Dovecot (IMAP/POP3):** lets mail apps such as Apple Mail, Outlook or Thunderbird read your mailbox.
* **Spam and virus filtering:** for example SpamAssassin or Rspamd, and ClamAV.
* **DKIM signing:** for example OpenDKIM, so receivers can verify your mail wasn't altered.

## The easier way: Mail-in-a-Box

Wiring those components together by hand takes hours. **Mail-in-a-Box** installs a complete mail server with webmail, contacts and calendar, and creates most DNS records for you. Its setup guide requires a fresh **Ubuntu 22.04** server dedicated to mail; check the [Mail-in-a-Box guide](https://mailinabox.email/guide.html) for the currently supported release before you deploy.

Log in via [SSH](https://flashrdp.com/docs/linux-vps/ssh-access.md) and run the official installer:

```bash theme={null}
curl -s https://mailinabox.email/setup.sh | sudo -E bash
```

> [!NOTE]
>
> This pipes a script from Mail-in-a-Box's own site into a root shell. To review it first, download it with `curl -s https://mailinabox.email/setup.sh -o setup.sh`, read it, then run `sudo -E bash setup.sh`.

The installer asks for your email address and hostname, then prints the admin panel URL. Alternatives include [iRedMail](https://www.iredmail.org/) and [Mailcow](https://mailcow.email/).

## DNS records you need

If you skip these, your mail will land in spam folders or be rejected. Mail-in-a-Box can host DNS for you; otherwise add them at your DNS provider:

* **MX:** tells other servers where to deliver mail for your domain.
* **SPF:** a TXT record listing which servers may send mail for your domain.
* **DKIM:** a TXT record with the public key that verifies your mail's signature.
* **DMARC:** a TXT record telling receivers what to do with mail that fails SPF or DKIM.
* **Reverse DNS (PTR):** set in Step 2. Required by almost all major providers.

## Related Articles

> [card] [Configure Reverse DNS (rDNS)](https://flashrdp.com/docs/control-panel/reverse-dns.md)

> [card] [Connect via SSH](https://flashrdp.com/docs/linux-vps/ssh-access.md)

> [card] [Open a Support Ticket](https://flashrdp.com/docs/account/support.md)

> [card] [Acceptable Use Policy](https://flashrdp.com/docs/terms/use-of-service.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.