I had major problems trying to setup POP or IMAP polling because Icewrap mail server an Kerio did not seem to support piping. So when I tryed to use POP or IMAP I was getting the same error Invalid login. Check POP settings
The logs showed that the connection is successfull also when I telnet the server everything was alright. After long hours of digging I finally found a thread here that showed me the answer!
The problem was that when osTicket calls imap_open, by default it will send STLS (start-TLS) request and if the server does not support it, it will drop the connection which was exactly what was happening with my connection.
To solve the problem I opened the file class.mailfetch.php from include folder and on row 51 I changed:
$this->serverstr.='/novalidate-cert}INBOX'; //add other flags here as needed.
to:
$this->serverstr.='/novalidate-cert/notls}INBOX'; //add other flags here as needed.
This additional flag notls was the key for resolving the problem. This way STLS is not send to the mail server and both MERAK and Kerio mail servers managed to make POP connection.
This thread here showed me the key:
(http://www.osticket.com/forums/showthread.php?t=2606&highlight=notls)
Thanks to DominicD
The reason I'm posting this thread is if someone has problems with the specified servers he can easyly find this thread when searching.
Cheers!