mail-autodiscover-autoconfig icon indicating copy to clipboard operation
mail-autodiscover-autoconfig copied to clipboard

Multi Domain Support

Open fleaz opened this issue 1 year ago • 4 comments

Hey,

I started nearly the same project a few months ago, but only implemented Thunderbirds Autodiscover so far, so yours is already way more advanced than mine.

But one feature I implemented, which was also lacking from all the other already available tools I found was support for multiple domains. Most of the times a mailserver serves multiple domains and the fact that they use the same mailserver, results in the same config for all of them, therefore running a tool x times for every domain felt wrong to me and would massively increase the work when e.g. onboarding a new domain.

I did some research regarding the different mailconfig methods and came to the conclusion that hosting the tool once, on one domain and pointing all the other domains via one CNAME and a SRV to the "main domain" where the tool runs, should work. But maybe you have more knowledge about other methods that would not be compatible with this. I documented most of my findings and the way the DNS needs to be configured in the README of my project if you want to have a look.

Sadly I can't write any Rust so I'm not able to work on a PR for this, but if you could consider this feature I could stop working in parallel on my own tool and start using yours on multiple mailservers of mine :)

Best, fleaz

fleaz avatar Aug 25 '22 21:08 fleaz

Hey!

Just reading quickly this before sleeping, I will make an in depth response tomorrow

I did some research regarding the different mailconfig methods and came to the conclusion that hosting the tool once, on one domain and pointing all the other domains via one CNAME and a SRV to the "main domain" where the tool runs, should work.

That's exactly how this tool works, it assumes all domains are configured the same way and if not just add it to CUSTOM_DOMAINS to use the {imap,pop,smtp}.domain.tld syntax

So in short I run only one instance of this project. Make CNAMEs to it. And make some domains use the custom syntax (I avoid it because it's painful to have a SSL certificate on the server having all the domain names in it). All the other domain names just use the configured mail server host names.

williamdes avatar Aug 25 '22 21:08 williamdes

Hi back 👋🏻 ,

After a full re-reading I have come to the same conclusion as yesterday

I did some research regarding the different mailconfig methods and came to the conclusion that hosting the tool once, on one domain and pointing all the other domains via one CNAME and a SRV to the "main domain" where the tool runs, should work. But maybe you have more knowledge about other methods that would not be compatible with this. I documented most of my findings and the way the DNS needs to be configured in the README of my project if you want to have a look.

So, like I wrote: this is way I actually do in production. I have at least 5 domains pointing at it now. It dynamically uses the base domain name from the URL. Let me know if this suits your needs. I can adapt the code too

Sadly I can't write any Rust so I'm not able to work on a PR for this, but if you could consider this feature I could stop working in parallel on my own tool and start using yours on multiple mailservers of mine :)

No worries, I can write Rust, I am still learning but it's way easier now. Have a try ;)

williamdes avatar Aug 26 '22 20:08 williamdes

Thanks for the reply. This sounds pretty awesome and like it would fit me need. :) I will give it a go in the next days and report back.

fleaz avatar Aug 29 '22 11:08 fleaz

Hi @fleaz What do we have left to do in order to close this issue ?

williamdes avatar Feb 12 '24 22:02 williamdes