Thunderbird mail client auto configuration

I have a number of sites and email accounts hosted on Plesk. The IMAP and SMTP servers were typically set as the relevant domain for each with no subdomain.

When I moved the DNS to Cloudflare and turned on proxying for the specific domain, this meant that Thunderbird could no longer automatically look up the IMAP and SPTP servers when configuring it with a new account.

I’ve tried setting up SRV records for _imaps and _smtps as well as a non proxied mail. subdomain that points directly to the mailservers IP address, but still Thunderbird want to automatically use the main domain name when you set up the account.

Whilst I can adjust the settings manually in Thunderbird to point to the mail. subdomain, is there a way for Thunderbird to get the correct details automatically?

Yes, but the only part that involves Cloudflare is creating the autoconfig hostname for the site where you host your XML file.

https://wiki.mozilla.org/Thunderbird:Autoconfiguration