procmail
[Top] [All Lists]

Re: howto run procmail on INBOX?

1998-12-08 09:04:05
dnp wrote,

| Thanks Mark and Era for your inputs. I tried Mark's suggestion and bizzare
| things began happening. First, the number of processes which I owned just
| shot up and exceeded the maximum number of processes allowed per user.

Perhaps though the recipes in your rcfile were adding messages to the same
mailbox that you were processing, so formail -s procmail kept finding new
messages to process, even though they were copies of previously filed mail.

There are three basic ways around that: (1) mv the mailbox to a different
name before feeding it to formail -s procmail, (2) formail's -{number} option
to limit the number of messages it reads to the number that were in the
mailbox to start, or (3) use the duplicate detection of formail -D to drop
any reappearances of messages that it has already seen.

Also, you might have used formail -ns instead of -s, which would not be a
good idea for this particular use.  That makes formail keep forking off
additional processes of the second command as fast as it can get a message
ready for it without waiting for each previous fork to finish one by one.
Then you'd have all these procmails running at the same time, waiting for
the same lockfile.  But that would have been limited to the number of
messages in the mailbox to start; using -n usually prevents, or at least
limits, the damage from reprocessing mail that I spoke about above.

| However, I managed to kill every one of the procmail processes. After
| that, whenever I used to run procmail (i.e. whenever any new mail would
| come in), my mailbox would be locked and I wouldn't be able to access it.

If you killed the processes with signal 9 they couldn't remove their lock-
files on exit, and the local lockfile remained.  Signal 15 (I think) is
better when you have to kill procmail.

| So I switched off procmail and found to my dismay that I wasn't able to
| receive any incoming mail at all albeit I was able to send out mail. As a
| last resort I moved my mailbox file to a different location and moved it
| back to its original location and I began recieving incoming mail again. I
| switched procmail on again and things are back to normal....so far!

When the unremoved lockfile went stale, you could get new deliveries again.