auto_pickup.pl - Reload dropping mailings automatically

- NAME
- VERSION
- USAGE
- REQUIRED ARGUMENTS
- OPTIONS
- DESCRIPTION
- CONFIGURATION AND ENVIRONMENT

- Running the script via a cronjob

- Running the extension directly
- Running the extension via curl

- BUGS AND LIMITATIONS
- SEE ALSO
- AUTHOR
- LICENCE AND COPYRIGHT

# NAME

auto_pickup.pl - A small extension to monitor mailings and auto reload them if they seem to have fallen off the wayside.

This script can easily be run this as a CGI script in your web browser or via the command line.

The main intention of this script is to have it be run via a cronjob.

# VERSION

Refer to the version of Dada Mail you're using - NEVER use a version of this program with an earlier or later version of Dada Mail.

# USAGE

This little program can be used two ways:

- Use it like a cgi script.

  Put it in your, extensions directory (ala: cgi-bin/dada/extensions), chmod 755, visit it in your web browser.

- Use it like a command line script

  Change into the directory it's located in, and type:

       ./auto_pickup.pl

  This script takes one argument: `--verbose`. Tack that flag on:

       ./auto_pickup.pl --verbose

  and you'll receive a nice printout. Call it without any arguments and it won't return anything - it'll just run, and exit. Good for a cronjob.

# REQUIRED ARGUMENTS

There are no required arguments.

# OPTIONS

--verbose

  As explained, prints out what's goin' on. Probably a good option to use, if you've never used this specific extension.

# DESCRIPTION

Mailing to your entire list in Dada Mail can take a long time - hours even. Sometimes - and depending on your hosting account setup, this process can go on longer than the server allows a process to run.

Dada Mail itself is written to understand this problem and to work around it, but keeping exact track on where in the mass mailing it is and then being able to, ``pick up'' the mass mailing from the exact point it was, ``dropped''.

Since Dada Mail does not run continuously itself, you do need to monitor the sending process for this ``auto pick up'' to work.

One way is to keep the, Sending Monitor open in the List Control Panel. This works great, but has the problem of you always having to have your web browser open, your computer on, your computer to be connected to the internet, etc. Tak about a kludge.

Another way to use this very little extension script.

We highly highly recommend using this very little extension script.

Having this script run every 5 minutes or so should relieve you of having to monitor your mailing yourself and should stop you from worrying about a long-running mass mailing process.

# CONFIGURATION AND ENVIRONMENT

We've tried to make this script as easy as possible to get up and running, in hopes you'll take advantage of it.

There is no configuration needed to be done.

## Running the script via a cronjob

There's two ways you can run this script as a cronjob, either directly or by accessing it like you would in a web browser.

### Running the extension directly

To use this style, you'll have to know the absolute path to your, dada/extensions directory. For example:

/home/myaccount/cgi-bin/dada/extensions

Is an example of an absolute path to an dada/extensions directory.

/home/myaccount is the path to my home directory. In my home directory, lives my cgi-bin directory and inside that directory, is my dada directiory, which, in turn, holds the extensions directory. Hazzah!

These paths, especially the path to your home directory are going to be unique to your hosting account setup, so make sure to figure out yours is configured to be, exactly.

To run this extension every 5 minutes, your cronjob will look like this:

*/5 * * * * cd /home/myaccount/cgi-bin/dada/extensions; /usr/bin/perl ./auto_pickup.pl

If you have ssh access to your hosting account, you can test if you have the right commands that make up the cronjob by running the command right on the command line:

     prompt>cd /home/myaccount/cgi-bin/dada/extensions; /usr/bin/perl ./auto_pickup.pl

If nothing gets printed, you probably have it installed correctly. To be sure, use the C--verbose> flag:

     prompt>cd /home/myaccount/cgi-bin/dada/extensions; /usr/bin/perl ./auto_pickup.pl --verbose

You should get a report on any mass mailings that are going out and their status.

### Running the extension via curl

The second style is to use something like, `curl` to access the extension, much like you would in your web browser.

In these examples, I'm using,

/usr/bin/curl

as my path to curl. You'll want to double-check what your path to curl is.

In my below examples, the URL to this extension is:

http://example.com/cgi-bin/dada/extensions/auto_pickup.pl

You'll want to replace this with your actual URL to this script. To double check, just visit this URL in your web browser.

To run this extension every 5 minutes, your cronjob will look like this:

     */5 * * * * /usr/bin/curl http://example.com/cgi-bin/dada/extensions/auto_pickup.pl

You may receive the verbose printout using this method, so you may want to pass the, ``verbose'' paramater. This should work:

     */5 * * * * /usr/bin/curl http://example.com/cgi-bin/dada/extensions/auto_pickup.pl?verbose=0

If not, try this:

     */5 * * * * /usr/bin/curl -s --get --data verbose=0  --url  http://example.com/cgi-bin/dada/extensions/auto_pickup.pl

# BUGS AND LIMITATIONS

Please, let me know if you find any bugs.

# SEE ALSO

The Mailing List Sending FAQ has a whole lot of information about Dada Mail's Mailing Monitor, Auto-Pickup features and Batch Sending:

FAQ-mailing_list_sending.pod.html

# AUTHOR

Justin Simoni

See: http://dadamailproject.com/contact

# LICENCE AND COPYRIGHT

Copyright (c) 2006-2008 Justin Simoni All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.