Have you enabled IMAP and POP in google?
http://support.google.com/a/bin/answer.py?hl=en&answer=105694(http://support.google.com/a/bin/answer.py?hl=en&answer=105694)
Have you checked your php error log?
Have you opened the relevant ports through your firewall?
Have you searched the forums?
http://osticket.com/forums/showthread.php?t=5636(http://osticket.com/forums/showthread.php?t=5636)
Is your PHP compiled with imap and mcrypt? (Or if running Windows for your server have you enabled those extensions)