Open the file “C:\Program Files\ALWIL Software\Avast4\DATA\avast4.ini” and add such lines under [MailScanner]:
PopListen=127.0.0.1:111
SmtpListen=127.0.0.1:26

This will change the ports that avast uses. Set these ports also in your mail program.