procmail
[Top] [All Lists]

Re: Generate digest messages for mailing list?

2001-10-17 08:10:33
Reiner asked,

| Would such a setup work:
|
| .procmailrc:
|
| :0:
| * TO_listname
| $LISTFOLDER

#1: the token is ^TO_; just "TO_" will be taken as literal text and will not
match.
#2: ^TO_ has to be one of the poorest ways to identify mail from a mailing
list.  Look for a List-ID:, X-Mailing-List:, or other such header to match
on.

| * 0 * * * /usr/bin/formail -ds procmail rc.dailydelivery

No, you don't want to run it every minute from midnight to 1 AM, and
procmail might not be in cron's PATH.

 0 0 * * * /path/to/script # or $HOME/rest/of/path

with a shell script such as I posted before.  Don't try to put the whole
code from the script into your crontab.  (Besides, you didn't specify an
input file for formail to read.)

| :0:
| * TO_listname
| $DEFAULT

#1 & #2: see above about ^TO_.
#3: Since the folder already has only messages from that list, you don't
need a condition.
#4: If you run a script like the one I suggested, you need to get a lockfile
on your inbox only once per run for however many messages there are and
release it only once.  What you have there gets the lockfile once for each
message and then releases it again.

| Also how will I get $LISTFOLDER emptied without losing mail?

Oops, I screwed up the script before.  The rm command at the end of the
chain should read,

 ... && \
  rm -f $LISTFOLDER $LISTFOLDER.lock $INBOX.lock



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail