Issue setting up multiple MIBs for a backup MX

I may be going about this wrong, so please feel free to constructively correct me if that is the case. TL;DR: I am having issues when sending mail from one domain I own to another domain I own when one domain’s backup MX is hosted by the other domain.

I own/control two domains. For the sake of this discussion, let’s call them “mydomain .com” and “yourdomain .com”. Each domain is hosted on its own Linode, running MIB. The servers are thus called mail.mydomain .com and mail.yourdomain .com, respectively. The DNS entries are set up such that the primary MX for yourdomain .com is mail.yourdomain .com (as you would expect), and a backup MX record of mail.mydomain .com (just in case your Linode is down).

On mail.yourdomain .com, we have an email set up “you@yourdomain .com”. On mail.mydomain .com, we also have that same email account set up (you@yourdomain .com) in case the primary MX is down and your email is sent here.

Additionally, on mydomain .com, I have an email set up “me@mydomain .com”, and this is where the problem comes in. With all services up and running as normal, I would expect all mail sent to you@yourdomain .com to go to the MX server mail.yourdomain .com. However, if I send an email from me@mydomain .com to you@yourdomain .com, it’s always received by the backup MX (the one at mail.mydomain .com). If I send it from any other domain, it correctly routes to the primary MX. The reason for this seems to be because, when sending from mail.mydomain .com, rather than look up the MX record associated with the address you@yourdomain .com, it simply finds that address on the server and thus never sends it out; the message is instead processed internally. That kind of makes sense, because if I had an address like “wife@mydomain .com”, I would expect it to just route the email internally rather than send it out across the Internet, only to end up back at the same place. However, since we’re talking about a different domain here than the one where it originated, I’d like for MIB to first check to see if there is a MX serving that domain before using the internal account.

Is there a way to accomplish this? Of course I could spin up a third Linode, something like backupmx.mydomain .com and then use that as the backup MX for any number of domains, and not use it at all for sending emails. Maybe that’s the proper way to do this. Of course, I would incur the cost of spinning up that additional Linode, and all I’m really trying to do here is establish some cheap and easy form of redundancy. In particular, to protect ourselves from the possible condition that we would get locked out the Linode for some reason, and then the only email address that Linode has to contact us on is hosted on the server that’s down. That could create a real mess. Here again, we could obviously use a “backup address” like gmail or something, but the whole idea here is that we’re trying to completely divorce ourselves from depending on email accounts and providers that live outside of our domain, and services that we don’t have 100% control over.

Thanks!

Hi, I think you’re pushing uphill against MIAB’s design. MIAB is intended as a little, one-stop mail server. Like any software, I can be twisted to do all sorts of things, but each twist adds more complexities, breaks in unexpected ways, and adds grief.

If you really need backup/fail-over servers, then MIAB is not really the way to go. You could look at building up your infrastructure yourself. Beware - that is an involved process, with many ways to get things wrong!

Re your basic use-case of backup servers. For most cases, backup/fail-over is just not necessary for email. All senders should retain mail until they are sure that is has been received and stored by the destination (or the next hop of the route). All servers I’ve seen will retain mail and retry for several days, giving you (or Linode) plenty of time to bring your server up after a problem. (Personally, I would invest a little effort in monitoring your server, rather than lots of effort duplicating things.)

Add filter from roundcube. gmail for example. This way you won’t lose any e-mail.

Thanks. I was kind of afraid that might be the case. It’s not a dealbreaker. Frankly, I’m overly impressed at just how robust MIAB is. I’m a .Net developer. There’s plenty of SMTP stuff baked in to the framework, and SMTP is pretty straightforward. Doing the other end of it though-- The IMAP-- I was frankly amazed that The Code Project didn’t have one out there I could build and modify. Anyway, that’s what brought me to MIAB. I’m not sure what it’s written in. Probably Python or something. :slight_smile:

Anyway, for what it’s worth, I agree that the generally accepted standard today is for the sending agent to confirm receipt and then try again if it fails, as opposed to having a chain of redundant MX servers. My reason for doing that is for the unforeseen case when the Linode is down or we get locked out of the Linode account. The only customer service hat some of these companies like Zone Edit and Linode have is via email, and if my email is hosted on the server that is down, then they would have no way to interact with me. There are obviously other ways to mitigate that, and even in the case of MIAB this wouldn’t be an issue were I not trying to basically have two servers be the backup MX for each other.

Hi. A filter? Sorry, I’m not sure where you’re going with that. Can you please elaborate? Thanks!

Let’s have some fun

box main

dns add host subdomain

box.contoso.com 12.23.45.67

mybox.contoso.com 12.23.45.67

dns add mx

mybox.contoso.com. mx 10 box.contoso.com.

email-adress
rihanna@contoso.com

1 mx subdomain add domain mybox.contoso.com
add alias rihanna@mybox.contoso.com > rihanna@contoso.com

2 mx add alias rihanna@contoso.com > rihanna@mybox.contoso.com

rihanna@contoso.com > (forwad mx) rihanna@mybox.contoso.com → (alias) rihanna@mybox.contoso.comrihanna@contoso.com
email → mx2.contoso.com ->->->->->->->-> mx1.contoso.com → mailbox




jfeazell

wait what is it