WHMCS email cron job not working

4 posts / 0 new
Last post
#1 Sun, 08/16/2015 - 15:38
CadillacRick

WHMCS email cron job not working

WHMCS

I'm having trouble configuring the cron job to allow incoming emails to be transferred to the WHMCS ticket area via an IMAP email account. I have created the email account in Virtualmin and tested it both inside and outside my network and it works fine.

in the WHMCS setup support departments area.. i created a support department and assigned that email address to it... Also added the credentials to login like this:

Hostname: 10.0.1.45 Port: 143 Email Address: tickets.customer Email pass: password

WHMCS suggests the following cron job to accomplish this---

*/5 * * * * php -q /home/customer/domains/management.customer.com/crons/pop.php

However I have found that I cannot save the cron job with the "*/5 * * * *" in front of it... So i've saved it like this and it saves fine:

php -q /home/customer/domains/management.customer.com/crons/pop.php

When I go to run it i get this:

POP Import Log

Date: 16/08/2015 15:08:00

Host: 10.0.1.45 Email: tickets.customer Connection error: OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready.

and nothing is imported into the WHMCS ticket area.

Have been at it all morning and can't seem to find anything to fix this...

Help !

Richard.

Tue, 08/18/2015 - 14:23
scotwnw

I have WHMCS manged via webmin/virtualmin.

Here is my cron job line as listed in webmin > system > scheduled cron jobs. php -q /home/userdomain/public_html/shop/crons/pop.php > /dev/null 2>&1 Ticket emails work from within WHMCS and from anyone who emails support outside of WHMCS.

Sample output without the devnull.

POP Import Log

Date: 18/08/2015 14:02:20

Host: localhost Email: support.userdomain

Mailbox is empty

Host: localhost Email: sales.userdomain Mailbox is empty ---"

AS you can see my email is on the same box, so it is localhost. Betting IMAP and port is the problem. Not sure WHMCS does IMAP. Probably will require pop connection to your email server on port 110.

My email settings in WHMCS support dept email is.... hostname = localhost pop3 port = 110 email address = support.userdomain password = the password

Thu, 08/20/2015 - 20:14 (Reply to #2)
CadillacRick

Thank you scotwnw.. you were right about your cron job command and the port being 110. Works like a charm now !!!

Much appreciated !

Tue, 08/18/2015 - 16:46
andreychek

Howdy,

If you're having problems, you may want to call the PHP scripts via the web, rather than from command line PHP... using the command line, it won't use your user's php.ini file without some further parameters.

An easy solution would be to use a tool such as wget or curl, and call those scripts using a URL. When accessed through Apache, they'd have a different environment, which include their correct php.ini file.

-Eric