How to Install Mail-in-a-box on Ubuntu 18.04

Introduction

Mail-in-a-box (MiaB) takes care of all the complicated configurations required to avoid security problems, provides a solid spam detection system and gives you monitoring, reporting and backup mechanisms. It can also set up and automatically renew a Let's Encrypt certificate for your email domains, as well as configuring the detailed DNS configurations needed to ensure your mail server's IP address is trusted by other servers, and less likely to be blacklisted.

Mail-in-a-box also incorporates Nextcloud, in order to provide calendar (CalDAV) and contacts (CardDAV) servers.

Prerequisites

  • A fresh Ubuntu 18.04 server
  • At least 1GB RAM
  • An IPv4 address. Hosting email behind only an IPv6 address is not yet a viable option for numerous reasons.

Getting started

MiaB needs the entire VPS, so you will always need to start with a fresh VPS. MiaB is designed specifically for Ubuntu 18.04. It's a "long term support" version, meaning in this case it will be supported until April 2028.

Choose a hostname for your email server. MiaB recommends a box. sub-domain of your primary domain. You can host email on multiple domains using MiaB, but your MiaB box itself will have just one hostname. If you're not sure, go with box.example.com, replacing example.com with your own domain.

You'll use this hostname to access MiaB's configuration UI in your browser, SSH into your VPS and access your web-mail. Once your VPS has been set up, take a note of its IPv4 address, for example 203.0.113.0. You'll need this several times throughout this tutorial.

Set the Reverse DNS on your new VPS

  • In your Vultr control panel, select your server, and go to the Settings page.
  • There you will see a configuration called Reverse DNS. It will be set by default to something like 203.0.113.0.vultr.com.
  • Change this to match the hostname you chose for your VPS above, for example 203.0.113.0.box.example.com.
  • Click the "tick" icon to save your changes.

Configure your domain's nameservers at your domain registrar

The simplest (and expected) way to configure your DNS correctly for MiaB is to allow it to take complete control of your domain's DNS. To this end your MiaB install provides two nameservers, for you to point your domain at. These will take the following form:

ns1.box.example.com
ns2.box.example.com

You will need to use the control panel at your domain registrar to assign the MiaB-provided nameservers as the nameservers for your domain. You also need to register your MiaB-provided nameservers with your domain registrar (sometimes called "glue records"). This process differs depending on the registrar you are with. Essentially you should be asked to enter your name servers (ns1.box.example.com and ns2.box.example.com) and the IP address they should point at, which is the IP address of your Vultr VPS.

Installation

SSH into your new VPS. Use the IP address that you took note of earlier.

$ ssh root@203.0.113.0

Your root user password can be found in the Vultr control panel, in the Overview section.

Copy and paste the following into your terminal.

$ curl -s https://mailinabox.email/setup.sh | sudo bash

Several Ubuntu packages will now be installed for you. Eventually, you'll be asked a few installation questions:

  • Your email address This will default to something like me@example.com. Change that to whatever you prefer.
  • Hostname This should default to the hostname that you have already set up for your VPS, for example box.example.com. Leave this as-is.
  • Configuring tzdata Select your timezone.
  • Password Finally, you'll be asked to enter a new password. This will be used for your new email account, as well as logging into the admin interface.

Once installation is complete, you'll be presented with a success message, and a website link to the admin interface.

Your Mail-in-a-Box is running.

Please log in to the control panel for further instructions at:

https://203.0.113.0/admin

You will be alerted that the website has an invalid certificate. Check that
the certificate fingerprint matches:

C0:9B:FF:04:2B:2D:8F:47:5A:BF:82:E9:F2:2A:E8:CB:51:F3:12:88:48:6B:9E:72:7C:33:8B:D5:88:B7:05:D3:4B:6C:22:80:5F

Logging in for the first time

When you log into MiaB for the first time in your browser, you will use the address given at the end of the installation process. This will use your VPS's IP address instead of the domain name.

The SSL certificate has not been generated at this point, so your box will use a self-signed certificate. Your web browser will almost certainly warn you, suggesting this is dangerous. Accept the self-signed certificate. This is only used during first-run.

Log into MiaB using the email address and password you configured during installation.

System Status Checks

Your MiaB has a very helpful section called Status Checks. You will arrive at this page when you first log in, and can visit it later at System > Status Checks to check if there are any issues that need to be resolved.

If MiaB shows a button asking you to reboot your VPS ("Reboot Box"), you should do so. If the automated attempt to reboot the VPS fails, you can do this through your Vultr control panel, there is an icon on the top-right of the control panel; or via the command-line, using the reboot command.

Some issues are not absolutely essential to resolve immediately. For example, the password-based login warning, or software packages that need updating. Do be sure to fix these later though.

Confirm that the following items are correct, and if not, resolve them before moving on:

  • Nameserver glue records
  • This domain must resolve to your box's IP address

