Guys
I just spent the best part of 3 days figuring this out, NO thanks at all to my host ilisys.com.au who upgraded me to PHP5 without telling me.
I was having trouble getting mail to download post upgrade.
I was connecting to my POP account OK, but the problem was the imap_headerinfo function was not working correctly and not putting all the correct header information.
Instead of returning email, sender, from etc all i getting was the message id and some blank text.
My environment is:
PHP Version 5.2.12-pl0-gentoo with imap
IMAP c-Client Version 2007e
SSL Support enabled
The problem was was the /osticket/scp/folder needed to have FOLDER permissions set to 777 otherwise you would get an error from imap_last_error() saying
Unable to create scratch file: Permission denied
That fixed it, but this should be an installation check if indeed it is truly required