procmail
[Top] [All Lists]

Re: Extracting lines from emails

1999-08-03 11:40:35
On Tue, 3 Aug 99 8:48:33 +0100, John Poltorak
<jpolt(_at_)bradnet(_dot_)legend(_dot_)co(_dot_)uk> wrote:
How would I go about using procmail to create a list of all the
Message-IDs in all my emails?

If you mean, how do I create a list of all the Message-IDs in a
number of folders, the simple answer is

    cat folder1 folder2 folder3 | formail -zxMessage-Id -s

(the cat is obviously useless if you have only one folder, in which
case you'd do

    formail -zxMessage-Id -s <folder

but I digress. See also <http://www.iki.fi/era/unix/award.html>) ...
and probably you want to direct the results to a file if there's more
than about a dozen messages, or you want to do something with the
results other than look at them.

If you absolutely insist on invoking Procmail here, you could create a
message-id.rc file:

    SHELL=/bin/sh
    DEFAULT=/tmp/oops
    :0:
    | formail -zxMessage-Id >>message-ids

and then run +that+ from a formail loop:

    formail -s procmail message-id.rc < folder

but that's just silly.

Hope this helps,

/* era */

-- 
 Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
  Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition

<Prev in Thread] Current Thread [Next in Thread>