Any mailbox cleaner program?
Does anyone know of a program that I can set as a cron job to go through an mbox file, and delete all messages that are from a mailing list and are 21 days old?
Re: Any mailbox cleaner program?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Said Philip Mak on Tue, Feb 19, 2002 at 03:59:35PM -0500: > Does anyone know of a program that I can set as a cron job to go > through an mbox file, and delete all messages that are from a mailing > list and are 21 days old? If you have IMAP access to the mailbox, you could try my script: http://codesorcery.net/purgeimap/ If not, I'd just use a Mutt call with -f and push in a delete pattern to clear out the old stuff. - -- [!] Justin R. Miller <[EMAIL PROTECTED]> PGP 0xC9C40C31 -=- http://codesorcery.net http://www.american-partisan.com/cols/mcelroy/102399.htm -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8cr7894d6K8nEDDERAjrwAJ9T2/fglYS9ANcc/H1ZWnJ6Nf77JQCfavoH AtxnfoXQdPE9I6DFPxtlubo= =O889 -END PGP SIGNATURE-
Re: Any mailbox cleaner program?
Quoting Philip Mak <[EMAIL PROTECTED]> [19 Feb-02 15:59]: > Does anyone know of a program that I can set as a cron job to > go through an mbox file, and delete all messages that are from > a mailing list and are 21 days old? Here is what I do: folder-hook . push 'D~r>15d!~F\n' This deletes everything older tahn 15 days that is not flagged. This doesn't run from cron though, obviously. Although I suppose you could have cron startup mutt, run this, and then quit, right? (darren) -- There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies. -- C.A.R. Hoare
Re: Any mailbox cleaner program?
On 2002.02.19, in <[EMAIL PROTECTED]>, "Justin R. Miller" <[EMAIL PROTECTED]> wrote: > > If not, I'd just use a Mutt call with -f and push in a delete pattern to > clear out the old stuff. This won't work from a crontab, though. When mutt has no terminal, it ignores -e actions and acts as a mailer, like /bin/mail. One so inclined could presumably write a little program to create a pty whose master is attached to /dev/null, under whose slave mutt could run "with a terminal". It would actually be a pretty handy tool. -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago Colons and slashes and dots, oh my!
Re: Any mailbox cleaner program?
On Tue, Feb 19, 2002 at 03:59:35PM -0500, Philip Mak wrote: > Does anyone know of a program that I can set as a cron job to go > through an mbox file, and delete all messages that are from a mailing > list and are 21 days old? You will not believe it - it's mutt! Example (from my .muttrc): set score # set scoring on score ~ 5000# set the default score to #all messages to 5000 score "~C mutt-users ~R ~r >60d" -4000 # if message is from mutt-users # list AND read AND older than # 60 days then drop its score set score_threshold_delete=1000 # delete messages with score # 1000 or less Probaly you could just define macro to kill messages and call it from the folder-hook, without using scoring. Another way to delete old messages is to use filter mbox thru formail/procmail, but I'm not guru on these excellent tools. If you are using MH or Maildir, it's just find/grep + some trivial shell scripting. -- Regards, Artem Okounev. msg24585/pgp0.pgp Description: PGP signature
Re: Any mailbox cleaner program?
* Philip Mak ([EMAIL PROTECTED]) wrote: > Does anyone know of a program that I can set as a cron job to go > through an mbox file, and delete all messages that are from a mailing > list and are 21 days old? I'm planning a generic mail archiving tool that will allow this, as well as moving messages to other mailboxes with custom filenames (I use ~/Mail/archive///mm-.), support for multiple formats (Maildir working folders + gzipped archived mbox, for instance) etc. I use a less generic system atm that's tuned to my particular needs and not particularly well written, but it's archived about 140,000 messages and the wc of my ~/Mail dir has remained identical before and after use :) -- Thomas 'Freaky' Hurst - [EMAIL PROTECTED] - http://www.aagh.net/ - You will triumph over your enemy.