I am not aware of any "native" autodiscover mechanisms for IMAP/SMTP, except for those based on common server names, such as imap.domain.com and smtp.domain.com.
(Exchange is different.)
If you were to google "IMAP autodiscover", you could find people discussing various hacks, mostly for Outlook client. I believe "autodiscover" is exclusively Microsoft's feature, and "autodiscover" for IMAP is an attempt to adapt it to IMAP, but without a standard it would be hard. (Or, maybe there is an RFC that I just don't know?)
As for Aquamail, having used its IMAP for over 3 years, I don't think it has any logic set up for those hacks.
I am just curious, why do you need to use such a complicated way, rather then setting {imap,smtp}.domain.com in the DNS?