Jimmy lemme try to solve your issue,
actually last week i also faced same issue but after some research i found solution. here's it you follow may be it'll useful for you.
so first you to make a configure a mail server (i hope you know) then add that mail server domain as a website ( in my case i was using mail.mydomain.com and off proxy ) then go to website where it listed then add ssl using encrypt SSl and you'll get ssl key and certificate just copy anyone ( let's assume first copied ssl private key) and then go to mail server software then choose that exact domain that you've used for mail server domain.com (in my case i was using mail.mydomain.com for mail server) then click on add ssl and paste that copied details accordingly . and save it and now restart aaApanel server. now all done you can use email anywhere (smtp, imap, pop) without getting issue.
Context- i followed this same steps and my issue got resolved, and i don't know, you understood or not. no worries you can contact us via telegram ill try to help .
thanks & regards 💗