I see that Cloudron since 6.1 has supported autoconfig for mail clients (mostly Thunderbird and any mail clients that support that same protocol). However, it looks like Cloudron requires an app located at the bare/naked domain so that the Nginx can generate the autoconfig setup.
That requirement leads to a problem scenario for Cloudron admins who have clients who have websites hosted elsewhere and only using us for email hosting. In my case I recently onboarded a client who only wants me to handle email as their web designer already hosts their website (but doesn't do email). This means I cannot offer up an app located at their bare domain since it'd be used already to point to their external web server.
What is the recommendation in such a scenario, if we have one?
I came up with what I think is a workaround. It means I'm doing it manually instead of Cloudron, but that's not a big deal as these values don't really change.
I created a DNS record for them in their domain for autoconfig.<clientDomain>.<tld> which is a CNAME to autoconfig.<myDomain>.<tld>, which resolves to a Surfer app on their domain and mine for autoconfig. I then created a mail folder in the Surfer app, and then the config-v1.1.xml file for Thunderbird which then contains the following data (some of it is substituted out of course):
<?xml version="1.0" encoding="UTF-8"?> <clientConfig version="1.1"> <emailProvider id="myMailServerDomainName"> <domain>example.com</domain> <domain>example2.com</domain> <displayName>DisplayName</displayName> <displayShortName>ShortName</displayShortName> <incomingServer type="imap"> <hostname>mail.myMailServerDomainName.TLD</hostname> <port>993</port> <socketType>SSL</socketType> <authentication>plain</authentication> <username>%EMAILADDRESS%</username> </incomingServer> <outgoingServer type="smtp"> <hostname>mail.myMailServerDomainName.TLD</hostname> <port>587</port> <socketType>STARTTLS</socketType> <authentication>plain</authentication> <username>%EMAILADDRESS%</username> </outgoingServer> </emailProvider> </clientConfig>
I ran some tests in Thunderbird and it seemed to work for each domain I added to the file.
Still trying to test out for Outlook and Apple Mail, but that's a project for another day.