Since avast! version 4.7.807 the mail scanner module ("Internet Mail" provider) has been significantly changed to improve the overall user experience, especially in case of slow connections (dial-up). Namely, most of (if not all) the "Timeout expired" related problems should be gone by now. Which avast version are you using?
Which firewall do you use? Did you allow ashMaiSv.exe to connect?