1. Home
  2. Products
  3. Sportdata Cloud Office
  4. osTicket
  5. Add osTicket cronjob to automatically poll mailboxes for new emails

Add osTicket cronjob to automatically poll mailboxes for new emails

The most convenient method to automatically poll new emails on Yunohost is scheduling recurring tasks via crontab. Alternatively, the internal auto-cron feature can be activated – but it is only triggered by staff’s activity.

  1. SSH into your server and type the following (note you need to be using an account with sudo access):
    sudo crontab -e -u www-data
  2. In the text editor that comes up, enter the following:
    */2 * * * * php /var/www/html/api/cron.php > /dev/null 2>&1
  3. Then save and exit, and in osTicket Admin > Emails > Settings ensure Email fetching is enabled, but fetch on auto-cron is not.

This will poll your mailbox every 5 minutes (change the /5 to another number if you want to change this) and the > /dev/null 2>&1  part at the end ensures you don’t get an email every time the cron job runs.

See also:
https://docs.osticket.com/en/latest/Getting%20Started/POP3-IMAP%20Settings.html

Updated on April 15, 2023

Was this article helpful?

Related Articles