on Thu, Dec 11, 2003 at 05:19:57PM -0700, s. keeling ([EMAIL PROTECTED]) wrote:
> Incoming from Nunya:
> > 
> > Also: If you could post a one-line .muttrc command which would pipe the 
> > current message to grep, pull out the message id, and append it to kill, 
> 
>    | egrep '^Message-ID' > ~/.mutt/kill
> 
> You can stuff some sed in there to clean it up.

Rather than egrep, formail, to extract relevant IDs:

    formail -c -x Message-ID < <message>

You want the message ID of the message you intend to kill.  You want to
test for it within the references line of an incoming message:

    if formail -c -x References | grep -f <killed IDs file>
    <kill message>

Sample proof-of-concept code, Maildir format.  CD to a current mailbox's
'new' directory, with messages:

    # Create list of IDs 
    for f in *
    do 
        echo ">>> $f <<<"
        formail -c -x Message-ID < $f >> ~/message-IDs
    done

    # And test results:
    for f in *
    do 
        echo -e "$f: \c"
        if formail -c -x References < $f | grep -qf ~/message-IDs; then 
            echo "Found"
            else echo "Not found"
        fi
    done


Peace.

-- 
Karsten M. Self <[EMAIL PROTECTED]>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
    The black hat community is drooling over the possibility of a secure
    execution environment that would allow applications to run in a
    secure area which cannot be attached to via debuggers.
    - Jason Spence, on Palladium aka NGCSB aka "Trusted Computing"

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to