Try to desactivate firewall iptables
Try telnet localhost 143
Is if ok and you used fedora v3 or v4, your problem is with selinux secure, selinux secure break connections socket, for resolved problem you desactive in system selinux with:
setenforce 0
and in boot of systen
nano...