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

William O'Higgins william.ohiggins-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Thu Jul 29 02:00:38 UTC 2004


On Thu, Jul 29, 2004 at 01:26:24AM -0400, Peter L. Peres wrote:
>
>>Anyway, I don't see anything wrong with William's syntax.  There's no
>>requirement to specify an rc file with procmail, if you don't it will just
>>use your ~/.procmailrc.  In other words, William's syntax was equivalent 
>>to:
>>
>>   formail -ds procmail ~/.procmailrc < /var/mail/$USER
>
>You CAN'T run that command, ever. procmail detects that someone else (bash 
>through <) reads /var/mail/$USER and refuses to run as it should, waiting 
>for bash to give up, i.e. forever. This will work (beware not tested as 
>written !):

Good to know - however, the command "formail -ds procmail <
/var/mail/$USER" did, in fact, work.  It took forever, because it
processed one file at a time (~72 minutes) but it worked.  The user who
owns all of the files at issue is the user running the command, so that
helps.

>	MBOX=/var/mail/$USER
>	cp /var/mail/$USER ~/tmp/mbox
>	/etc/init.d/mta stop
>	rm -f $MBOX; touch $MBOX; chown $USER mail $MBOX; chmod 660 $MBOX
>	/etc/init.d/mta start
>	formail +1 -ds procmail ~/.procmailrc <~/tmp/mbox
>
>I used a very similar concept to recover mail from (ancient) archives. If 
>your procmail recipe is set up right, then it will work.

Thanks to all who replied.  The lesson is, set up everything and make
sure it works before running fetchmail on several accounts that are long
dormant.
-- 

yours,

William

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://gtalug.org/pipermail/legacy/attachments/20040728/09cd9043/attachment.sig>


More information about the Legacy mailing list