Self-Hosted Email Server with Mail-in-a-Box: Deploy in One Hour

Tired of monthly payments for cloud email and want to control your data? We deploy your own mail server on Mail-in-a-Box in just an hour, saving you from manual Postfix, Dovecot, and antispam setup. Our team handles the entire cycle—from IP verification to SPF, DKIM, and DMARC configuration—ensuring reliable delivery and ongoing support.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

You have a company of 30 people and want to move away from Google Workspace to save money. A self-hosted VPS costs $10–20 per month — the difference with a cloud service is significant. Or you need a mail server for a project with minimal costs. Your choice: spend weeks manually assembling Postfix, Dovecot, anti-spam — or deploy a ready-made stack in one hour.

According to the official documentation, this is the simplest way to deploy a mail server. We use Mail-in-a-Box for such tasks — it combines everything needed in a single script. Experience — 50+ projects, guaranteed deliverability.

Component Purpose
Postfix MTA — receive and send
Dovecot IMAP server
Roundcube Webmail
Nextcloud Files, contacts, calendars
Nginx Reverse proxy
Certbot TLS from Let's Encrypt
Nsd Authoritative DNS
Spamassassin + Postgrey Spam filtering + greylisting

The built-in DNS server is a feature of Mail-in-a-Box. The server can serve as authoritative DNS for the domain, simplifying automatic publication of DKIM, SPF, DMARC, PTR records. Proper configuration of these records solves 90% of deliverability issues. According to Wikipedia, SPF and DKIM are mandatory mechanisms for deliverability.

How Mail-in-a-Box solves the deliverability problem

Deliverability is the main pain point of self-hosted email servers. Mail-in-a-Box automatically creates SPF, DKIM, and DMARC, but that's not enough. We additionally:

  • Check IP against 50+ blocklists — if the IP is blacklisted, we change it before installation
  • Configure PTR record with the hosting provider (without it, most MTAs reject mail with 550 PTR record required)
  • Test sending to Gmail, Outlook, Yandex, Mail.ru — 5 target systems
  • Set DMARC policy to quarantine or reject

For example, one of our clients — a company with 30 employees — migrated from Google Workspace to Mail-in-a-Box. After setting up PTR and DMARC, deliverability matched the cloud provider, and savings amounted to about $2,000 per year. Contact us for a consultation to evaluate the prospects for your project.

What is needed for installation and how to perform it

# Ubuntu LTS, clean server curl -s https://mailinabox.email/setup.sh | sudo -E bash 

The script asks for an email address (first mailbox) and the server's hostname. Everything else is configured automatically. The process takes 20-30 minutes.

Server requirements:

  • Ubuntu 22.04 LTS (strict — other versions are not officially supported)
  • 1 GB RAM minimum, 2 GB recommended
  • 40+ GB disk
  • Static IP
  • PTR record (reverse DNS) configured with the hosting provider

The last point is critical. Without PTR, most mail servers will reject mail with 550 PTR record required. PTR is configured in the hoster's panel, not in the domain's DNS.

Stages of work

  1. Analysis. Determine the load (number of mailboxes, daily traffic), check IP reputation.
  2. Design. Choose hostname, configure DNS records (A, MX, SPF, DKIM, DMARC, PTR).
  3. Deployment. Run the script, install the server, configure backups to S3.
  4. Testing. Verify all Status Checks, send test emails, monitor logs for 24 hours.
  5. Handover. Document configuration, hand over access, train the administrator.

The entire process takes 1 day, including DNS propagation wait. Average active setup time — 45 minutes.

What is included in the work

  • Deployment of Mail-in-a-Box on Ubuntu 22.04 LTS
  • DNS configuration: A, MX, SPF, DKIM, DMARC, PTR (reverse DNS)
  • Creation of the first 10 mailboxes with aliases
  • Configuration of backup to S3-compatible storage
  • Deliverability testing on 5 popular email systems
  • Documentation of configuration and administrator training (1 hour)
  • Support for 30 days after launch

Comparison with manual assembly

Parameter Mail-in-a-Box Manual assembly
Setup time 45 minutes 3–5 days
Customization Limited Full
Deliverability 98% with proper setup Depends on skills
Required knowledge Minimal Senior admin
Limitations of Mail-in-a-Box Mail-in-a-Box does not support clustering, customization of Postfix/Dovecot is limited. For high-load systems (hundreds of thousands of emails per day) or complex scenarios (AD/LDAP), manual assembly is better. With proper configuration, it works stably for 50–100 mailboxes.

Managing via the Admin Panel

After installation, the web interface is available at https://hostname/admin. From here you manage everything:

  • Create/delete mailboxes and aliases
  • View status of all checks (DNS, TLS, blacklist)
  • Configure Custom DNS records
  • Backup

The System → Status Checks tab is the main diagnostic tool. It shows all issues: incorrect DNS records, TLS problems, IP in blocklists.

Customization and limitations

For customization, there are hooks:

# Custom DNS records via API
curl -X POST "https://hostname/admin/dns/custom/subdomain.example.com/A" \
  -u "[email protected]:password" \
  -d "value=203.0.113.5"

# Additional Nginx configs
# /etc/mailinabox/custom_conf.d/nginx.conf — not overwritten

Backup

Mail-in-a-Box supports backup to S3-compatible storage (AWS S3, Backblaze B2, MinIO):

# /home/user-data/backup/custom.yaml
target: s3://my-bucket/mail-backup
target_user: ACCESS_KEY
target_pass: SECRET_KEY
min_age_in_days: 3

Restore — via the management/restore_backup.py script on a clean server of the same version.

Contact us for a consultation on deploying Mail-in-a-Box for your domain. We will evaluate your project and prepare a proposal. Order mail server setup — get guaranteed deliverability and support.