Re: [GENERAL] procmail w/ PG. - Mailing list pgsql-general

From Ed Loehr
Subject Re: [GENERAL] procmail w/ PG.
Date
Msg-id 384ACACC.BFA8223@austin.rr.com
Whole thread Raw
In response to procmail w/ PG.  ("Jason C. Leach" <jcl@mail.ocis.net>)
List pgsql-general
"Jason C. Leach" wrote:

> I'l like procmail to filter out the To, From, Date, Subject, Body and
> complete header of the email.  Then either stick it in a DB, or pass
> that info to a Perl script to stick in in the DB.
>
> Anyone know of such a script? Or an example I can work with?

Caveat emptor, as I haven't done it yet, but there are a few procmail
examples of how to filter and pass email to other programs, perl
included, at

    http://www.tamucc.edu/~compserv/lman/other/procexamples/index.html

The relevant examples look something like this one, which sends all mail
with 'Digest' in the subject to a mail reformatting program called
formail (see man formail):

     :0
    * ^Subject:.*Digest
    |formail +1 -d -s procmail

This sounds like a task well-suited to perl regular expressions with
DBI/DBD::Pg.  I found it quite worthwhile when setting up procmail to
spend some time carefully reviewing the various procmail filter options
(on the man page) that follow the colon.  They allow you to chain
filters together and control the flow and exit point of mail through
your filter chains.

Cheers.
Ed Loehr


pgsql-general by date:

Previous
From: "Jason C. Leach"
Date:
Subject: procmail w/ PG.
Next
From: Mike Mascari
Date:
Subject: Re: [GENERAL] null and =