[Top][All Lists]

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

Re: [Nmh-workers] sorting on X-Spam headers

From: Jerry Peek
Subject: Re: [Nmh-workers] sorting on X-Spam headers
Date: Wed, 27 Apr 2005 11:45:31 -0700

On 27 April 2005 at 12:38, Michael Richardson <address@hidden> wrote:
> Does anyone have any solutions to sort on spamassassin headers?
> I.e. I want to sort my inbox on:
>      X-Spam-Status: No, hits=-31.6
>                              ^^^^^
> this number.

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

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...


reply via email to

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