Subject: Re: using procmail to breakup large folders?

From: [email-masked] (David W. Tamkin)
Date: Fri, 16 Sep 1994 17:23:25 -0500 (CDT)

Steve Morris asked,

| I've been using procmail and emacs vm for a while now to distribute my
| mail in seperate folders. Now I realize that I should have distributed
| differently and a couple of large folders should really be broken
| up. Is it possible to use procmail to revisit a folder and rerun a
| new receipe file on it? currently I have only used procmail in my
| .forward file.

It's basically very easy, but there is one possible complication:

  formail -s procmail other_rcfile < folder

The problem arises if the recipes will append to the input.  I've rather
stupidly fallen into that hole twice, with the result that formail keeps
rereading the letters that procmail is appending to the input folder.

Two possible solutions:

1. Make sure that the rcfile never saves anything to the input folder
   and that the input folder is not the rcfile's $DEFAULT.

2.
  a. Make sure that nothing is presently delivering to that folder:
     lockfile input_folder.lock
  b. mv that folder to a neutral name not used anywhere else:
     mv input_folder new_name_of_input_folder
  c. rm -f input_folder.lock
  d. formail -s procmail other_rcfile < new_name_of_input_folder
  e. rm -f new_name_of_input_folder

  You might want to surround steps 2d and 2e in parentheses or braces and
  run them in the background.  It's not a problem if reprocessed mail or new
  incoming mail is saved to the old name of the input folder after the lock
  is removed in step 2c, since formail will not be reading from there.

David W. Tamkin  P. O. Box 3284  Skokie IL  60076-6284
[email-masked]   MCI Mail: 426-1818   +1 312 714 5610