[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: looking for nice way to throw out old mail in mutt



> I like being subscribed to debian user. I also end up not being able to
> read it from lack of time. I have exim filter debiaan user into its own
> mailbox, but I would like to be able to have messages over a week (or
> some other arbitrary time) fed to the /dev/null monster. Does any one
> have a nice way to do this? TIA
> 
make a cron-job, which checks your mailbox every day. i've attached a
script, which removes all messages, which are older that 7 days.
please test this thing thoroughly, as i programmed it now from scratch.

possibly there is a simpler way to do this ...

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Linux - the last service pack you'll ever need.
#!/bin/bash
# the following line would be "MB=$1", if you wanted to pass the mailbox
# to process as an argument to the script
MB=~/debian.mbox
formail -s bash -c "IFS=''; b=\`cat\`; test \$(date -d \"\$( echo \$b|formail -x Date )\" +%s ) -ge \$(date -d \"7 days ago\" +%s ) && echo -e \"\$b\n\n\"" <$MB >$MB.new && mv $MB.new $MB

Reply to: