Skip to content

Latest commit

 

History

History
105 lines (53 loc) · 4.16 KB

features-scheduled_cronjobs.pod

File metadata and controls

105 lines (53 loc) · 4.16 KB

Scheduled Jobs for Dada Mail

Some of Dada Mail's more powerful features depend on a cronjob to be run on a periodic schedule.

Only one cronjob is required for all scheduled tasks in Dada Mail. It is composed of a URL that will need to be accessed.

Here's an exmaple:

http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_silent/

http://example.com/cgi-bin/dada/mail.cgi is just the URL to your Dada Mail,

A full cronjob would look like this:

*/5 * * * * /usr/bin/curl --user-agent "Mozilla/5.0 (compatible;)" --silent --get --url http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_silent/

*/5 * * * * sets the schedule to run this job every 5 minutes,

/usr/bin/curl --user-agent "Mozilla/5.0 (compatible;)" --silent --get --url is the curl command, with different paramaters passed to grab the URL and,

http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_silent/

is the URL we want to grab.

Schedule Flavor

_sched513A3F128C5C41EC is an individual flavor for our specific install of Dada Mail. It's meant to be somewhat unique, so that someone nefarious doesn't start running all the schedules for all Dada Mail installations it can find.

This flavor can be set when installing Dada Mail via the Dada Mail Installer. It can also be set manually in your .dada_config file, in the SCHEDULED_JOBS_OPTIONS hashref. Look for the scheduled_jobs_flavor paramater.

If you would like to customize the Schedule Flavor, the value of this paramater should only contain letters, numbers and underscores. Anything too tricky will foil the run mode dispatch code of Dada Mail. This value should also NOT be the same as an already-existing flavor/run mode

Job To Run

The next value in the path, _all describes which jobs to run. _all is special: it runs all the jobs can be run.

You can also modify this to run a specific job. The following are also supported:

  • mass_mailing_monitor

    Checks up on the status and health of any mass mailings currently going out. This used to be the job (prior to v8) of the Mailing Monitor plugin

  • rate_limit_checks

    TODO

  • mime_cache

    TODO

  • remove_old_archive_messages

    TODO

  • remove_old_tracker_data

    TODO

  • send_analytics_email_notification

    TODO

  • scheduled_mass_mailings

    This job checks to see if any mass mailings that are run at a schedule time need to go out.

  • bridge

    This job runs jobs for the Bridge plugin. This be to check for any awaiting discussion messages that are awaiting to be sent out, or if a digest message should be created and sent.

  • bounce_handler

    This job runs the Bounce Handler, which checks the bounce handler's email account for any awaiting bounced messages to process.

Mailing List to Run

The next value in the path, _all (and then second _all found) describes which list to run jobs for. _all is specially, as it will run jobs for all the mailing lists you have. If you would like to run jobs for just one mailing list, you can change this paramater the list short name of that list.

Job Output

By Default, this is set to, _verbose which will print out the output for all the jobs run. If you would like to suppress this, you can, by setting this to, _silent.

Another option is to supress the output in the cronjob itself, like this:

*/5 * * * * /usr/bin/curl --user-agent "Mozilla/5.0 (compatible;)" --silent --get --url http://example.com/cgi-bin/dada/mail.cgi/_sched513A3F128C5C41EC/_all/_all/_verbose/ >/dev/null 2>&1

Running the scheduled jobs via the command line.

There's no special command-line way to run these jobs, although you can invoke Dada Mail on the command line easy enough. The following:

cd /home/youraccount/public_html/cgi-bin/dada; /usr/bin/perl ./mail.cgi flavor=_sched513A3F128C5C41EC schedule=_all list=_all output_mode=_verbose

Will do the same thing, as our initial example for curl.

Retrieving the Cronjob

If you need to access the scheduled job URL again, log into Control Panel Settings (any list will do) and go to, Control Panel Settings- Scheduled Job