I also use AVAST and Thunderbird.

You can read http://support.avast.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=458 firstly.

The step 4 is very important for SSL connecting.

Good luck!