Table of Contents

Mail in a Box

Installation

$ curl -s https://mailinabox.email/setup.sh | sudo -E bash
## https://xx.xx.xx.xx/admin

Configuration

// generate an account private key
$ openssl genrsa 4096 > account.key
$ openssl rsa -in account.key -pubout

Vps

$ sudo nano /etc/hosts
  < /etc/hosts >
    127.0.1.1 some_domain.com mail
    127.0.0.1 localhost
$ sudo nano /etc/hostname
  < /etc/hostname >
    some_domain.com
$ sudo hostname some_domain.com
$ sudo hostname
  # some_domain.com

Digitalocean

droplet name: ${hostname}
reverse DNS: (automatic) ${hostname}
## check if IP is on a spam block list and request a clean IP
## https://mxtoolbox.com/SuperTool.aspx?action=blacklist%3a94.76.202.152&run=toolpage#
${droplet}
  > Add a domain
    hostname: ${hostname}
  > Create new record > A
    Hostname: *
    Directed to: ${droplet}
    TTL: 3600
  # DNS Records
  # Type  Hostname                Value                             TTL (seconds)
  # A     some_domain.com   directs to ${ip}                  3600
  # NS    some_domain.com   directs to ns1.digitalocean.com   1800
  # NS    some_domain.com   directs to ns2.digitalocean.com   1800
  # NS    some_domain.com   directs to ns3.digitalocean.com   1800

Namecheap

Advanced DNS > Personal DNS Server
  Register Nameserver > Add Nameserver
    Nameserver: ns1.mail
    IP address: ${ip}
    Find Nameservers > Custom Nameservers
      ns1.mail.${domain}
    Nameserver: ns2.mail
    IP address: ${ip}
    Find Nameservers > Custom Nameservers
      ns2.mail.${domain}
    Nameserver: ns3.mail
    IP address: ${ip}
    Find Nameservers > Custom Nameservers
      ns3.mail.${domain}
Domain > Nameservers > Custom DNS
  ns1.mail.${domain}
  ns2.mail.${domain}
  ns3.mail.${domain}