procmail
[Top] [All Lists]

postprocess a mailbox

1998-08-12 11:05:15
i'm trying to post process a mail box to remove any messages that are not
from August. the mailbox isn't the inbox. all the non-August mail is
removed and ends up in null.inbox (will be changed to /dev/null when i
get this to work) but all the rest of the mail disappears. the shell
script is from the procmail man page and it appears the file .newmail
never gets removed. i think the problem is because i'm using a mailbox
that's not the "inbox" but not sure how to fix it. starting from scratch
would be fine.

thanks,
Michael McCaffrey



here's the procmail_list.rc file i use in the shell script below.

# Backup everything
:0 c
/home/herozero/ebox/testzone_backup.inbox

# Send all old messages to the bit bucket.
:0
* !^Date: .*Aug
/home/herozero/ebox/null.inbox





#!/bin/sh

ORGMAIL=/home/herozero/ebox/procmail_list.inbox

if cd $HOME &&
  test -s $ORGMAIL &&
  lockfile -r0 -l1024 .newmail.lock 2>/dev/null
then
  trap "rm -f .newmail.lock" 1 2 3 13 15
  umask 077
  lockfile -l1024 -ml
  cat $ORGMAIL >>.newmail &&
   cat /dev/null >$ORGMAIL
  lockfile -mu
  formail -s procmail -m /home/herozero/ebox/procmail_list.rc <.newmail &&
   rm -f .newmail
  rm -f .newmail.lock
fi

exit 0

<Prev in Thread] Current Thread [Next in Thread>