Ufff... I found the solution...
It's so simple I feel ashamed... :/
I tried to run some free webmail software and I got this annoying error: couldn't open stream {localhost/pop3}
And the solution is:
All you have to do is provide the valid linux user which has a valid shell (/etc/shells) in /etc/passwd. And the user has to create atleast the mail directory in his home dir (or just run pine once) - otherwise you wont be able to read attachements...
I didnt test it with imap, however if you could not run it with imap try to check
/etc/services
/etc/inted.conf
or just type in console
telnet localhost 143 - for imap
to check if imap daemon is running
I hope it will help ya