OSTicket 1.17 with Basic Authentication
Okay, I will write a solution, who needs to solve this error now. This solution will only nessesary, if the connection uses SSL...
For POP3 connections:
Go to file /include/laminas-mail/src/Protocol/Pop3.php to Line 96 and replace
$this->socket = fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);
with
$context = stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false
]
]);
$this->socket = stream_socket_client($host.':'.$port, $errno, $errstr, self::TIMEOUT_CONNECTION, STREAM_CLIENT_CONNECT, $context);
For IMAP4 connections, you find the same code in:
/include/laminas-mail/src/Protocol/Imap.php in Line 91
There you find the same code to replace...
I hope this changes are useful for someone.
It's not an official solution, but it works.
Unfortunately this does not work for us. After replacing Line 91 in Imap.php we can save/activate E-Mail without error but than nothing happens. Mails arent fetched... :/
A quick solution would be great....
I wanted to make a request to laminas-mail directly, but I saw, the latest version of laminas-mail solves this error.
laminas-mail 2.18.0 connect to mail servers with stream_socket_client(), not using fsockopen(). So there is a solution to disable certificate validation.
KevinTheJedi
I made a pull request to update laminas-mail to 2.18.0 and disabled the validation. Please see at:
https://github.com/osTicket/osTicket/pull/6312
There is already a pull request to update laminas-mail, but I removed all development dependencies.
So laminas-mail includes less than 500 files by using 3,5 MB...
laminas-mail should not have more files as osTicket itself.
Please merge this request for the next release.
Great, thanks
- Edited
KevinTheJedi
Hi,
We are confirming that the above change proposed by jens_E is also working for us.
Realized that this thread is apparently covering two separate issues. :]
Thank you!
- Edited
Yes:
And your cronJob is enabled?
You can set your log level to debug in Settings->System.
Then you can see, if the cron runs in your system log. There should be an entry for it...
- Edited
Hmmmm....
Looks like i run into another issue:
If i start the job manually i get:
###############
/home/ticketing/public_html/api/cron.php
PHP Fatal error: Abstract function osTicket\Mail\MailBoxProtocolTrait::oauth2Auth() cannot be declared private in /home/ticketing/public_html/include/class.mail.php on line 238
###############
Okay, this it already fixed for the next release.
See:
https://github.com/osTicket/osTicket/pull/6297/files
You have to change this function from private to protected.
OK. Fixed.
What i did:
1) Update to latest Version from github as described here (because of the cron job error):
https://github.com/osTicket/osTicket/issues/6295#issuecomment-1272563459
2) Edited "/include/laminas-mail/src/Protocol/Imap.php" and replaced the line 91 with code from @jens_E
Thank you!!
@jens_E @KevinTheJedi
I've updated to 1.17.1
Same error. Edited Imap.php again. No more error but mails aren't fetched!
So something has changed with 1.17.1 but not for good. :/
For now i revert to last snapshot to get it working again. But a final solution would be great.
Hi,
short update. With 1.17.2 the problem still persists:
Manual edit of Imap.php fixed it again.
Regards!
Gero