I’m fairly new to the vps world, i’ve used shared hosting for over 6 years and because our Laravel app got bigger and we needed queu workers, we made the switch to digitalocean droplet with Laravel Forge.
Everything’s running smootly except our emails… i dont want to use google mail services or anyother because we have a few mails on our team and that’s why i made another droplet for Mail-in-a-box server.
i’ve found the following link and made the same changes:
For those who struggled to integrate sendgrid with mail in a box, you need to edit the contents of main.cf located in /etc/postfix/ like mentioned in the following post:
However i thought that i needed to change the contents of main.cf file to the given details on the tutorial, which is not the case,
you just need to do the following:
change following line in main.cf:
relayhost = → relayhost = [smtp.sendgrid.net]:587
and append/add the following text block under relayhost
First I just wanted to thank you and the community for these instructions on setting up Sendgrid as an SMTP relay service. It works great to get around the insufferable IP reputation issue (due to the UCEPROTECTL3 blacklist) that comes with being a Digital Ocean customer.
These instructions worked perfectly. But like others will surely find out, if they haven’t already, using Sendgrid comes with its own set of issues. Their IP’s get blacklisted too and since you’ll, in most cases, be using a shared IP, your reputations will get slammed with the rest of the spammers - AGAIN! So, if you’re like me, you’ll want to try Mailgun. The issue with Mailgun is they force you to authenticate each domain name you use on your MIAB install. In that case, here are the steps I followed to get that up and running. If you’re only running one domain name on your MIAB, then you can probably follow the same steps for Sendgrid except for the one line that should look like this instead:
İ’ve switched over from DO to hetzner, because of the price and ip listing. İm using entirely my own email server now without relay hosts. And ip’s are not blacklisted. İm allready using it for a few months.
Spin up a Lightsail instance in AWS using Ubuntu 22.04 with the requisite RAM and CPU
Grab a static IP address and don’t ever release it.
Assign it to the Lightsail host
Fully patch the host and open all the right ports. I also disable IPv6 on the Lightsail host
Install MIAB using all the default settings
Request reverse DNS and open Port 25 on AWS PROMISING that you host is not a relay server, can ONLY send email for your domain name. If they refuse, reply to them telling them again that you are setting up email for your own domain and x number of users and IT WILL NOT BE A SPAM RELAY Server - ergo… INSIST
Once RDNS is in place, try to send some emails to hotmail.com, outlook.com, and others and see which fail. Note you test emails should have a proper subject line and copy the Lorem Ipsum test into the body. dont use all Capitals etc. Make the test emails as realistic as possible
Once MS start failing with a message that your IP block is blocked by them, contact Microsoft Robots and request “remediation” of the IP. The will always come back and say NO. but like AWS, send another message explaining the IP is a properly set up mail server that it NOT a relay, is fully DMARC compliant with SPF and DKIM enables and working etc etc etc. They may refuse twice, but insist they remediate
Then Presto, you have a fully functioning mail server with a good reputation.
It may take you 3-4 days to establish things to this point, but the message is, don’t give up when AWS or MS say no.
I now have 3 servers all running having gone thru this process and all work flawlessly.
ive created servers till i got an ip which is not blocked on ALL platforms, im using it for 2 years and just checked on proofpoint and it isnt blocked there also
just my 2 cents, create “servers” till you get a good ip and then begin your miab or other mailserver installations.