running procmail on the contents of /var/mail/$USER

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Thu Jul 29 05:19:06 UTC 2004


On Wed, 28 Jul 2004, William O'Higgins wrote:

> I recently had a hardware problem that caused a week's downtime, and
> when I first got up and running procmail was not set up, but fetchmail
> was.  The result is that I have a few hundred messages in
> /var/mail/$USER, none of which have been filtered through procmail,
> spamassassin, or razor.  I want to run the whole spoolfile through
> procmail, but I can't figure out how.
>
> I was looking at formail, and tried things like "formail +1 -ds
> procmail" and "formail -ds < /var/mail/$USER > procmail", but that
> didn't work.  Does anyone know the syntax of this kind of thing?
> Thanks.

When called like this procmail uses ~/.procmailrc as recipe. Make sure you 
run the command as that user (the user who owns that mailbox and the 
.procmailrc). The command works fine, I tried it. Of course you first copy 
the mailbox file to another file, recreate the mailbox file empty, and 
then run the command. If you want to keep your sanity turn off the MTA and 
any MUA that might be open on that mailbox while you delete and recreate 
it. If you do not do this, then something might want to lock or write to 
the file and bad things will happen.

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list