[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] sorting on X-Spam headers
From: |
Ralph Corderoy |
Subject: |
Re: [Nmh-workers] sorting on X-Spam headers |
Date: |
Thu, 28 Apr 2005 11:14:35 +0100 |
Hi Jerry,
> You could do it with a short script. Feed the script a list of
> message numbers and X-Spam-Status header fields with this:
>
> scan -format '%(msg) %{x-spam-status}'
>
> The output of that will look like this:
>
> 1 No, hits=-31.6
> 2 Yes, hits=23.2
> 3 No, hits=1.3
> ...
Some fix-up might be needed if there's no x-spam-status header.
> Parse out the info you want, then sort, then reorder the messages. I
> haven't written code to reorder messages, but one easy way I can think
> of is to first rename all the messages starting with two commas (,,)
> or hash marks (##) -- sort of like "rmm" does, but with two of the
> characters so there won't be conflicts with any "removed" messages in
> the folder. Then give the messages their new names. That idea must
> have gotchas... one is that if you interrupt the sort, your messages
> will all be gone. 8^} Maybe someone has a better idea...
Another way is to `refile @. $msg' repeatedly, which effectively moves
the message to the end of the folder, and then `folder -pack'. It has
the down-side of packing the folder but an abort part way through
shouldn't loose anything assuming refile is safe.
Another way is to anno(1) each message with a new field and then
sortm(1) on that. But that leaves the annotation in place and anno
doesn't have a -remove option.
Cheers,
Ralph.
- [Nmh-workers] tempfile creation, Paul Fox, 2005/04/27
- Re: [Nmh-workers] tempfile creation, Mike O'Dell, 2005/04/27
- Re: [Nmh-workers] tempfile creation, Mike O'Dell, 2005/04/27
- Re: [Nmh-workers] tempfile creation, Neil W Rickert, 2005/04/27
- Modernizing core code (was Re: [Nmh-workers] tempfile creation, heymanj, 2005/04/27
- Re: Modernizing core code (was Re: [Nmh-workers] tempfile creation, Ralph Corderoy, 2005/04/28
Re: [Nmh-workers] tempfile creation, Chad Walstrom, 2005/04/27
- Re: [Nmh-workers] tempfile creation, Josh Bressers, 2005/04/27
- Re: [Nmh-workers] tempfile creation, Mike O'Dell, 2005/04/27
- [Nmh-workers] [OT] nit (was Re: tempfile creation), Chad Walstrom, 2005/04/27
- Re: [Nmh-workers] tempfile creation, Ralph Corderoy, 2005/04/28
- Re: [Nmh-workers] tempfile creation, Mike O'Dell, 2005/04/28