You may need to wait for your earlier DNS changes to propagate, which can take some hours. Just reload the page a little later on to see if the changes have taken effect.

Provision and Install TLS (SSL) Certificate

You should get MiaB to configure a valid SSL certificate for you. Visit System > TLS (SSL) Certificates and click "Install Certificate" beside each domain.

You will now be able to log into your MiaB using the domain, for example https://box.example.com/admin, and your web browser will not present any certificate warnings as it did earlier.

Next, go to Mail > Users and add as many email accounts as you would like. Be aware that MiaB implements an anti-spam feature called "greylisting". Essentially this means the first time an account on your box receives email from someone it hasn't seen before, it will be delayed; anything from 2 minutes to an hour depending on the sending server. This cuts down on spam enormously, but does mean your first email tests may take some time to come through.

Updating MiaB

To update MiaB, use the exact same two steps as you used when first installing it. The same script both installs and updates MiaB.

curl -s https://mailinabox.email/setup.sh | sudo bash

Using an external DNS service such as Cloudflare

By default, MiaB is set up to handle all your DNS, and is able to configure the complex DKIM and SPI records for your email domains automatically. To do this, you point the name servers for your domains directly at the nameservers provided by MiaB as you did earlier. However, you might need to manage the DNS for your domains elsewhere. This is entirely possible, but more difficult.

To use Cloudflare, for example, the setup is as follows:

  • Point your domains' nameservers to the two which Cloudflare specifies
  • In your Cloudflare dashboard you will add DNS records as needed to ensure your MiaB server takes charge of your email. You can copy these records from the System > External DNS page of MiaB's admin interface.

Be very careful, and test your work with a site such as mail-tester. A simple oversight in this type of scenario may mean your email will be sent straight to the spam folder of your recipients.



Leave a Comment

Cómo configurar Spamassassin con Postfix en Ubuntu 16.04

Cómo configurar Spamassassin con Postfix en Ubuntu 16.04

Spamassassin es un filtro de correo gratuito y de código abierto escrito en Perl que se utiliza para identificar el correo no deseado mediante una amplia gama de pruebas heurísticas en los encabezados y el cuerpo del correo

How to Install RainLoop Webmail on Ubuntu 16.04

How to Install RainLoop Webmail on Ubuntu 16.04

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on Github. This guide will show you ho

Cómo arreglar que Office 365 no reciba correos electrónicos - ayuda de Office

Cómo arreglar que Office 365 no reciba correos electrónicos - ayuda de Office

En caso de que los miembros de su grupo de Office 365 no estén recibiendo correos electrónicos, deberá asegurarse de que los usuarios estén suscritos y cambiar la configuración del grupo.

How to Install Mailtrain Newsletter Application on Ubuntu 16.04

How to Install Mailtrain Newsletter Application on Ubuntu 16.04

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install Mailtrain Newsletter Application on CentOS 7

How to Install Mailtrain Newsletter Application on CentOS 7

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install Mailtrain Newsletter Application on Debian 9

How to Install Mailtrain Newsletter Application on Debian 9

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

Instale sSMTP con Mailtrap para el desarrollo de aplicaciones web en Ubuntu 16.04

Instale sSMTP con Mailtrap para el desarrollo de aplicaciones web en Ubuntu 16.04

En este tutorial, aprenderá cómo instalar sSMTP, un servidor de reenvío simple. Mailtrap.io ofrece un servidor de correo electrónico falso para desarrolladores. Úselo para enviar

How to Migrate Mailboxes Easily With Imapsync on Ubuntu 16.04 LTS

How to Migrate Mailboxes Easily With Imapsync on Ubuntu 16.04 LTS

Using a Different System? While migrating websites is usually not a problem, sometimes its more difficult to migrate email boxes. This is especially the cas

How to Install RainLoop Webmail on Fedora 28

How to Install RainLoop Webmail on Fedora 28

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on GitHub. This guide will show you ho

How to Install RainLoop Webmail on CentOS 7

How to Install RainLoop Webmail on CentOS 7

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on GitHub. This guide will show you ho

Construyendo su propio servidor de correo con FreeBSD 11

Construyendo su propio servidor de correo con FreeBSD 11

Ejecutar su propio servidor de correo electrónico puede ser muy gratificante. Usted está a cargo de sus datos. También le permite una mayor flexibilidad con sus opciones de entrega. sin embargo

How to Install iRedMail on Ubuntu 18.04

How to Install iRedMail on Ubuntu 18.04

Introduction Running your own mail server offers the benefit of privacy as well as the ability to create as many mail accounts as you wish for your domains.

How to Install RainLoop Webmail on Debian 9

How to Install RainLoop Webmail on Debian 9

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on Github. This guide will show you ho

How to Install Mailtrain Newsletter Application on FreeBSD 12

How to Install Mailtrain Newsletter Application on FreeBSD 12

Using a Different System? Mailtrain is an open-source self-hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install Mailtrain Newsletter Application on Fedora 28

