I had the same problem. After having to look around i found out that the xinetd server did not accept connections from the localhost, so I edited the /etc/xinetd.conf file and removed te line "only_from" from it. You maybe can check the config file for the imap daemon, most proppably under /etc/xinetd.d/ and make sure it accepts connections from the local host.
Cheers.