My host will not install/activate the imap extension on our web server account and our e-mail is handled through Gmail, so despite my best efforts, we are unable to use piping and need to rely on traditional fetching for osTicket to receive e-mails and attach them to tickets (either new or existing). We're pretty well tied to our host, so I have replaced all of the imap functions in class.mailfetch.php with zend mail functions. I made a few modifications to class.email.php too (to stop looking for imap_open to confirm that the imap extension is enabled). After a lot of trial and error, I think I finally have everything in place, except when I enable the Mail Account information the save fails. It tells me "Invalid login. Check IMAP settings" and "Array" (the latter is because I replaced imap_last_error with error_get_last and I'm not sure that's right). I know that my IMAP settings work because I created a test script I would try various steps along the way and it does indeed log into Gmail correctly and can read the Inbox just fine. The only real difference was that I hardcoded my login information to the test script. The only other thing is I added a line (at line 66) to main.inc.php to define the directory location for the Zend Framework. That line looks like this: define('ZEND_DIR',INCLUDE_DIR.'zf2/'); //Composer built ZendFramework-2.2.5 essentialsMy modified class.email.php and class.mailfetch.php files are attached (extention has been changed from php to txt to allow the upload). Would someone mind running through these and seeing if you can figure out why it thinks I have errors with my Gmail login?
[class.email.txt](https://forum.osticket.com/assets/files/migrated/FileUpload/1e/c2d0a854d601fd98ccb1a2c4b49c88.txt)
[class.mailfetch.txt](https://forum.osticket.com/assets/files/migrated/FileUpload/41/57c28c6698404d6ba0ca168b81753d.txt)