procmail
[Top] [All Lists]

Re: Procmail as reporting tool

1999-01-02 15:35:26
On Sat, 2 Jan 99 20:46:55 +0000, John Poltorak
<jpolt(_at_)bradnet(_dot_)legend(_dot_)co(_dot_)uk> wrote:
Can I use procmail as a reporting tool, for instance, to show which
Mailer is being used on incoming mail?
If so, how do I do this?

Where exactly do you think Procmail fits into the picture here? 

You could do something like this:

    :0
    * ^X-Mailer:[       ]\/[^   ].*
    { LOG="mailer: $MATCH
" }

and then process the log at suitable intervals. Procmail can of course
understand much more complicated regular expressions than that, but so
can Perl and unless you want to run statistics on mail that is passing
through Procmail anyhow, I don't see why you don't just feed the
messages to Perl. (The real question, which I'm reluctant to ask, is
what you mean by "showing which Mailer is used". I'm guessing you have
some vague heuristics you want to use on the headers and that you
might have a half-finished Perl script implementing this. You should
perhaps be a bit more specific about what you have in mind.)

/* era */

-- 
.obBotBait: It shouldn't even matter whether    <http://www.iki.fi/~era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>

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