FAQ
Is there anyway to schedule digest emails?

I could use a timer to send emails once a week at a particular time.

Thanks

:::::..::::::...:::::::....::::::::::.....:::::::::........
Dwayne Phillips
Technologies Director
Freight Management Inc
2900 East La Palma Ave
Anaheim, CA 92806
714.632.1440 ext. 106
714.224.7906 Direct
714.224.7956 Fax
:::::..::::::...:::::::....::::::::::.....:::::::::........

Search Discussions

  • Mark Sapiro at Mar 12, 2005 at 3:37 pm

    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.
    You can adjust the crontab entry to run senddigests on whatever
    schedule you want (default is daily at noon).

    Digests will still be sent when the accumulated size reaches
    digest_size_threshhold.

    If you're asking regarding an individual list rather than the site, you
    would have to set digest_send_periodic to No and then send digests
    through some other process. You can't use cron/senddigests directly
    because it only sends digests for lists that have digest_send_periodic
    set to Yes even if the list is named on the command line, but you
    could look at the code to see how a digest is sent and make a simple
    script to do the same thing or use bin/withlist.

    --
    Mark Sapiro <msapiro at value.net> The highway is for gamblers,
    San Francisco Bay Area, California better use your sense - B. Dylan
  • Dwayne Phillips at Mar 15, 2005 at 6:29 pm
    Mark

    I have one problem, this resides on a shared machine. Any way to script it
    for a particular client?

    Thanks

    :::::..::::::...:::::::....::::::::::.....:::::::::........
    Reply from
    Dwayne Phillips
    Freight Management Inc
    714.224.7906
    714.224.7956 Fax
    :::::..::::::...:::::::....::::::::::.....:::::::::........



    -----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.
    You can adjust the crontab entry to run senddigests on whatever
    schedule you want (default is daily at noon).

    Digests will still be sent when the accumulated size reaches
    digest_size_threshhold.

    If you're asking regarding an individual list rather than the site, you
    would have to set digest_send_periodic to No and then send digests
    through some other process. You can't use cron/senddigests directly
    because it only sends digests for lists that have digest_send_periodic
    set to Yes even if the list is named on the command line, but you
    could look at the code to see how a digest is sent and make a simple
    script to do the same thing or use bin/withlist.

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



    --
    No virus found in this incoming message.
    Checked by AVG Anti-Virus.
    Version: 7.0.308 / Virus Database: 266.6.4 - Release Date: 3/7/2005
  • Brad Knowles at Mar 16, 2005 at 9:13 am

    At 10:29 AM -0800 2005-03-15, Dwayne Phillips wrote:

    I have one problem, this resides on a shared machine. Any way to script it
    for a particular client?
    As Mark said:
    If you're asking regarding an individual list rather than the site, you
    would have to set digest_send_periodic to No and then send digests
    through some other process. You can't use cron/senddigests directly
    because it only sends digests for lists that have digest_send_periodic
    set to Yes even if the list is named on the command line, but you
    could look at the code to see how a digest is sent and make a simple
    script to do the same thing or use bin/withlist.
    In this case, it sounds to me like you're going to need to get
    help from the people who run the shared machine, because there's
    going to have to be some custom Python code that is written and
    executed through a cron job of some sort.

    --
    Brad Knowles, <brad at stop.mail-abuse.org>

    "Those who would give up essential Liberty, to purchase a little
    temporary Safety, deserve neither Liberty nor Safety."

    -- Benjamin Franklin (1706-1790), reply of the Pennsylvania
    Assembly to the Governor, November 11, 1755

    SAGE member since 1995. See <http://www.sage.org/> for more info.
  • Mark Sapiro at Mar 15, 2005 at 8:44 pm

    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmailman-users @
categoriespython
postedMar 11, '05 at 6:39p
activeMar 16, '05 at 9:13a
posts5
users3
websitelist.org

People

Translate

site design / logo © 2022 Grokbase