Issue with mail_integration.php

Post

Posted
Rating:
#5049 (In Topic #1019)
Hi Chris,
On the custom work for IMAP you did i am seeing many problems in the composr error logs for :

8-Jan-2019 17:44:08 UTC   PHP Error   Uncaught Error: Cannot use object of type stdClass as array in sources/mail_integration.php:425
18-Jan-2019 17:44:08 UTC   PHP Fatal error   Uncaught Error: Cannot use object of type stdClass as array in /sources/mail_integration.php:425

I believe line 425 relates to :
425:               $filename = $structure->parameters[0]->value;
426:
427:               $this->log_message('Found attachment, ' . $filename . $qualifier_exp);
428:
429:               // Check it's a reasonable file-size

I have tried enabling the /data_custom/mail_integration.log, but nothing is being written.

Any thoughts? There is mail that is not being read on the mail server.
Thanks
Chris

Post

Posted
Rating:
#5064
It looks like a bug in PHP parsing a particular e-mail.

I've reviewed the comments in the PHP manual, and come across a possible fix (it's actually 2 in 1).

Code

$filename = $structure->parameters[0]->value;

Code

$filename = isset($structure->dparameters[0]) ? $structure->dparameters[0]->value : 'unknown.dat';

If you're still having problems please drop me an email. I'll need to actually look directly on your servers.

Post

Posted
Rating:
#5070
Hi Chris.
Many thanks,
your fix has resolved the problem and everything has sprung into life!
Chris

0 guests and 0 members have recently viewed this.