Open nasirmgcc opened 2 years ago
Hi, If you want to get reports automatically, you have to use cron on your server. Currently, you can automatically take reports from your mailboxes or directories on the server. See comments in utils/fetch_reports.php
for details.
Here is my cron rule:
0 */6 * * * www-data cd /usr/local/share/dmarc-srg/www && php utils/fetch_reports.php > /dev/null
It gets reports from the all configured sources 4 times a day (every 6 hour).
Thank you for reply
This will work on the Shared Server like JustHost ? with Cron job?
Why not? I don't use JustHost, but it definitely works on the cheapest droplet of DigitalOcean. The main thing is that there must be access to cron and php. The hoster may also block some mail ports to avoid using the service by spammers, but this is usually solved by emailing the support, and these are unlikely to be imap ports.
From #31. To know what you're failing, I need to know what exactly you're trying to do. How did you add a job for cron. What exact command did you execute? What files did you edit for this? And of course, in my example, the command is specified with paths that you may not have. Consider this.
@liuch i used as
www-data cd /home4/nasirryk/public_html/dmarc.xpertsgroup.net && /usr/local/bin/php utils/fetch_reports.php > /dev/null
cd /home4/nasirryk/public_html/dmarc.xpertsgroup.net && /usr/local/bin/php utils/fetch_reports.php
My first example is not a command but a line in one of the OS config files.
my username is " nasirryk "
In the cron job, you need to specify a user under which you are going to run the script. This is usually the system user under which your web server is running, it is usually www-data. I highly recommend that you figure out how to run commands on your OS on a schedule. In the previous post, I indicated which command to execute in order to get incoming reports. I personally use cron. How you set it up is up to you.
is it possible to run the CRON job without " user " to run commands, can we create the URL to execute will be more easy to manage.
is it possible to run the CRON job without " user " to run commands,
No …
can we create the URL to execute will be more easy to manage.
then action is done as www-data user … (and about an url to call : need some security check)
You can use the nobody
user in your /etc/crontab and run your own script there, but... why? Running commands from a URL can cause security issues. If you started looking for ways to bypass the OS security mechanisms, most likely you are doing something wrong.
I am looking to execute CRONJob by access simple page like : https://dmarc.mysite.com/import-mails.cronjob.php because on shared server difficult to run commands
Hi, Can you tell me how the imap will take automatically reports from the " Mailbox " and post into database, i have to run some Cronjobs or what is the procedure to run " util/fetch_reports.php "