how to use Auto-Discover service?
-
Im having an issues in understanding autodiscover.xml for our uses case, we use as primary mail1.cfts.co, mail2 .cfts.co and mail.cfts.co as the backup for our webservers.
mail.cfts.co is hosted on the same IP as the domin and is just used for caching mail, when the mail1 or 2 is backup, the mail is then release to them one or both.
mail1.cfts.co and mail2.cfts.co are external mdaemon mail servers, given this arrangment would the Auto-Discover service work?I have added theses records to our dns, but now unclear how to progress.
autodiscover.cfts.co point to the mdaemon mail server.
>>> Working solution at the end of this tread <<<<
-
Arron Staff
Autodiscover is a tool for telling clients what host name to connect to during the initial setup of an account. Clients do not seem to be consistent about how they process autodiscover requests so depending on the clients that are being used, you may also need to create SRV records for the protocols.
You'll need to create a number of DNS records.
1. You'll need to create a CNAME record for autodiscover.domain.com that points to a host name that points to the MDaemon server.
2. You'll want to create the following SRV records
Domain: domain.com
Service: _autodiscover
Protocol: _tcp
Priority: 0
Weight: 0
Port Number: 443
Host/Target: autodiscover.domain.com3. Depending on the protocol clients are using you'll also want to create protocol specific SRV records. Below is an example for ActiveSync.
Domain: domain.com
Service: _airsync
Protocol: _tcp
Priority: 0
Weight: 0
Port Number: 443
Host/Target: autodiscover.domain.comI don't know of any clients that will use the autodiscocver protocol to update an account once it has been configured.
-
Arron Staff
Also, here is a link to our KB on setting up the AutoDiscover DNS records.
https://knowledge.mdaemon.com/how-to-setup-the-auto-discover-service-and-create-srv/cname-records-for-the-service
-
Hi Arron, thanks I have already setup the DNS as far as I can, were using cpanal, the only options I have are:
I was more intest in the xml side of things, https://autodiscover.cfts.co/autodiscover/autodiscover.xml, it unclear what im supposed to do here...
This is our old autodiscover file, that we use for exchnage, as an example.<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006"> <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <Account> <AccountType>email</AccountType> <Action>settings</Action> <Protocol> <Type>IMAP</Type> <Server>mail2.cfts.co</Server> <Port>993</Port> <DomainRequired>off</DomainRequired> <LoginName /> <SPA>off</SPA> <SSL>on</SSL> <AuthRequired>on</AuthRequired> </Protocol> <Protocol> <Type>POP3</Type> <Server>mail2.cfts.co</Server> <Port>995</Port> <DomainRequired>off</DomainRequired> <LoginName /> <SPA>off</SPA> <SSL>on</SSL> <AuthRequired>on</AuthRequired> </Protocol> <Protocol> <Type>SMTP</Type> <Server>mail2.cfts.co</Server> <Port>587</Port> <DomainRequired>off</DomainRequired> <LoginName /> <SPA>off</SPA> <Encryption>SSL</Encryption> <AuthRequired>on</AuthRequired> <UsePOPAuth>off</UsePOPAuth> <SMTPLast>off</SMTPLast> </Protocol> </Account> </Response> </Autodiscover>
-
Failing that, could someone provide a working mdaemon 'autodiscover.xml' file, that I can look at, I've been through the documentation several times, but not realy getting anywhere:
P.S. for anyine thats intested, I found a good tool to test and diagnose your autodiscover services https://www.priasoft.com/autodiscover_register_thank_you/
-
Arron Staff
I just checked again on MX toolbox and the DNS records are not setup correct. Specifically the autodiscover record is setup as an A record, not as a CNAME. It needs to be a CNAME.
I also don't see any protocol specific SRV records, I only see the _autodiscover._tcp.cfts.co record. This may work for some clients, but it might not work for others.
The autodiscover service in MDaemon builds the Autodiscover.xml file for you based on the settings in MDaemon. If you need to make adjustments to it, you'll just need to adjust the settings in MDaemon.
The biggest concern I see is that it doesn't look like you are requiring full email addresses to login to the server. Generally it is a good idea to require the full email address.
-
- A record used not CNAME.
- Shouls not matter, but not really an issue so its been changed. - Don't see any protocol specific SRV records.
- If you look at the beggining of this ticket the records are there, if this is not sufficent can you give an example.? - The autodiscover service in MDaemon builds the Autodiscover.xml file for you based on the settings in MDaemon
- Ahh - It doesn't look like you are requiring full email addresses to login to the server
- We do require full email as login, I checked just in case.
- A record used not CNAME.
-
Hi Arron, thanks for your help, the good news once the SSL issue with Mdeamon was resolved by using a 3rd part SSL tool, this worked perrfectly.
I like to add the broad steps I used to get things working, it might help someone else.
SOP: Enabling Auto Discovery for MDaemon Email ServerObjective: This Standard Operating Procedure outlines the steps required to set up and enable auto discovery for the MDaemon email server, allowing seamless configuration on modern devices.
Note: The following steps provide a general guideline. Adapt the DNS records to your specific requirements.
Step 1: DNS Configuration
-
Create the necessary DNS records to facilitate auto discovery. Below is an illustrative example; your configuration may differ, I normly set TTL to 700 while testing:
- Create an 'A' record: mail1.cfts.co
- Establish CNAME records for convenience:
- mail2.cfts.co > mail1.cfts.co
- autodiscover.cfts.co > mail1.cfts.co
- smtp.cfts.co > mail1.cfts.co
- imap.cfts.co > mail1.cfts.co
- pop3.cfts.co > mail1.cfts.co
-
Configure SRV records to guide auto discovery:
- _autodiscover._tcp.cfts.co. SRV 10 10 443 autodiscover.cfts.co.
- _airsync._tcp.cfts.co. SRV 10 10 443 autodiscover.cfts.co.
- _submission._tcp.cfts.co. SRV 10 10 587 mail1.cfts.co.
- _submissions._tcp.cfts.co. SRV 10 10 465 mail1.cfts.co.
- _imaps._tcp.cfts.co. SRV 10 10 993 imap.cfts.co.
- _xmpp-client._tcp.cfts.co SRV 10 10 5223 xmpp.cfts.co.
- _caldav._tcp.cfts.co. SRV 10 10 443 mail1.cfts.co.
- _carddav._tcp.cfts.co. SRV 10 10 443 mail1.cfts.co.
- _pop3s._tcp.cfts.co. SRV 10 10 995 pop3.cfts.co.
- *Lower Priority, I would normaly not put in, but good for testing.
- _pop._tcp.cfts.co. SRV 20 0 110 pop3.cfts.co.
- _smtp._tcp.cfts.co. SRV 20 0 25 mail1.cfts.co.
- _imap._tcp.cfts.co. SRV 20 0 143 imap.cfts.co.
*By omitting the SRV records for unsecured connections, you're effectively indicating that your mail system only supports secure connections for these protocols. This can contribute to a more secure and streamlined configuration. Just ensure that your email clients and systems are also configured to use secure connections for those protocols.
Step 2: MDaemon Configuration
-
Access MDaemon's Security Manager and navigate to Let's Encrypt settings.
-
In the Alternate Hostnames section, add the following hostnames (excluding the primary hostname, mail1.cfts.co, as it's already included):
- mail2.cfts.co
- autodiscover.cfts.co
- smtp.cfts.co
- imap.cfts.co
- webmail.cfts.co
-
Ensure that MDaemon can accept HTTP and HTTPS connections:
- Go to MDaemon's Security Manager > Webmail > Accept the Following Connection Types.
- Select both HTTP and HTTPS. If needed, utilize a third-party tool such as WACS for easier management.
Step 3: SSL Certificate Creation
-
For MDaemon's internal Let's Encrypt or third-party ACMEv2 (e.g., WACS), no need to include the primary hostname mail1.cfts.co in the certificate list:
- mail1.cfts.co (if using 3rd party tool)
- mail2.cfts.co
- autodiscover.cfts.co
- smtp.cfts.co
- imap.cfts.co
- webmail.cfts.co
Step 4: Testing and Verification
-
Verify the setup by attempting to log in with any modern device that supports auto discovery. Use your username and password for authentication.
-
Once confident in the setup's functionality, consider adjusting the Time-to-Live (TTL) for DNS records from 700 seconds to 14400 seconds for efficiency.
- Examine the 'AutoDiscover-YYYY-MM-DD.log' under \Mdaemon\logs
- reading theses logs is nothing short of a lifesaver, thank you mdaemon.
Hope this helps others :)
-
-
PC Desktop and Andriod Outlook, Native Andriod clients as well as PC em-client all worked just fine, we don't use pop3 so that's not been tested as yet.
Will update as we know more, not really happy with everythign being known as autodiscover.cfts.co, but it's all working, just needs tweeking a little, maybe make/put the autodiscover file on our domain proper with the correct settings and change the autodiscover.cfts.co DNS record accordinly as we have a multi-tenant hosted mail plaform, for most this should be good start.Resolved by examine the 'AutoDiscover-YYYY-MM-DD.log' under \Mdaemon\logs, reading theses logs has been nothing short of a lifesaver, thank you mdaemon.
230828 191707196 D [086BCA87] 0x41380120 Processing 346 byte request from client 230828 191707283 I [086BCA87] 0x41330008 Authenticated: peter@cfts.co 230828 191707283 D [086BCA87] 0x41380168 Contacting MDDP Server: autodiscover.cfts.co 230828 191707655 D [086BCA87] 0x41380200 SRV record found : _smtp._tcp.cfts.co = mail1.cfts.co 230828 191708039 D [086BCA87] 0x41380200 SRV record found : _imap._tcp.cfts.co = mail1.cfts.co 230828 191708828 D [086BCA87] 0x41380200 SRV record found : _pop._tcp.cfts.co = mail1.cfts.co 230828 191710866 W [086BCA87] 0x8007232B DNS name does not exist. 230828 191710866 W [086BCA87] 0x81380204 SRV record not found : _caldav._tcp.cfts.co 230828 191712785 W [086BCA87] 0x8007232B DNS name does not exist. 230828 191712786 W [086BCA87] 0x81380204 SRV record not found : _carddav._tcp.cfts.co 230828 191713117 W [086BCA87] 0x8007232B DNS name does not exist. 230828 191713117 W [086BCA87] 0x81380204 SRV record not found : _xmpp-client._tcp.cfts.co 230828 191713117 D [086BCA87] 0x41380160 Sending 2478 byte response to client 230828 191713118 D [086BCA87] 0x00000000 The operation completed successfully. 230828 191713118 D [086BCA87] 0x41380102 Connection Terminating
After reading the logs
230828 192736280 D [086BCA8F] 0x41380120 Processing 346 byte request from client 230828 192736367 I [086BCA8F] 0x41330008 Authenticated: peter@cfts.co 230828 192736367 D [086BCA8F] 0x41380168 Contacting MDDP Server: autodiscover.cfts.co 230828 192736480 D [086BCA8F] 0x41380200 SRV record found : _smtp._tcp.cfts.co = mail1.cfts.co 230828 192736480 D [086BCA8F] 0x41380200 SRV record found : _imap._tcp.cfts.co = mail1.cfts.co 230828 192736480 D [086BCA8F] 0x41380200 SRV record found : _pop._tcp.cfts.co = mail1.cfts.co 230828 192737533 D [086BCA8F] 0x41380200 SRV record found : _caldav._tcp.cfts.co = mail1.cfts.co 230828 192737787 D [086BCA8F] 0x41380200 SRV record found : _carddav._tcp.cfts.co = mail1.cfts.co 230828 192738961 D [086BCA8F] 0x41380200 SRV record found : _xmpp-client._tcp.cfts.co = mail1.cfts.co 230828 192738961 D [086BCA8F] 0x41380160 Sending 2457 byte response to client 230828 192738961 D [086BCA8F] 0x00000000 The operation completed successfully. 230828 192738961 D [086BCA8F] 0x41380102 Connection Terminating
And the output of the autodiscover tool
<?xml version="1.0" encoding="utf-8"?> <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006"> <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <User> <DisplayName>Peter Atkin</DisplayName> <AutoDiscoverSMTPAddress>peter@cfts.co</AutoDiscoverSMTPAddress> </User> <Account> <AccountType>email</AccountType> <Action>settings</Action> <Protocol xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <Type>SMTP</Type> <Server>mail1.cfts.co</Server> <Port>465</Port> <Encryption>SSL</Encryption> <DomainRequired>on</DomainRequired> <LoginName>peter@cfts.co</LoginName> </Protocol> <Protocol xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <Type>IMAP</Type> <Server>mail1.cfts.co</Server> <Port>993</Port> <Encryption>SSL</Encryption> <DomainRequired>on</DomainRequired> <LoginName>peter@cfts.co</LoginName> </Protocol> <Protocol xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <Type>POP3</Type> <Server>mail1.cfts.co</Server> <Port>995</Port> <Encryption>SSL</Encryption> <DomainRequired>on</DomainRequired> <LoginName>peter@cfts.co</LoginName> </Protocol> <Protocol xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <Type>CalDAV</Type> <Server>https://mail1.cfts.co/.well-known/caldav</Server> <Port>443</Port> <Encryption>SSL</Encryption> <DomainRequired>on</DomainRequired> <LoginName>peter@cfts.co</LoginName> </Protocol> <Protocol xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <Type>CardDAV</Type> <Server>https://mail1.cfts.co/.well-known/carddav</Server> <Port>443</Port> <Encryption>SSL</Encryption> <DomainRequired>on</DomainRequired> <LoginName>peter@cfts.co</LoginName> </Protocol> <Protocol xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"> <Type>XMPP</Type> <Server>mail1.cfts.co</Server> <Port>5223</Port> <Encryption>SSL</Encryption> <DomainRequired>on</DomainRequired> <LoginName>peter@cfts.co</LoginName> </Protocol> </Account> </Response> </Autodiscover>
I really hope this help others, I've learnt alot in this process.