auto_pickup.pl - Small extension to monitor mailings and auto reload them if they seem to have fallen off the wayside. You can either run this as a CGI script in your web browser, or, run the script as a cronjob (either by calling it via the command line, or more conveniently, running the script via the curl (or similar) utility)
Refer to the version of Dada Mail you're using - NEVER use a version of this proggy with an earlier or later version of Dada Mail.
This little program can be used two ways:
Put it in your, extensions directory (ala: cgi-bin/dada/extensions), chmod 755, visit it in your web browser.
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.
There are no required arguments.
As explained, prints out what's goin' on. Probably a good option to use, if you've never used this proggy.
....
None, really.
Out of the box, this script should run as a CGI script, if you place it in the cgi-bin/dada/extensions directory.
If you do run this script as a cronjob (sort of its intention), you may want to make sure to explictily put the absolute paths to the DADA and DADA/perllib directories as well as your site-wide perl library paths, or this thing won't run very well.
NOTE This is not the same as your path to Perl (which is usually #!/usr/bin/perl). I get this asked frequently.
For example:
use lib qw( /home/myaccount/www/cgi-bin/dada /home/myaccount/www/cgi-bin/dada/DADA /home/myaccount/www/cgi-bin/dada/DADA/perllib /usr/local/lib/perl5/site_perl/5.8.0/mach /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.0/BSDPAN /usr/local/lib/perl5/5.8.0/mach /usr/local/lib/perl5/5.8.0 );
If you don't know where your site-wide Perl libraries are, trying running this via the command line:
perl -e 'print $_ ."\n" foreach @INC';
If you do not know how to run the above command, visit Dada Mail in a web browser, log into your list and on the left hand menu and: click, About Dada Mail
Under Script Information, click the, More... link and under the, Perl Library Locations, select each point that begins with a, ``/'' and use those as your site-wide path to your perl libraries.
You won't have to explicitly set the perl libraries if, in your cronjob you call the script using a utility like curl. For example:
*/10 * * * * curl http://example.com/cgi-bin/extensions/auto_pickup.pl
This should run the script every ten minutes. You may receive the verbose printout using this method, so you may want to route that to /dev/null:
*/10 * * * * curl http://example.com/cgi-bin/extensions/auto_pickup.pl >/dev/null 2>&1
Please, let me know if you find any bugs.
Justin Simoni
See: http://mojo.skazat.com/contact
Copyright (c) 2006-2007 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.