Hello There,
The ACE has built-in scripted probes in order to check connectivity beyond layer 4 with these kinds of mail servers but only for the unencrypted versions SMTP/IMAP.
In your case since you're working with these protocols over SSL/TLS, you'll need to configure regular TCP probes for each serverfarm so reachability will be test'd based on TCP port.
probe tcp IMAPS-993
port 993
interval 5
faildetect 2
passdetect interval 3
passdetect count 1
open 1
probe tcp SMTPS-464
port 465
interval 5
faildetect 2
passdetect interval 3
passdetect count 1
open 1
HTH
__ __
Pablo