Vincent --

...and then Vincent Danen said...
% Sorry if this isn't the right place to post this but I'm sure I got
% this little code snippet from a mutt-related website...
% 
% I've got this in my .procmailrc file:
% 
% ## Nuke duplicate messages
...
% ## Create backup cache of 100 most recent messages

First, you probably ought to back up your mail before discarding the
duplicates, so reverse these two.


% 
% But it doesn't seem to be working properly (the backup part).  I've
% got something like over 1000 messages in there now but I only want to
% save the last 100.  Can someone tell me what I'm doing wrong?

How very interesting.

Here's how mine is set up:

  .procmailrc
    MAILDIR=$HOME/Mail
    PMDIR=$HOME/.procmail
    FORMAIL=/usr/bin/formail
    ...
    INCLUDERC=$PMDIR/rc.backup
    ...

  rc.backup
    :0 c
    00Backup/.

    :0 ic
    | cd 00Backup && rm -f dummy `ls -t | sed -e 1,500d`

    :0 Wh: msgid.lock
    | $FORMAIL -D 8192 $HOME/.procmail/msgid.cache

This drops a sequentially-numbered clone of the email in $MAILDIR/00Backup,
uses the clone function to run the backup script (cd to 00Backup and then
remove messages that are left after removing the 500 most recent), and
*then* pumps it through formail against my Message-ID: cache file.

Note the trailing /. on the first recipe, where the copy gets dropped
off.  That's why the messages are sequentially numbered.


% 
% -- 
% [EMAIL PROTECTED], OpenPGP key available on www.keyserver.net
% Freezer Burn BBS:  telnet://bbs.freezer-burn.org . ICQ: 54924721
% Webmaster for the Linux Portal Site Freezer Burn:  http://www.freezer-burn.org
% 
% Current Linux uptime: 2 days 12 hrs and 37 mins.


:-D
-- 
David T-G                       * It's easier to fight for one's principles
(play) [EMAIL PROTECTED]      * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.bigfoot.com/~davidtg/        Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
The "new millennium" starts at the beginning of 2001.  There was no year 0.
Note: If bigfoot.com gives you fits, try sector13.org in its place. *sigh*

PGP signature

Reply via email to