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

Re: mail scripts



On Monday 04 April 2005 12:59 pm, Charles Cazabon wrote:
> MDM <mdm@xxxxxxxxxxxxxxx> wrote:
> > I am looking for a script that will parse the emails in a Maildir
> > mailbox and dump all the from addresses to a txt file.
> >
> > Does anyone have any idea where i can find one?
>
>   find Maildir/{cur,new}/ -type f -print0 \
>
>     | xargs -0 -n 1 822field from \
>     |
>     > textfile
>
> `822field` is part of the mess822 package.

that probably won't work since 822field expects the email from stdin and xargs 
places the input on the command line provided... however:

find Maildir/{cur,new}/ -type f | while read i ; do 822field from < $i ; done

should work just fine

-Jeremy

-- 
Jeremy Kitchen ++ Systems Administrator ++ Inter7 Internet Technologies, Inc.
    jeremy@xxxxxxxxxx ++ inter7.com ++ 866.528.3530 ++ 815.776.9465 int'l
      kitchen @ #qmail #gentoo on EFnet IRC ++ scriptkitchen.com/qmail
         GnuPG Key ID: 481BF7E2 ++ jabber:kitchen@xxxxxxxxxxxxxxxxx

Attachment: pgp00001.pgp
Description: PGP signature