# Setting Up A Box Using Namecheap and Digital Ocean

**URL:** <https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416>\
**Category:** Help with Setup/Upgrade\
**Created:** [October 21, 2024, 6:09pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416 "2024-10-21T18:09:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 21, 2024, 6:09pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/1 "2024-10-21T18:09:22Z")

</div>

I have a domain on namecheap that hosts my web app, lets say [www.ultrawebapp.com](http://www.ultrawebapp.com)  
I want a subdomain that will be used by for MIAB, lets say [mail.ultrawebapp.com](http://mail.ultrawebapp.com)

I have created the ‘glue records’ in namecheap. I have installed the MIAB software on my digital ocean droplet.

Nameserver config:  
[mank.ns.cloudflare.com](http://mank.ns.cloudflare.com)  
[marnk.ns.cloudflare.com](http://marnk.ns.cloudflare.com)  
[ns1.mail.ultrawebapp.com](http://ns1.mail.ultrawebapp.com)  
[ns2.mail.ultrawebapp.com](http://ns2.mail.ultrawebapp.com)

DNS records:  
ns1.mail 123.456.78.90  
ns2.mail 123.456.78.90

The problem is when i visit [mail.ultrawebapp.com/admin](http://mail.ultrawebapp.com/admin), it does not show me the MIAB interface. But when visiting the droplets ip address, i see the MIAB interface.

[Similar issue on this forum](https://discourse.mailinabox.email/t/how-to-setup-glue-records-in-namecheap/4069)

I have read the above thread and tried the solutions suggested but to no avail.

What must I do?

---

<div class="post-metadata">

**Author:** ![Player](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/e19b73/32.png) [@Player](https://discourse.mailinabox.email/u/Player)\
**Post date:** [October 21, 2024, 7:34pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/2 "2024-10-21T19:34:18Z")

</div>

Using both Cloudflare’s and your own nameserver concurrently doesn’t really work unless you manually synchronize them. Cloudflare probably doesn’t know about the mail subdomain. You should use either (preferably) MIAB for all DNS services for the domain or Cloudflare as external DNS configured in MIAB.

You can run `dig @123.456.78.90 mail.ultrawebapp.com A` on an external machine to see what’s going on. It should resolve the address to the desired ip and show the nameservers in the other sections.

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 21, 2024, 8:20pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/3 "2024-10-21T20:20:20Z")

</div>

Hey thanks a bunch.  
I rather cloudflare as external dns because of the current architecture of my apps.  
Does this mean I have to go to cloudflare and add the subdomain and ip of the droplet?  
If there is another option too please show me how to go about it.

EDIT: this is the output of the dig command:

```bash
~$ dig @123.456.78.90 mail.ultrawebapp.com A

; <<>> DiG 9.18.28-0ubuntu0.22.04.1-Ubuntu <<>> @123.456.78.90 mail.ultrawebapp.com A
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57372
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;mail.ultrawebapp.com. IN	A

;; ANSWER SECTION:
mail.ultrawebapp.com. 86400	IN	A	123.456.78.90

;; AUTHORITY SECTION:
ultrawebapp.com. 86400	IN	NS	ns1.mail.ultrawebapp.com.
ultrawebapp.com. 86400	IN	NS	ns2.mail.ultrawebapp.com.

;; ADDITIONAL SECTION:
ns1.mail.ultrawebapp.com.	86400	IN	A	123.456.78.90
ns2.mail.ultrawebapp.com.	86400	IN	A	123.456.78.90

;; Query time: 259 msec
;; SERVER: 123.456.78.90#53(123.456.78.90) (UDP)
;; WHEN: Mon Oct 21 21:22:57 WAT 2024
;; MSG SIZE rcvd: 127

```

---

<div class="post-metadata">

**Author:** ![vele](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/v/e5b9ba/32.png) [@vele](https://discourse.mailinabox.email/u/vele)\
**Post date:** [October 21, 2024, 8:59pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/4 "2024-10-21T20:59:19Z")

</div>

You have to go to MIAB admin page and \>\> Use External DNS and replicate all the DNS entries listed there, in your Cloudflare. It is painful but once it is setup it should be OK.

---

<div class="post-metadata">

**Author:** ![Player](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/p/e19b73/32.png) [@Player](https://discourse.mailinabox.email/u/Player)\
**Post date:** [October 22, 2024, 12:18am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/5 "2024-10-22T00:18:33Z")

</div>

The output looks right, assuming the ip there is the same as your miab instance’s public ip. It is possible that if it (randomly) selects a different nameserver it’ll yield no or a different ip instead.

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 22, 2024, 9:30am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/6 "2024-10-22T09:30:51Z")

</div>

AYE!!! Thanks fam. This was the solution.

I updated the cloudflare records and everything is honky dory.

Thank you all very much for pointing me in the right direction.  
Till the next issue arises and we meet again, have a good one. 🤗

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 23, 2024, 6:30pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/7 "2024-10-23T18:30:11Z")

</div>

Hello everyone. I currently have the following challenge on my box instance on digital ocean.

I cannot send emails. when i do try to send mails to someone, i get an error.

 ![email-err](https://discourse.mailinabox.email/uploads/default/original/2X/a/a0a86beca7e189a60673a841c2ef0484e78125dd.png)

i also noticed in the status check this message:

> Outbound mail (SMTP port 25) seems to be blocked by your network. You will not be able to send any mail. Many residential networks block port 25 to prevent hijacked machines from being able to send spam. A quick connection test to Google’s mail server on port 25 failed.

How do i fix this problem i.e inability to send mail. Thank you

---

<div class="post-metadata">

**Author:** ![vele](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/v/e5b9ba/32.png) [@vele](https://discourse.mailinabox.email/u/vele)\
**Post date:** [October 23, 2024, 7:32pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/8 "2024-10-23T19:32:47Z")

</div>

Digital Ocean blocks Outbound port 25 on any new instances. You might try support and ask them to open it and give a statement that you will not send unsolicited mail.

> **[Why is SMTP blocked? | DigitalOcean Documentation](https://docs.digitalocean.com/support/why-is-smtp-blocked/)**
>
> SMTP port 25 is blocked on all Droplets for new accounts to prevent spam and other abuses of our platform.

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 23, 2024, 9:11pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/9 "2024-10-23T21:11:47Z")

</div>

hmmm. thank you very much. are there any cloud providers who do not block this Port?

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 24, 2024, 10:06am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/10 "2024-10-24T10:06:22Z")

</div>

Digital Ocean offers a sendgrid solution for emailing. [Sendgrid for mail](https://marketplace.digitalocean.com/apps/sendgrid)  
I have two questions:

1. Is it possible to integrate sendgrid with MiaB?
2. Is it possible to change the port MiaB sends mail from?

---

<div class="post-metadata">

**Author:** ![vele](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/v/e5b9ba/32.png) [@vele](https://discourse.mailinabox.email/u/vele)\
**Post date:** [October 24, 2024, 10:10am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/11 "2024-10-24T10:10:13Z")

</div>

@alento has suggested a number of them and there are people here with affiliate codes that might recommend you ISPs depending on location. I am using a German based one now they have a partner in Virginia USA if you don’t want to be based in Europe. [Netcup.de](http://Netcup.de)

You might as well read this [Best VPS hosting provider - #7 by pm74](https://discourse.mailinabox.email/t/best-vps-hosting-provider/7337/7)

---

<div class="post-metadata">

**Author:** ![vele](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/v/e5b9ba/32.png) [@vele](https://discourse.mailinabox.email/u/vele)\
**Post date:** [October 24, 2024, 10:14am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/12 "2024-10-24T10:14:57Z")

</div>

Yeah you can use sendgrid or mailgun or mailjet. You need to edit /etc/postfix/main.cf and setup a relay. This is well documented. Just google setup postfix relay server. Or search this forum Setup MIAB as relay.

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 24, 2024, 10:23am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/13 "2024-10-24T10:23:51Z")

</div>

Thank you. Will do just that. Will update thread of my progress

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [October 28, 2024, 12:16pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/14 "2024-10-28T12:16:07Z")

</div>

I used this [thread](https://discourse.mailinabox.email/t/how-to-send-email-from-miab-using-an-external-smtp-relay/4248/4) and did as requested. still cannot send email.

I am trying to use sendgrid as the relay smtp server and it does not yet work.

---

<div class="post-metadata">

**Author:** ![vele](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/v/e5b9ba/32.png) [@vele](https://discourse.mailinabox.email/u/vele)\
**Post date:** [October 29, 2024, 10:34am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/15 "2024-10-29T10:34:12Z")

</div>

If you are using Sendgrid. First verify your domain there.  
Then edit main.cf.

Insert these lines in /etc/postfix/main.cf via `sudo nano /etc/postfix/main.cf`

```auto
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
relayhost = [smtp.sendgrid.net]:587

```

Hit ctr+x and save the file  
Then make file `sudo nano /etc/postfix/sasl_passwd`  
`[smtp.sendgrid.net]:587 your_username:your_password`  
See credentials in your Sendgrid admin panel.

Hit ctr+x and save the file  
Then:

```auto
sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd

```

Then:  
`sudo systemctl restart postfix`

In MIAB admin panel Custom DNS\>\> insert TXT record for SPF records as permited senders for Sendgrid, read the instructions on sendgrid how to do it but it should be a TXT record something like this:  
`v=spf1 include:sendgrid.net -all` .

Of course replace the examples above with the sendgrid credentials.  
You are now good to send via the relay. MIAB will still show errors for outbound port 25 but you just ignore that.  
Exvuse any spelling mistakes in the commands use tab for the correct paths.

EDIT: Also inspect main.cf for any duplicates as they may mess postfix. put a hashtag # infront of any disabled lines

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [November 1, 2024, 6:38pm UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/16 "2024-11-01T18:38:49Z")

</div>

Thanks very much for the help. I did this and so far I see no change. I know I am just one config away from making it work.

I noticed this main.cf file

```txt
#smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_banner=$myhostname ESMTP Hi, I'm a Mail-in-a-Box (Ubuntu/Postfix; see https://mailinabox.email/)

```

is this okay?

---

<div class="post-metadata">

**Author:** ![vele](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/v/e5b9ba/32.png) [@vele](https://discourse.mailinabox.email/u/vele)\
**Post date:** [November 2, 2024, 10:17am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/17 "2024-11-02T10:17:45Z")

</div>

Your main.cf should have the entire postfix config. Not just the 2 lines.  
Did you manage to setup the relay? As per the instructions above.

---

<div class="post-metadata">

**Author:** ![lexxluey](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/l/4491bb/32.png) [@lexxluey](https://discourse.mailinabox.email/u/lexxluey)\
**Post date:** [November 4, 2024, 8:43am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/18 "2024-11-04T08:43:29Z")

</div>

Yes I setup the relay as per instructions.  
I commented out duplicate assignments.  
I added everything as per the instruction.

my main.cf is has many lines. I just taught maybe this line was the cause of the problem.

Somehow I still feel I am missing something because this has worked for many others. So definately I am missing something. But don’t know what it is.

If you are interested, I can DM you the snapshot of my present configs on MiaB and maybe the external DNS so we can troubleshoot further.

Thank you.

---

<div class="post-metadata">

**Author:** ![vele](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/v/e5b9ba/32.png) [@vele](https://discourse.mailinabox.email/u/vele)\
**Post date:** [November 4, 2024, 10:13am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/19 "2024-11-04T10:13:50Z")

</div>

Yeah go ahead DM me. Send me the main.cf. And a screenshot of your MIAB status. I recommend you rerun MIAB setup before sending me anything

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

---

<div class="post-metadata">

**Author:** ![system](https://discourse.mailinabox.email/uploads/default/original/2X/4/4d0933d13c456b7e57f296aa6cc344525b6f0c70.png) [@system](https://discourse.mailinabox.email/u/system)\
**Post date:** [November 11, 2024, 10:14am UTC](https://discourse.mailinabox.email/t/setting-up-a-box-using-namecheap-and-digital-ocean/12416/20 "2024-11-11T10:14:41Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
