Autoconfig for mail when website not hosted on Cloudron?
-
wrote on Mar 22, 2021, 10:11 PM last edited by girish Mar 23, 2021, 1:26 AM
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?
-
wrote on Mar 22, 2021, 11:59 PM last edited by d19dotca Mar 23, 2021, 12:00 AM
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.
-
Thanks, I have put a note in https://docs.cloudron.io/email/#autoconfigxml
-
wrote on Feb 15, 2025, 10:51 AM last edited by
On my quest to get auto discovery working with apple devices I stumbled across this project: https://github.com/Monogramm/autodiscover-email-settings @girish Maybe worth looking into packaging?
-
@andreasdueren if you can figure out what Appe actually needs, we can put that in cloudron code itself
-
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.
-
@andreasdueren if you can figure out what Appe actually needs, we can put that in cloudron code itself
wrote on Feb 16, 2025, 7:25 AM last edited by@girish said in Autoconfig for mail when website not hosted on Cloudron?:
@andreasdueren if you can figure out what Appe actually needs, we can put that in cloudron code itself
I assume the relevant code is https://github.com/Monogramm/autodiscover-email-settings/blob/master/views/mobileconfig.xml
-
Per https://github.com/Monogramm/autodiscover-email-settings/blob/66c144e923f245dc0b4e64421449afedcad64052/index.js#L89 this is served at
/email.mobileconfig?email=username@domain.com
. I am yet to find an official doc page that says this though.However, ChatGPT thinks it is
configs/email.mobileconfig
served with content-type set toapplication/x-apple-aspen-config
...