How to Install Mailtrain Newsletter Application on Fedora 28

Using a Different System? Mailtrain is an open-source self hosted newsletter app built on Node.js and MySQL/MariaDB. Mailtrains source is on GitHub. Thi

How to Install RainLoop Webmail on FreeBSD 12

How to Install RainLoop Webmail on FreeBSD 12

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on Github. This guide will show you ho

Un servidor de correo electrónico OpenBSD que utiliza OpenSMTPD, Dovecot, Rspamd y RainLoop

Un servidor de correo electrónico OpenBSD que utiliza OpenSMTPD, Dovecot, Rspamd y RainLoop

Introducción Este tutorial muestra un servidor de correo electrónico con todas las funciones que se ejecuta en OpenBSD con OpenSMTPD, Dovecot, Rspamd y RainLoop. OpenSMTPD es th

Cómo configurar un servidor de correo usando iRedMail en Ubuntu 16.04

Cómo configurar un servidor de correo usando iRedMail en Ubuntu 16.04

¿Usando un sistema diferente? Introducción Si alguna vez ha creado un servidor de correo desde cero, sabrá que puede ser una empresa tediosa. Estoy ahí

How to Migrate Mailboxes Easily With Imapsync on CentOS 7

How to Migrate Mailboxes Easily With Imapsync on CentOS 7

Using a Different System? While migrating websites is usually not a problem, sometimes its more difficult to migrate email boxes. This is especially the cas

ZPanel y Sentora en CentOS 6 x64

ZPanel y Sentora en CentOS 6 x64

ZPanel, un panel de control de alojamiento web popular, se bifurcó en 2014 a un nuevo proyecto llamado Sentora. Aprende a instalar Sentora en tu servidor con este tutorial.

Cómo instalar Vtiger CRM Open Source Edition en CentOS 7

Cómo instalar Vtiger CRM Open Source Edition en CentOS 7

Aprende cómo instalar Vtiger CRM, una aplicación de gestión de relaciones con el cliente, en CentOS 7 para aumentar tus ventas y mejorar el servicio al cliente.

Cómo instalar el servidor Counter-Strike 1.6 en Linux

Cómo instalar el servidor Counter-Strike 1.6 en Linux

Esta guía completa le mostrará cómo configurar un servidor Counter-Strike 1.6 en Linux, optimizando el rendimiento y la seguridad para el mejor juego. Aprende los pasos más recientes aquí.

¿Puede la IA luchar con un número cada vez mayor de ataques de ransomware?

¿Puede la IA luchar con un número cada vez mayor de ataques de ransomware?

Los ataques de ransomware van en aumento, pero ¿puede la IA ayudar a lidiar con el último virus informático? ¿Es la IA la respuesta? Lea aquí, sepa que la IA es una bendición o una perdición

ReactOS: ¿Es este el futuro de Windows?

ReactOS: ¿Es este el futuro de Windows?

ReactOS, un sistema operativo de código abierto y gratuito, está aquí con la última versión. ¿Puede satisfacer las necesidades de los usuarios de Windows de hoy en día y acabar con Microsoft? Averigüemos más sobre este estilo antiguo, pero una experiencia de sistema operativo más nueva.

Manténgase conectado a través de la aplicación de escritorio WhatsApp 24 * 7

Manténgase conectado a través de la aplicación de escritorio WhatsApp 24 * 7

Whatsapp finalmente lanzó la aplicación de escritorio para usuarios de Mac y Windows. Ahora puede acceder a Whatsapp desde Windows o Mac fácilmente. Disponible para Windows 8+ y Mac OS 10.9+

¿Cómo puede la IA llevar la automatización de procesos al siguiente nivel?

¿Cómo puede la IA llevar la automatización de procesos al siguiente nivel?

Lea esto para saber cómo la Inteligencia Artificial se está volviendo popular entre las empresas de pequeña escala y cómo está aumentando las probabilidades de hacerlas crecer y dar ventaja a sus competidores.

La actualización complementaria de macOS Catalina 10.15.4 está causando más problemas que resolver

La actualización complementaria de macOS Catalina 10.15.4 está causando más problemas que resolver

Recientemente, Apple lanzó macOS Catalina 10.15.4, una actualización complementaria para solucionar problemas, pero parece que la actualización está causando más problemas que conducen al bloqueo de las máquinas Mac. Lee este artículo para obtener más información

13 Herramientas comerciales de extracción de datos de Big Data

13 Herramientas comerciales de extracción de datos de Big Data

13 Herramientas comerciales de extracción de datos de Big Data

¿Qué es un sistema de archivos de diario y cómo funciona?

¿Qué es un sistema de archivos de diario y cómo funciona?

Nuestra computadora almacena todos los datos de una manera organizada conocida como sistema de archivos de diario. Es un método eficiente que permite a la computadora buscar y mostrar archivos tan pronto como presiona buscar.