Hello everybody,

we've been experiencing problems with IMAP fetching of e-mails on osTicket 1.16. The symptoms look similar to #101467, but cause IMHO is different.

Behaviour: when error occurs while fetching e-mails it does not fetch all e-mails and on all subsequent fetches makes errors such as multiplying the e-mails in INBOX and in the folder it's supposed to move those e-mails. The behaviour stops when I manually move the unfetched e-mails out of INBOX.

The error that is being logged in PHP error log:
PHP Fatal error: Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, null given in /.../include/class.mailfetch.php:246
Stack trace:
#0 /.../include/class.mailfetch.php(246): fclose()
#1 /.../include/class.mailfetch.php(855): MailFetcher->decode()
#2 /.../include/class.forms.php(3893): MailFetcher->{closure}()
#3 /.../include/class.mailfetch.php(863): FileUploadField->uploadAttachment()
#4 /.../include/class.mailfetch.php(955): MailFetcher->createTicket()
#5 /.../include/class.mailfetch.php(1035): MailFetcher->fetchEmails()
#6 /.../include/class.cron.php(25): MailFetcher::run()
#7 /.../scp/autocron.php(61): Cron::MailFetcher()
#8 {main}
thrown in /.../include/class.mailfetch.php on line 246

(whole folder path substitued with "..." for simplicity)

All but one of the offending e-mails are larger than 1MB, which is our attachment size limit:

PHP upload limit is 25MB (as far as I was able to find)
Some of the un-fetched e-mails are bigger than 1MB BUT their attachments are in total LESS than 1MB.
It happens for PDF, JPG and imbed images at least.

In past I remember when customer sent e-mail with bigger attachment that osTicket grabbed the text of the e-mail and added for agents info that attachment wasn't fetched due to limits.

I cannot quite remember when it started doing this, but I guess it didn't when we were at 1.15 versions.

We are using 1.16.5 version, but it has been happening on previous 1.16 versions too.
I haven't been able to try 1.16.6 version yet and I didn't find out anything in release notes that I think should apply to this.
Configuration info from osTicket info page:

Thank you for your help in advance!

    4 months later

    Updating to the latest 1.16 version did not help.
    However we've updated to 1.17.4 about a month ago and since then no problems with e-mail catching.
    This thread could and should be closed.

    Write a Reply...