How often do you fetch for new emails?
Do you put every minute inside of osticket or is that too much?
And the cron job every minute too?
Thanks
How often do you fetch for new emails?
Do you put every minute inside of osticket or is that too much?
And the cron job every minute too?
Thanks
OK, I fixed my fetching problems, this is what I did.
First go to Settings > System and change the default log level to Debug.
Now you can see all the cron jobs when they are executed by going to System > System logs.
Add a cron job like this, without the nobody as the documentation says (with nobody my cron was not running)
*/1 * * * * /usr/bin/php /var/www/supportXX.xxx.com/public_html/api/cron.php
This will fetch emails every minute. I run this cron with root.
You will now see all the executions in System logs.
Now go to Emails > Settings and enable Email Fetching, you can disable Fetch on auto-cron as this is useless as you are fetching emails every minute or whatever interval you have put. I would use fetch on auto-cron if you can't setup a cron as this will fetch emails randomly when agents browse inside of osTicket.
Once you've got this working, you should have 1-2 mins lag on fetching emails, but I think that's ok.
Change the log level back to Warn.
I hope this helps you.
fernandoch
Hi.
I can't seem to locate System>System logs. Where is that located please?
I am trying to use the auto cron method indicated in the documentation we have 1.16.3
I have activated Fetch every 15mins, with 10 chosen.
The email config from INBOX, and is configured to move them to a folder called "fetched" which I created on our server.
There are currently 4 new unread test emails sitting in that email inbox but nothing in the fteched folder.
I would like to see debug trace to find where the issue lies.
thanks
nobius
As I chose to use Auto Cron, I have NOT created any cron jobs at all, just the config above.
I realise that means this will only work whilst an agent is logged in, so I chose 120 for the field on session duration and leave the agent logged in for hours. Still no fetch and no log messages. Not sure quite what's happening
thanks
There has to be agent activity..not just being logged in. You really need to setup a cron job to automatically poll the mailbox without any action from a human. This will be the most reliable. Also, please don't revive old, dead threads. Instead you should find a recent one or create your own.
Cheers.
Hi Kevin,
Can we still turn on auto-cron in the setting while another cron job is running?
It is definitely not recommended. You can run into a scenario where cron is running and auto cron is running at the same time and create duplicate tickets, etc. so it’s an either-or situation.
Cheers.
Got it. Thanks for your prompt response.
I've been trying to create a server cron job for months and it just won't work. If I use PHP5 the server replies with an error, if I use 7+ there is an error, no matter what I do the server returns an error and I have no idea why.
We dropped support for PHP 5.x YEARS ago. What version of osTicket are you running?
Cheers.
As I said Kevin, the message changes depending on the version of PHP I use to run the cron, it fails regardless of what the version is. You can see if I change it to PHP 8 it still errors:
I use 1.17.2 on one website and 1.17.3 one the other
With 1.17.x only PHP 8.0-8.1 is supported. If you use PHP 8.0-8.1 and get errors then you need to follow the advice shown in the message and contact your hosting provider.
/path/to/php /path/to/osTicket/api/cron.php
is all you need.
Cheers.
Thanks Kevin, I will contact them
The cron job interval should align with your email traffic and system capacity. Setting it to run every minute can be resource-intensive, so it's essential to balance frequency with server performance.