I recently migrated a fully functioning installation of the (most recent version available(and unaltered)) Synology Package of osTicket to a new Synology (identical model and DSM version). Everything is working fine except the Email Fetching via IMAP+SSL "Cron Job." I am using the identical User-defined script that worked perfectly on the previous Synology host: /usr/local/bin/php56 /volume1/web/osticket/upload/api/cron.php
"Fetch on auto-cron" works fine, but I can't always ensure that someone will be logged in to facilitate that function.
osTicket Version: 1.10.1 (yes, I know it is ancient, but it is the last version posted by Synology and I know the Cron Job has the ability to work in this overall configuration). I have tested upgrading, but it didn't resolve the issue, so I reverted to a known-capable set of variables for now.
Web Server Software: Apache 2.2.34
MySQL Version: 10.3.21
PHP Version: 5.6.40
PHP Extensions: All installed and enabled
I find very little in the various associated logs. Perhaps the best indication is an email that I get when the process fails:
Subject: Mail Fetch Failure Alert
Body: osTicket is having trouble fetching emails from the following mail account:
User: support@mydomain.com
Host: my email host
Error: IMAP Authentication cancelled
5 consecutive errors. Maximum of 5 allowed
This could be connection issues related to the mail server. Next delayed login attempt in aprox. 10 minutes
https://support.mydomain.com/osticket/upload
I have verified using multiple techniques that my email host is serving up IMAP+SSL via port 993 without any issue. I even put an IMAP client on another host in the same subnet that the Synology is on to verify IMAP service, IMAP account, and IMAP password are working and correct. (It has to be working and correct since "Fetch on auto-cron" works, right?) I've installed additional tools on the Synology so I could use telnet. The telnet session from the Synology to the email host via port 993 results in a positive connection.
There is nothing recent in /var/log/php56-fpm.log
Mail Sending is working fine, as I'm getting the emailed alerts that the Cron Job is failing and customers are getting their notifications.
There is nothing recent in /var/log/httpd/apache22-error_log
There is nothing recent in /var/log/nginx/error.log
I do find the following in /var/log/messages (but I don't know if it is related to this or maybe it has something to do with my https session with the Synology UI). "LAS_Rackstation" is the hostname for the Synology.
2020-04-12T14:20:05-04:00 LAS_RackStation notification_refresh_token: cred_request.cpp:979 (pid=25826)HTTP Error(400)
2020-04-12T14:20:05-04:00 LAS_RackStation notification_refresh_token: notification_refresh_token.cpp:57 Failed to process curl process, errorno: 14
2020-04-12T14:20:05-04:00 LAS_RackStation notification_refresh_token: notification_refresh_token.cpp:134 SYNOSmtpRefreshToken failed.
2020-04-12T14:25:05-04:00 LAS_RackStation notification_refresh_token: cred_request.cpp:979 (pid=26209)HTTP Error(400)
2020-04-12T14:25:05-04:00 LAS_RackStation notification_refresh_token: notification_refresh_token.cpp:57 Failed to process curl process, errorno: 14
2020-04-12T14:25:05-04:00 LAS_RackStation notification_refresh_token: notification_refresh_token.cpp:134 SYNOSmtpRefreshToken failed.
I've increased osTicket Log Level to "All." This shows a periodic "Mail Fetch Failure Alert" with wording that matches the email I'm getting. I also see "Cron Job" entries that match the scheduled time of the script. The content is only:
Cron Job
Cron job executed []
I used WinSCP to verify that nothing unexpected shows in file permissions.
I verified that the /usr/local/bin/php56 and the /volume1/web/osticket/upload/api/cron.php paths are valid.
If I run the script via the Synology UI, specifying for it to show me the result, I get:
I'm stumped, but I'm hopeful because I've been very lucky in the past with folks in this forum solving obscure issues. Here is my Hail Mary.