I am so glad that I have come across ‘mailinabox’ by submitting a post in reddit. So far, only heard good things about it.
However, I having troubles with its intial setup. The guide looks straight forward but I am not sure where I went wrong.
I own a server that is in my office that has Ubuntu 14.04 freshly installed for mailinabox. It has access to the internet.
I have a domain called- ‘gcode.com’. I also have a subdomain for this purpose- ‘mail.gcode.com’ hosted by GoDaddy. I would like my users send email using - ‘firstname.lastname@example.org’,‘email@example.com’ and so on…I want to access the mailinabox admin using ‘mail.gcode.com/admin’
During mailinabox setup, what do I put my hostname as in the mailinabox setup?
Do I need to make any change in my GoDaddy?
Do I have to add new NameServers to point to my Server?
Do I have to add new Mail Exchange under GoDaddy?
Currently, my subdomain- ‘mail.gcode.com’ points to an internal server that is hosting hmail and roundcubewebmail. I intend to change it for mailinabox.
To give you a bit of an overview, here’s what a model configuration might look like:
If MIAB setup completed successfully then the appropriate firewall ports will be opened on your-server.example.com to receive and send email. You should be using a static IP from your ISP, and they cannot be blocking port 25.
* You will need to set the Glue Records at your domain registrar. However, you can host the DNS anywhere you wish, but MIAB likes to do that for you since it will automatically configure the proper records for your hosted domains. If you go to the System -> External DNS page you will see a list of DNS records to set for your domains, if you wish to host their DNS elsewhere.
CAUTION: Changing your DNS settings may cause your other web services, such as website hosting, to stop functioning. Don’t change your name servers for gcode.com unless you can configure MIAB to point to the right IP addresses for your GoDaddy hosted services, and keep any such IPs up to date. Configure those on your MIAB before changing your name server records to the MIAB. Remember, you can use the External DNS page in the MIAB admin panel to find the DNS records to enter at GoDaddy instead of changing your domain name servers.
This gets you a basic working MIAB. Substitute in your own variables and see if there’s a mismatch.
Unfortunately that will not work, and why your mail is not being delivered. You need the IP address of the MIAB server to be a globally routable, public IP address (e.g. 220.127.116.11). The 192.168.1.25 address cannot be routed over the Internet, just the local network. That is going to be the first thing that you’ll need to address. You would most easily do this by getting a Virtual Private Server (e.g. digitalocean.com, vultr.com are both popular with MIAB users).
My MIAB lives at box.example.com, which is a DigitalOcean server. The A record for box.example.com is pointing to that servers IP: 18.104.22.168. Everyone on the internet can reach 22.214.171.124, and I added MX (the Mail Exchange) records for example.com as box.example.com in the GoDaddy control panel.
Not a problem. I certainly understand wanting to use the resources you already have. To host it internally you’ll need a few things:
Make sure you can put the server in a DMZ. This is the most straightforward and lowest maintenance way to host it on your network.
Make sure you have a static IP from your ISP.
Run your IP through the MXToolbox SuperTool to ensure your IP and domain are squeaky clean and not on any spam blacklists. MIAB set up will do this for you too. If they are on such blacklists, you should not deploy the MIAB right away. Instead work with your ISP/the blacklist provider to remove your IP, or ask them to assign another and test again.*
Make sure the ISP does not block ports 25, 465, or 587. These are the ports that mail clients and other email servers will use to connect to your email server. You can set up MIAB and then use the MXToolbox SuperTool to help you determine that the SMTP ports are open and available.
Ask your ISP to create or update the PTR record for that IP address to the hostname for your mail server.*
Add an A record in GoDaddy for your mail server, pointing at the IP address your ISP has assigned you.
You should go ahead and re-run MIAB setup to reconfigure the MIAB stack. Don’t worry, if you already have data it should not delete anything.
Now, once MIAB is reconfigured, login and go to System -> External DNS, and add the entries for your domain to GoDaddy’s DNS service. Make sure to set low TTLs in case something goes wrong, so you can easily correct the error with a minimum of downtime. Once you’re done, you can use intoDNS to make sure everything looks kosher. Good luck!
* Be aware of any fees your ISP may charge for these services. Some do, some do not.
Check back if you need more help or have more questions about how MIAB works
@J376A Thank you so much for helping me out!. I will still need some help as this is all new to me… you know like they say- ‘it gets worse before it gets better’
I am sure my ISP does not block any ports because before trying out MIAB, I deployed HMAIL with RoundCube Webmail, I was able to use emails just fine.
I was introduced to MIAB and heard its pretty good, so I am trying to install this.
As to calling my ISP and asking them to create/update PTR record- will that cause any of my existing websites to go down? Plus I have several other domains resting on that IP address for example gmcode, grcode and couple others are also hosted on GoDaddy and have webpages. ‘gcode’ is the main one so I want to have an email address using that. Hence, using implementing an email server using MIAB for ‘gcode’ domain so I can have email address such as firstname.lastname@example.org and so on…
Not a problem! Email and DNS can be a tricky topics and we all start somewhere
Changing the PTR (pronounced ‘pointer’) record shouldn’t harm any of the web services you’re already running unless you’re running email services at that IP address right now, or something unusual is in place. HTTP traffic generally only cares about getting to your IP address using your domain name, so changing the PTR record shouldn’t affect anything. You shouldn’t experience downtime with your ISP for this change either.
Without getting too far ahead of ourselves, you’ll be able to have this MIAB handle email for all your domains, so you don’t need to run multiple mail servers (unless you wish to, but doing that on a single IP is not advised.)
To my knowledge- there should not be any other email services running on that IP Address. However, I do have another domain in GoDaddy that uses GoDaddy email provider for our emails at the moment if that matters.
So I just call my ISP, tell them pointer my to mail.gcode.com? Where mail.gcode.com is ‘A’ host in the GoDaddy ‘gcode’ domain that points to my
Do I have to add any CNAME or MX in GoDaddy while I am it ?
As long as there isn’t another email server at that IP you should be okay. The GoDaddy email won’t become an issue for you to change your PTR.
Yep - just call them and ask them to update your PTR to mail.gcode.com. Then at GoDaddy, make an A record for mail.gcode.com point to your IP address. Once both of those steps are done you’ll have a mail server that passes forward-confirmed reverse DNS. That means that in the reverse DNS zone that ties IP addresses to domain names, mail.gcode.com will appear for that IP, and in your gcode.com DNS zone, the IP for mail.gcode.com will be your IP address. This is essential for good email deliverability.
You won’t need to add any CNAMEs for this, and we’ll want to make sure you can send and receive email before changing the MX records, to make sure you only change them after everything is working.
Once you have that done, you will:
Make sure your server can send and receive internet traffic. If you haven’t changed the network configuration from when you used hMail, you should be okay here. Remember we need the server to be in the DMZ.
Make sure that the reverse DNS is set properly (check out http://www.intodns.com/gcode.com, scroll down to the PTR section in MX [fourth up from the bottom]). If your IP address is for example 126.96.36.199, you should see “188.8.131.52.in-addr.arpa -> mail.gcode.com”. What you’re seeing is correct, the IP will be backwards and have .in-addr.arpa at the end. It should point to your mail server hostname.
Re-run MIAB setup on the server.
Now, you’ll want to test it to make sure it all works before deploying it into production use. To do so, you could create a test domain, for example: test.gcode.com in GoDaddy. Make the MX records for test.gcode.com to be your mail server. Then add a test user (maybe email@example.com) to receive mail on MIAB, and send some emails to the test user at the test domain (firstname.lastname@example.org). If you can send and receive to another provider, then you should be good to go. (Try sending and receiving to Gmail accounts, since those can be tricky.)
Once everything is up and running properly:
Add all the domains and users you want into MIAB.
Add the records from System -> External DNS to your GoDaddy DNS. You can delete the existing MX records from your domains and point them to mail.gcode.com.