[Mailman-Users] Mailman Question

Mark Sapiro msapiro at value.net
Tue Mar 15 21:44:25 CET 2005


Dwayne Phillips wrote:
>
>I have one problem, this resides on a shared machine. Any way to script it
>for a particular client?
>
>-----Original Message-----
>From: Mark Sapiro [mailto:msapiro at value.net] 
>Sent: Saturday, March 12, 2005 7:37 AM
>To: dphillips at freightmgmt.com; mailman-users at python.org
>Subject: Re: [Mailman-Users] Mailman Question
>
>Dwayne Phillips wrote:
>
>>Is there anyway to schedule digest emails?
>>
>>I could use a timer to send emails once a week at a particular time.

<previous response snipped>

Assuming you have access to the command line, you can do the following.

1) set digest_send_periodic the specific list's Digest options page to
No

2) make a new script by modifying cron/senddigests as follows:

--- senddigests 2005-02-06 14:27:23.968750000 -0800
+++ new_senddigests     2005-03-15 12:41:54.765625000 -0800
@@ -28,6 +28,8 @@
     --listname=listname
         Send the digest for the given list only, otherwise the digests
for all
         lists are sent out.
+        If this option is specified the list's digest_send_periodic
flag is
+        ignored.
 """

 import sys
@@ -69,6 +71,7 @@
         usage(1)

     listnames = []
+    unconditional = 0
     for opt, arg in opts:
         if opt in ('-h', '--help'):
             usage(0)
@@ -77,10 +80,12 @@

     if not listnames:
         listnames = Utils.list_names()
+    else:
+        unconditional = 1

     for listname in listnames:
         mlist = MailList.MailList(listname, lock=0)
-        if mlist.digest_send_periodic:
+        if mlist.digest_send_periodic or unconditional:
             mlist.Lock()
             try:
                 mlist.send_digest_now()

3) Set up a cron or whatever to run the command

/usr/bin/python -S $prefix/cron/new_senddigests --listname=<listname>

where /usr/bin/python may need to be adjusted, $prefix is the path to
your mailman installation and <listname> is the name of the list, on
the desired schedule.

4) You may want to set digest_size_threshhold for the list to a very
large number if you don't want any digest sends triggered by size.

--
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list