Being a network dude, I always say start at the network ports. Can you ping and telnet to the ports you expect to, and verify ports are open you expect? If you can connect to ports, it's verifiable not the network or firewall.
Rest is auth to the application service or daemon (smtp/pop/imap) if you can make a socket connection to tcp/25, 110, 143, etc. If you open basic imap/pop/smtp without encryption, you can interact and test with telnet alone to send/receive. Start there, once those work, move up to encrypted sockets to build on once unencrypted works.
-mb