Still no good answer on why they inject this bogus(?) cert into the IMAPS stream (and why it only seems to have problems for Gmail/googlemail)
The answer is simple, that's how the AV is able to scan encrypted connections (IMAPS), Avast acts as the mail client (a proxy) making the connection to the email server, decrypts, scans, encrypts with its cert that it installed on the computer and hands it to the mail client, it's a sort of a hack, if you may, but it's the best way they came up to be able to scan encrypted connections for viruses (the previous way was MUCH worse, trust me).
The process of uninstalling and reinstalling generates a new cert that Avast installs in your computer (it's unique).