Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > osTicket 1.6 (Latest Release) > Installation and Setup Help

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-06-2010, 09:42 AM
timwright timwright is offline
Junior Member
 
Join Date: Dec 2009
Posts: 7
Default Imap / cron help!!

Hi

I've missed the point or a tick box somewhere I'm sure...

When trying to set up the cron job to collect imap mails all I get is a 77 on the page.... guess its a general error message.

If i run from another pc on my network i get
"Unknown remote host [192.168.1.50] or invalid API key"

or on my server i get

"Unknown remote host [::1] or invalid API key [Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.6) Gecko/20091215 Ubuntu/9.10 (karmic) Firefox/3.5.6]"

Should I be using the api key bit? I don't think I need email piping..

All I want to do is have a cron job to collect the emails from google apps accounts rather than the "Enable cron call on staff's activity" because you get a pause every so often while you wait for the fetch.

if i do use the "Enable cron call on staff's activity" it is all working fine with google apps email but I know as soon as this goes live one member of staff is going to moan about the speed!

Could someone please shed a bit of light on this I need to get this up and running asap!!


Thanks.
Reply With Quote
  #2  
Old 01-08-2010, 10:43 AM
timwright timwright is offline
Junior Member
 
Join Date: Dec 2009
Posts: 7
Default

anyone??? I'm running ubuntu 9.10 and imap/smtp mail fine but I want to get the cron job working to fetch the emails.

Should I be able to simply run http://localhost/osTicket/api/cron.php in firefox?

Should I have anything about api keys in the cron error considering i'm not piping email?

If it is permissions what permissions? imap, smtp, permisions to cron or permissions to the api folder??

can anyone shed any light for me?

Thanks.
Reply With Quote
  #3  
Old 01-08-2010, 11:29 AM
atrizu atrizu is offline
Junior Member
 
Join Date: Jan 2010
Posts: 11
Default

I think by default you may not be able to call this through the web. Try running this from the command line:
php -q /path/to/api/cron.php

If that works, I recommend setting up a cronjob for that command.
Reply With Quote
  #4  
Old 01-08-2010, 12:29 PM
timwright timwright is offline
Junior Member
 
Join Date: Dec 2009
Posts: 7
Talking

Okay all sorted !!!

So i'm now using my Google Apps Imap account with a cron job to collect the emails!!!

As far as I can see you cannot simply run the /api/cron.php in a browser.

What you need to do is enter your account details in the email account setup page.

Then make sure you tick "Enable POP/IMAP email fetch"

Make sure in the general settings that "Enable cron call on staff's activity" is unselected.

Then go to Settings / API and put 127.0.0.1 in the New Ip box
Type three random words in the Phrase box
and then click ADD

Doing that will generate you a hashed code in the top API Key section of the page.

COPY THAT HASH!!!!!

Okay all good so far!!

Now I'm using Ubuntu 9.10 and have already installed webmin to manage it.

So in webmin I go to Scheduled Cron Jobs create a new one with the settings

execute job as = nobody
make it active

Then thanks to the post http://osticket.com/forums/showthread.php?t=3158
Add the command as

wget -q -O /dev/null --user-agent=RE4A05834506BAA1AAC51C748058294C http://localhost/osTicket/api/cron.php

REPLACING your path to cron.php and the RE4A05834506BAA1AAC51C748058294C with you hash that you just copied in the API KEY section.

Then set the times you want it to run at and then SAVE it

Thats it, Job Done!
Reply With Quote


Reply

Bookmarks

Tags
api, cron, imap, _77

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:21 AM.