nmh-workers
[Top][All Lists]
Advanced

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

Re: [nmh-workers] Cleaning up old messages


From: Ralph Corderoy
Subject: Re: [nmh-workers] Cleaning up old messages
Date: Thu, 14 Jun 2018 14:29:15 +0100

Hi Peter,

> I've done some poking into it, and I know I can go from folder to
> folder, delete all the messages, and then use some external shell
> command to really delete them, but frankly, this is a bit overwhelming
> for me. Is there a way (or a script that comes close to) letting me
> just delete and really remove all files older than a certain date or
> anything like that?

I'm assuming an email that's rmm(1)'d is renamed from `42' to `,42' so
you can search for those comma files with

    cd Mail
    find . -name ',[1-9]*' -type f -print |
    sort >/tmp/to-rm

Inspect /tmp/to-rm and if you're happy with what's been identified then
remove those with

    cd Mail
    xargs rm </tmp/to-rm

To rmm the emails in the first place, you can generate a list of all
folders and look for those with `Date' headers more than 1000 days ago,
for example, with pick(1), removing them if any are found.

    folders -fast |
    while read -r f; do
        folder +"$f" &&
        pick -seq torm -before -1000 &&
        rmm torm
    done

If you just want to test on a particular folder then change the first
line to

    echo inbox |

or whatever the folder name is.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]