Skip to content

Instantly share code, notes, and snippets.

@theProgrammerDavid
Last active March 5, 2020 06:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save theProgrammerDavid/b4d0102571b381a24c587f87e4ae23d2 to your computer and use it in GitHub Desktop.
Save theProgrammerDavid/b4d0102571b381a24c587f87e4ae23d2 to your computer and use it in GitHub Desktop.
Adventures with Mail-in-a-box

Mail-in-a-box Guide based on hours of errors/troubleshooting.

The official maintainence guide for Mail-in-a-box can be found here

Note: You should always make regular backups of files.

Help! My emails are going to spam

  • If you have just created/bought a domain and setup Main-in-a-box to be your mail server but realise that all of your emails are going to spam, this may help you out.
  • An A record alone is not sufficient for your mail server. You need several TXT records so that GMail or any other email provider can verify the integrity of your mail server. DMARC, DKIM need a TXT record each.
  • Consider using many free online tools to check your emails. email-tester is a popular online tool that i use often.
  • The content of your email and the structure and the presence of common spam associated keywords will also affect the chances of it being flagged as spam. email-tester also shows you your spam-assassin rating.
  • Finally, domain age and domain reputation also play a big role.
  • If you would be sending bulk emails to GMail users, consider using google postmaster to view analytics

I want to move Mail-in-a-box to another Digital Ocean account (The Shortcut, but not recommended)

  • If you have any important data, be sure to always keep a backup
  • Create a snapshot of your droplet (you can power off the droplet after the snapshot)
  • Change the owner of your snapshot, see this guide
  • Resume the transferred snapshot
  • Change the DNS records to point to the new droplet
  • Log into the web admin panel at /admin . If there are no errors, everything is good. If there are errors (red text), re-install Mail-in-a-box

How do i re-install Mail-in-a-box ? (Unofficial, however, this should work in most cases)

  • Delete the mailinabox directory commonly located at ~/mailinabox
  • Rename the /etc/nginx/conf.d/local.conf to /etc/nginx/conf.d/local.conf.deleted if you would want a copy
  • Rename the /etc/nginx/conf.d/ssl.conf to /etc/nginx/conf.d/ssl.conf.deleted if you want to keep a copy
  • Restart nginx systemctl reload nginx.
  • Run the installer from the official website and once its done, everything should continue to work as normal.

BCC-ing people: (credits namsnath )

BCC all mails sent to a given address:

  • nano /etc/postfix/main.cnf
  • add to the end: sender_bcc_maps = hash:/etc/postfix/sender_bcc_maps
  • nano /etc/postfix/sender_bcc_maps
  • Add lines in this format: <sender@email.com> <bcc@email.com>

BCC all mails recieved on a given address:

  • nano /etc/postfix/main.cnf
  • add to the end: recipient_bcc_maps = hash:/etc/postfix/recipient_bcc_maps
  • nano /etc/postfix/recipient_bcc_maps
  • Add lines in this format: <recipient@email.com> <bcc@email.com>

Pro tips and other stuff:

@thebongy
Copy link

thebongy commented Mar 5, 2020

v nice

@thebongy
Copy link

thebongy commented Mar 5, 2020

i'm a liky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment