Running Your Own Mailserver If Spectrum Is Your ISP
Intro
Hi. Thanks for reading this post. Maybe you're here because you're trying to host your own email server at home and spectrum is your ISP. And you can't. And so you are looking for workarounds. Well, just keep reading. I'll tell you what I did.
Background
So, I have a mailserver running here at home. It's running in a DMZ and my router is forwarding all outside traffic to the linux machine in question. I'm using the iRedMail server software, which I had set up and had running for a couple months now. I wanted to have @that-domain.com addresses, and instead of using iCloud to host mail for my domain, or paying for exchange online from Microsoft, I just decided I'd do it myself.
Let me explain a little bit about my mailserver. As I've said previously, it's running in a DMZ on my home network, in a vlan and subnet totally walled off. Nothing in that subnet can initiate a connection to anything else inside my network. I have my PfSense router set up to forward ports 25, 80, 443, and 993 to the box running iRedMail. I have the appropriate dns records; spf, DKIM, DMARC, MX, set up so mail is received by other people and they can reply.
But, when I first was getting this running, I had a problem where emails would always get rejected by receiving mailservers because of Spamhauss. It turns out that they've blacklisted all Charter Communication IP ranges, which is my ISP. Which makes sense, usually most people wouldn't ever send email from a residential IP address. But I'm not most people. And I wanted to run my own email server, at my house, and so it would have to originate from my IP address.
Well, there's no way to get off that blacklist, so I did some research and found out a workaround. Postfix, which iRedMail uses to send emails, has a configuration option called "relayhost", and that would tell it to use SMTP relay to send your email through another server. So I simply set relayhost=mobile.charter.net, and my problems were solved. I could send, people could receive.
But, here after I just moved apartments and got a different IP address, mobile.charter.net is now rejecting my messages. I would get undelivery reports that looked something like:
email@gmail.com: host mobile.charter.net[47.43.18.12] said: 550
5.1.0 mtilley@that-domain.com sender rejected (in reply to MAIL FROM
command)
Reporting-MTA: dns; mailserv.that-domain.com X-Postfix-Queue-ID: 4Qr54f3mBVzKq6N X-Postfix-Sender: rfc822; mtilley@that-domain.com Arrival-Date: Tue, 27 Jun 2023 09:23:14 -0400 (EDT)
Final-Recipient: rfc822; email@gmail.com Original-Recipient: rfc822;email@gmail.com Action: failed Status: 5.1.0 Remote-MTA: dns; mobile.charter.net Diagnostic-Code: smtp; 550 5.1.0 mtilley@that-domain.com sender rejected
My solution
I looked around briefly, and never came to a conclusion as to why their server was doing this, and didn't really want to try to figure out a way to get around Spectrum's side. So I just found a different SMTP relay host. I used smtp2go, which is kind of aimed at people who need SMTP relay for email marketting campaigns. But their free teer, which I believe is 1000 emails a month, worked fine for me.
I set up an account with them to try things out. They wanted me to verify my domain by adding a few DNS records, so I did that. They allow you to enter trusted IP addresses into their system so you don't need to authenticate, and I did that too. Then I told my mailserver to start relaying through mail.smtp2go.net:2525 and just like that, I could send again.