Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

[resolved] Cron seems to be working but emails are not being sent OSTicket 1.9.12

Hello and tanks for having me.

I been following the forum for a bit. Trying to figure stuff out. I went to:


to learn how to fetch tickets while no one is logged in.

System info:











MySQL version 5.5.45-37.4

PHP version 5.5.28






Operating system Linux (64 Bit)
Server Apache
On Cpanel I set a cron job:


I set up for every 1 minute to see results right away.

I get the emails to the admin address:

--2015-09-18 08:00:02--  http://support.mydomain.com/api/tasks/cron/rcron.php

Resolving support.mydomain.com... 123.123.123.123

Connecting to support.mydomain.com|123.123.123.123|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 587 [text/html]

Saving to: “rcron.php.28”



     0K                                                       100% 70.0M=0s



2015-09-18 08:00:04 (70.0 MB/s) - “rcron.php.28” saved [587/587]

So far it looks promising but I don't get any notification emails that a ticket has been created on support@mydomain.com

I also did:

wget --user-agent=<my api key> http://support.mydomain.com/api/cron.php

It looked good too:

--2015-09-18 07:39:01--  http://support.mydomain.com/api/cron.php

Resolving support.mydomain.com... 123.123.123.123

Connecting to support.mydomain.com|123.123.123.123|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 68 [text/html]

Saving to: “cron.php.23”



     0K                                                       100% 7.29M=0s



2015-09-18 07:39:02 (7.29 MB/s) - “cron.php.23” saved [68/68]

I don't usually create cron jobs manually. So I'm not sure if this is something I need to open a ticket with the host or is something I'm not doing right.

Thanks for the help!

Comments

  • edited September 2015
    You haven't really provided us with enough information to assist you.
    Email settings?
    Alert settings?

    I notice that your running nginx. As a side not this is not a supported webserver so you may run into some AJAX issues, and other wonkiness.

    update: I removed the embedded links to your server from the hrefs.
  • Hello and thanks for replying.

    Email and Notification Settings attached.
    Email Settings.jpg
    959 x 593 - 138K
    Notifications Setting.jpg
    961 x 863 - 138K
  • How can you tell it is nginx? I had a caching issue but it is fixed.
  • Thanks for removing the links.... next time I'll compose on notepad and then post.
  • Based on the your settings you provided, are you the Department manager?
    Only the person marked as Department Manager will get new ticket alerts.
    Only the last respondent and Assigned Agent will get new message alerts.

    I can tell its nginx because I went to your site.  the error message I got said:
    HTTP/1.1 301 Moved Permanently
    Server: nginx
    Date: Fri, 18 Sep 2015 15:42:05 GMT
    Content-Type: text/html; charset=iso-8859-1
    Content-Length: 262
    Connection: keep-alive
    Keep-Alive: timeout=15
    Location: http://support.removed.com/api/tasks/cron/
    Set-Cookie: _asomcnc=1; Max-Age=900; Path=/
    X-NoCache: 1





    Also I run a plugin in my browser that identifies such things. It's called Wappalyzer.
  • >Based on the your settings you provided, are you the Department manager?
    >Only the person marked as Department Manager will get new ticket alerts.
    >Only the last respondent and Assigned Agent will get new message alerts.

    Yes sir! I'm a one man show so I am all the above... haha

    When the ticket is open on site or I am login and the ticket is sent via email I will be notified.

    Only issue is the cron. I do get the support@mydoamin.com email but it doesn't get processed until I login. I guess I should be happy about that but I wanted more. :/

    >Also I run a plugin in my browser that identifies such things. It's called Wappalyzer.
    That is great to know!

    Thanks.
  • I saw the error message:

    HTTP/1.1 301 Moved Permanently Server: nginx Date: Fri, 18 Sep 2015 19:42:38 GMT Content-Type: text/html; charset=iso-8859-1 Content-Length: 262 Connection: keep-alive Keep-Alive: timeout=15 Location: http://support.mydomain.com/api/tasks/cron/ Set-Cookie: _asomcnc=1; Max-Age=900; Path=/ X-NoCache: 1
    Moved Permanently

    The document has moved here.

    What does it mean?

    Thanks!
  • 301 is a permanent redirect.  My guess what that someone set up a redirect at the .htaccess level.

    https://en.wikipedia.org/wiki/HTTP_301


  • edited September 2015
    Thanks Ntozier!

    Ah, I see. Well the API folder has a .htaccess file

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.*/api)

    RewriteRule ^(.*)$ %1/http.php/$1 [L]

    </IfModule>


    I added the rcron.php file to support.mydomain.com/api/tasks/cron like the wiki or the file suggested to do so.

    The .htaccess on root only has these 2 lines:

    Header set Set-Cookie "VC-NoCache=1; max-age=900; path=/"
    Header set VC-NoCache "1"

    And with those I'm very clear what they do. :)

    Could you please help me change it? Or what can be done if it isn't that file?

    Thank you.
  • My knowledge of .htaccess files (and nginx) is fairly limited.  I know the basics... but if I need more than that I just google things.  I do not see a 301 redirect in your htaccess file however.  So my guess would be is that its in the nginx config files for your site.
  • Thank you!

    Just as I fear. NginX fault!

    My .htaccess is limited as well so I didn't see the 301 so I thought it was doing something different.

    On my shared host where I have my account, you don't have access to the nginx config file. Or maybe it hasn't been implemented. Or maybe that is how it works on all shared hosts.

    I will have to open a ticket.

    I'll report back if there is a fix.

    Thanks again!

    Luis

  • I'll leave this thread open, please let us know how you make out with this and what the solution (if any there is).
  • Thanks!

    you can close it now, I found out how to fix it!

    I went to:


    and used this post:







    If you're doing a local scheduled task on the web server, you can do

    /path/to/php -q /path/to/osticket/api/cron.php

    As often as you like. Of course paths to PHP and osticket will be different on your server



    I went to ssh got my php path. I used my osticket path (server path) not the url. And I added this line:

    /path/to/php -q /path/to/osticket/api/cron.php

    to a cron job to run every hour and it works.

    Thanks for the help Ntozier!


  • Great!  Thanks for letting us know what your fix was.  Hopefully if someone else has a similar issue they will see this and it will help them also.
This discussion has been closed.