How would I set up MIAB to serve the same domain as another mailserver?


I am interested in setting up MIAB as a personal mailserver. However, there’s an issue I’d like to address.

I’d like to keep my address if possible; however, the domain for my address is also used by a few other people who all use Gmail.

I’m pretty sure that there’s no way I’m convincing these people to move to my server. So, I’d like to ask: is it possible to set up MIAB in such a way that email for one address is sent to MIAB and the mail for all the other addresses is sent to Gmail as usual?

For example, mail sent to is sent to the MIAB and mail sent to is sent to the respective Gmail inbox.


Yes, with the email account you could create a filter in Roundcube to forward mail to an external email address. I have to admit I haven’t done it before, but the filters are reasonably straight-forward. Alternatively, you could use the feature in Gmail where it logs in and checks mail on MiaB, or at least they used to have that feature.

Would they still keep the ability to send mail from Gmail and retain their address?

I should’ve clarified in the original post; they still need the ability to send mail.

For now, I guess I’ll just get another domain and redirect mail sent to my Gmail inbox to my MIAB, but I’m still curious about if there’s a way to have such a setup as the one I described.

These are features of Gmail, which previously included sending and receiving using other domains. You should search their help section and look through the settings in your Gmail account.

Thanks for the tip. There does seem to be an option in Gmail for sending and receiving email from other accounts.

However, some of the people using this domain aren’t that tech savvy and I’d rather not risk potentially disabling access to their email. (Plus, I heard from someone that while using said option in Gmail, the sent field shows up as something like this: on behalf of

I think I’ll go the forwarding route. I just have to sort a few things out with my hosting provider and my registrar and then I’ll officially start setting up my Mail-in-a-box. Thanks for your help!

One thing to watch out for is SPF. We used to use forwarding for coaches of a small youth sports club. They had club email addresses which forwarded to their personal addresses. No muss setup for them 10 years ago when they didn’t really want to worry about email anyway.

Now, however, these emails often fail SPF. And that is in the hands of the original sender’s service. When the email is forwarded, the sender is still the original, but it is being sent by our server which, of course, is not listed in the sender’s SPF policy.

I think gmail gets away with it with the on behalf of thing or reply to.

Just another thing to watch for.

Thanks for the warning.

I plan to forward emails sent to my Gmail inbox to my MIAB, but I would still send emails from my MIAB.

Actually, it isn’t the email you send, it’s the email you receive. Sender A uses Server A to send email to your Gmail inbox. When Gmail forwards Sender A to MIAB, MIAB sees it as Sender A sending from Gmail rather than Server A and, if their SPF is set up, MIAB says no, Sender A can’t send from Gmail.

Granted, a lot of this depends on configuration on the senders end that you don’t know about and varies drastically from sender to sender. You also have control over your MIAB and may be able to filter away whatever difficulty comes up.

Oh, okay. That’s something I will have to look out for then.

Also, the IP for my VPS is on both UCEPROTECT Level 2 and Level 3. Fun.

Oooooh. Level 2 I think is where you really start getting noticed. I started mine on Digital Ocean and it has never been off of level 3. I moved everything to Linode and have been very happy. They are usually clean across the board. Occasionally they will get on UCEPROTECT 3, but they are usually off within a few days. I have heard similar things about Vultr. I looked at them but needed to do some things with DNS that they didn’t offer.

Well, seems like you got lucky. I’m using a Linode VPS in Germany.

Okay, my emails are going into spam.

I should probably just set up DNSsec.

Edit: And I can’t do that because the provider I used for a test domain doesn’t support DNSSec.

Thanks for your help. I’ll try to set up the server on my own and I’ll come here if I hit any major roadblocks.

Since the mail comes into a server you control, you may be able to mitigate some of the problem. My problem is that it was being forwarded out to large common ISPs and end users who weren’t real good with handling email.

If you can find a common factor to narrow the forwarded email down you could filter on that and move it to you inbox. Could be as little as messages to you with Gmail as the server.

The short answer is not reliably. The longer answer is that Google Workspace claims to support this with split-domain routing, but they do not take into consideration standard email standards which would prevent this from working reliably. So, I advise to skip this and not even try.

Also, I edited the subject to more accurately reflect your question when others seek information on the same subject.

You can do this by placing a SMTP relay with higher priority as an MX server on your DNS settings. This will make incoming email be sent to the SMTP relay first. Then, you can configure the SMTP relay to forward the emails to the correct destination server (gmail/MIAB).

Your MIAB and Google MX settings must still exist as valid MX servers on your DNS, just with lower priority.

I won’t be able to teach you how to do this, but it is doable. Do note though that if your SMTP relay is down, the sender servers will try to go to the next servers on your MX settings and this may cause bounce backs.

It is also generally ill advised to have a SMTP relay, and if you do, you have to secure it from hell and highwaters.

Thanks for the suggestion, but I’ve basically given up on doing this.

I’ve also yet to figure out why my emails are going to spam, even with a .eu domain. I’ll take a look at it later, I suppose.

On the receiving end, you can try checking the email headers… sometimes the spam score is put there and you can figure out why. You can also try which I use to sometimes help new deployments if they get caught.

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