On 11-Feb-2003/19:27 -0800, Christopher Lyon <[EMAIL PROTECTED]> wrote:
>This might be a dumb question but since I am mostly using X windows and
>evolution I don't know what to use in the text environment. If I needed
>to pull email from a POP server and parse over the subjects with a
>filter what would the best POP client be to perform that operation?

Download with fetchmail and filter with procmail. You can have fetchmail
deliver directly to procmail. My ~/.fetchmailrc looks something  like
this:

defaults protocol pop3 fetchall nokeep mda "procmail -d $LOGNAME"
poll pop.myisp.com   username myname   password mypass

A procmail filter to feed the subject lines to a script might look like
this:

:0hc
* ^Subject:
| formail -c -x Subject: | /usr/local/bin/myscript


The first line denotes the start of the filter. The 'h' tells procmail to
deliver the header to the file or pipe. The 'c' tells procmail to operate
on a copy of the message. The original will still be delivered according
to subsequent filters.

The second line is a regexp for the subject line. This will match every
message that has a subject header.

The last line pipes the message header through formail, where the subject
will be extracted and piped into your script.

Tony
-- 
Anthony E. Greene <mailto:[EMAIL PROTECTED]%3E>
OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
AOL/Yahoo Messenger: TonyG05    HomePage: <http://www.pobox.com/~agreene/>
Linux. The choice of a GNU generation <http://www.linux.org/>



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to