diff -r -u mailman-2.1.5.orig/cron/bumpdigests mailman-2.1.5/cron/bumpdigests --- mailman-2.1.5.orig/cron/bumpdigests 2002-10-21 18:36:56.000000000 -0400 +++ mailman-2.1.5/cron/bumpdigests 2004-09-03 10:41:12.000000000 -0400 @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! @PYTHON@ -S # # Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. # diff -r -u mailman-2.1.5.orig/cron/checkdbs mailman-2.1.5/cron/checkdbs --- mailman-2.1.5.orig/cron/checkdbs 2003-12-26 17:51:10.000000000 -0500 +++ mailman-2.1.5/cron/checkdbs 2004-08-31 12:21:24.000000000 -0400 @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! @PYTHON@ -S # # Copyright (C) 1998-2003 by the Free Software Foundation, Inc. # diff -r -u mailman-2.1.5.orig/cron/crontab.in.in mailman-2.1.5/cron/crontab.in.in --- mailman-2.1.5.orig/cron/crontab.in.in 2002-01-06 01:28:12.000000000 -0500 +++ mailman-2.1.5/cron/crontab.in.in 2004-09-02 17:43:27.000000000 -0400 @@ -1,24 +1,47 @@ +# +# -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- WARNING -- +# ------------------ EDIT THE CORRECT FILE ------------------------- +# +# This file is copied to /etc/cron.d/mailman from +# @prefix@/cron/crontab.in when the mailman service is started via its +# init.d script and the file /etc/cron.d/mailman is removed when the +# service is stopped. Therefore any edits made directly to +# /etc/cron.d/mailman will be lost anytime the mailman service +# restarts. +# +# To make changes edit the master copy @prefix@/cron/crontab.in and then +# restart the service to pick up the changes (/sbin/service mailman restart). +# +# The reason this is done this way is because the mailman cron jobs +# should only be invoked if the mailman service is enabled and not +# just as a consequence of installing the rpm as was the case +# previously. The file /etc/cron.d/mailman cannot simply be linked to +# the master copy in @prefix@/cron because for security reasons cron +# will not process crontab files that are links or writeable by +# anybody else but root, thus the file must be copied into /etc/cron.d +# with the right ownership and permissions. +# # At 8AM every day, mail reminders to admins as to pending requests. # They are less likely to ignore these reminders if they're mailed # early in the morning, but of course, this is local time... ;) -0 8 * * * @PYTHON@ -S @prefix@/cron/checkdbs +0 8 * * * @MAILMAN_USER@ @prefix@/cron/checkdbs # # At 9AM, send notifications to disabled members that are due to be # reminded to re-enable their accounts. -0 9 * * * @PYTHON@ -S @prefix@/cron/disabled +0 9 * * * @MAILMAN_USER@ @prefix@/cron/disabled # # Noon, mail digests for lists that do periodic as well as threshhold delivery. -0 12 * * * @PYTHON@ -S @prefix@/cron/senddigests +0 12 * * * @MAILMAN_USER@ @prefix@/cron/senddigests # # 5 AM on the first of each month, mail out password reminders. -0 5 1 * * @PYTHON@ -S @prefix@/cron/mailpasswds +0 5 1 * * @MAILMAN_USER@ @prefix@/cron/mailpasswds # # Every 5 mins, try to gate news to mail. You can comment this one out # if you don't want to allow gating, or don't have any going on right now, # or want to exclusively use a callback strategy instead of polling. -0,5,10,15,20,25,30,35,40,45,50,55 * * * * @PYTHON@ -S @prefix@/cron/gate_news +0,5,10,15,20,25,30,35,40,45,50,55 * * * * @MAILMAN_USER@ @prefix@/cron/gate_news # # At 3:27am every night, regenerate the gzip'd archive file. Only # turn this on if the internal archiver is used and # GZIP_ARCHIVE_TXT_FILES is false in mm_cfg.py -27 3 * * * @PYTHON@ -S @prefix@/cron/nightly_gzip +27 3 * * * @MAILMAN_USER@ @prefix@/cron/nightly_gzip diff -r -u mailman-2.1.5.orig/cron/disabled mailman-2.1.5/cron/disabled --- mailman-2.1.5.orig/cron/disabled 2004-02-10 17:59:45.000000000 -0500 +++ mailman-2.1.5/cron/disabled 2004-08-31 12:22:54.000000000 -0400 @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! @PYTHON@ -S # # Copyright (C) 2001-2004 by the Free Software Foundation, Inc. # diff -r -u mailman-2.1.5.orig/cron/gate_news mailman-2.1.5/cron/gate_news --- mailman-2.1.5.orig/cron/gate_news 2003-09-21 22:29:51.000000000 -0400 +++ mailman-2.1.5/cron/gate_news 2004-08-31 12:21:48.000000000 -0400 @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! @PYTHON@ -S # # Copyright (C) 1998-2003 by the Free Software Foundation, Inc. # diff -r -u mailman-2.1.5.orig/cron/mailpasswds mailman-2.1.5/cron/mailpasswds --- mailman-2.1.5.orig/cron/mailpasswds 2003-09-21 22:29:51.000000000 -0400 +++ mailman-2.1.5/cron/mailpasswds 2004-08-31 12:21:56.000000000 -0400 @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! @PYTHON@ -S # # Copyright (C) 1998-2003 by the Free Software Foundation, Inc. # diff -r -u mailman-2.1.5.orig/cron/nightly_gzip mailman-2.1.5/cron/nightly_gzip --- mailman-2.1.5.orig/cron/nightly_gzip 2002-10-21 18:36:58.000000000 -0400 +++ mailman-2.1.5/cron/nightly_gzip 2004-08-31 12:22:32.000000000 -0400 @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! @PYTHON@ -S # # Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. # diff -r -u mailman-2.1.5.orig/cron/senddigests mailman-2.1.5/cron/senddigests --- mailman-2.1.5.orig/cron/senddigests 2002-10-21 18:36:58.000000000 -0400 +++ mailman-2.1.5/cron/senddigests 2004-08-31 12:22:44.000000000 -0400 @@ -1,4 +1,4 @@ -#! @PYTHON@ +#! @PYTHON@ -S # # Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. # diff -u mailman-2.1.5.orig/misc/mailman.in mailman-2.1.5/misc/mailman.in --- mailman-2.1.5/misc/mailman.in.1 2005-02-15 11:08:47.244527000 -0500 +++ mailman-2.1.5/misc/mailman.in 2005-02-15 11:15:53.615729000 -0500 @@ -36,6 +36,36 @@ MAILMANHOME=@prefix@ MAILMANCTL=$MAILMANHOME/bin/mailmanctl +# We used to install the mailman cron jobs when the mailman rpm was +# installed, irrespective of whether mailman was actually being +# run. Although the cron jobs didn't create any problems if someone +# wasn't running mailman some users complained about the cron log file +# filling up, resource usage, and power consumption since systems +# wouldn't really idle. It really only makes sense to run the mailman +# cron jobs if the mailman service is turned on and not just merely +# having the rpm installed. This init.d script is an obvious place to +# install or remove the cron jobs based on the service being enabled +# or not. + +SRC_CRON_SCRIPT=$MAILMANHOME/cron/crontab.in +DST_CRON_SCRIPT=/etc/cron.d/mailman + +function InstallCron() +{ + install -m644 -o root -g root $SRC_CRON_SCRIPT $DST_CRON_SCRIPT +} + +function RemoveCron() +{ +cat > $DST_CRON_SCRIPT <