Hi!
I had the same problem (also using The Bat! as my email client) and want to suggest a possible alternative solution.
The suggested solution in this message chain is to export the avast! certificate from the Windows certificate store (where the "internal TLS" implementation cannot find it) and import it into the The Bat! address book where it can be found. This will certainly fix the problem, as has been indicated.
Please notice that WITHOUT UNDERSTANDING all the possible implications of this, I simply switched the selection in the The Bat! Options | S/MIME and TLS... dialog from "Internal Implementation (The Bat! Address Book)" to "Microsoft CryptoAPI (Windows Certificate Store)".
I kept all the additional selections in their default values.
With this, the error message and the related error message dialog disappeared:
Account Log Before the change described above:
>3/27/2013, 16:50:49: IMAP - Issuer: generated by avast! antivirus for SSL scanning, avast! Mail Scanner, avast! Mail Scanner Root.
!3/27/2013, 16:50:49: IMAP - TLS handshake failure. Invalid server certificate (The issuer of this certificate chain was not found).
3/27/2013, 16:50:55: IMAP - TLS handshake complete
Account Log After the change described above:
>3/27/2013, 17:15:48: IMAP - Issuer: generated by avast! antivirus for SSL scanning, avast! Mail Scanner, avast! Mail Scanner Root.
3/27/2013, 17:15:48: IMAP - TLS handshake complete
If anyone has any remark about possible negative effects of the selection switch, I would very much like to know!
Jouni