Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Mail from cron jobs/browser
07-14-2008, 03:14 PM #1
- Join Date
- Jun 2008
- Thanked 0 Times in 0 Posts
Mail from cron jobs/browser
i'm having trouble with something that i've no idea why its happening.
basically i a cron job setup that emails a warning if something happens, that bit isn't really important.
When i browse to the page it sends me an email. - which gets to me fine at both my business and personal email accounts which i've tested.
I've setup a cron job to run the script for me, and i sends an email to my personal account, however if i change it to my business account it doesn't arrive even in our spam filter.
Its the exact same message being sent from the browser page and the cron job.
So can anyone answer why the browser initiated email is accepted yet the cron job email is rejected?
07-14-2008, 06:33 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,659 Times in 2,628 Posts
I'm wondering if this isn't to do with the user executing the cron tab versus the user executing the script. When you browse to it the commands are executed by apache when going through http, but if you are executing it on the command line it is likely a different user (probably you're account). Depending on you're access to cron jobs you may be able to change the user that executes it to apache (or apache named user) to allow it out. In other words, I think the problem is originating on the server that deny's outgoing smtp transfers for you're account. Sounds like it isn't a PHP issue though (depending on the code in use, but I doubt its built to deny you), since you can run it no problem through you're browser.
header('HTTP/1.1 420 Enhance Your Calm');