procmail
[Top] [All Lists]

Re: Howto extract multiple emailadresse from the to: header field valid for the local domain

2005-06-07 23:49:48
thank u fo your answer, and please excuse my mistakes
its first time i am try to participate on a mail list. ( probably further mistakes of me to come)

so to end the confusion can you please post the complete corect code sample for the procmail.rc to recieve the requestet ?
M. Häker



Dallman Ross schrieb:

On Mon, Jun 06, 2005 at 07:12:19AM +0000, mhaeker wrote:

i am searching for a pure procmail rc witch can extract the
emailadresses from the to: field.

i read already this:

#  This routine takes a header containing both email addresses
#  and friendly names, and returns just the email addresses, in a
#  comma separated form.
#
#  It checks both the To and Cc headers.


What I predicted a couple of weeks ago has happened.

On May 20, 2005, under a thread with the Subject "Re: How to
extract multiple email addresses in To: header," I wrote a reply to
mark david mcCreary (whose similar question had prompted my draft
submission of an all-procmail solution to this problem), in which
I said:

Part of the reason I've gone to some length to explain is that
you've [restated] something I wrote mixed up with something you
wrote, and the casual reader/kibitzer won't be able to tell what's
whose.  Somehow that doesn't appeal to me.  I can already envision
the altered version's making go-rounds for months on the net and
then someone asking a question about it in the altered form and
wondering why it behaves funnily. :-)  (That kind of thing has
happened before; as has that a buggy early proposal I made to
the list made the rounds like that, but the corrected version
sent later the same day somehow was missed by all those glomming
on to the buggy one.  Months later, I had to explain why the
buggy one didn't work.)

So now the current poster has quoted back that -- well, let's just
call it "Bowdlerized" -- code.  First, to the current poster:
1) Please cite sources when quoting something you found.
I was the original author of most of the code you reprinted, but
the version you show is the one Mark tried out, with some of his
changes.  I responded to that article in short order with some
remarks about what I found suboptimal about it, and with another
improved version.  I suggest you go find that in the archives
to start.

I really don't want to have to re-do this correction every few weeks
or months, or even years.  I already put in a few hours solving the
problem the first time.  When you write to a technical list and
dredge up old material, it is harmful to leave its source anonymous
when stating it would help so much all around.  I am not saying
this out of ego as the original author.  (What I send to the list
belongs to the list.)  I am, however, requesting citation because
it is the only logical manner to proceed with coding help that
spans weeks or months and concerns complex statements.  If we
know you are quoting Mark's reworked version, then it's a lot
easier for someone to jump in and say, "Hey, that was a draft
solution that had improvements suggested immediately thereafter."

A side-issue is, if you have gone to the trouble to dig up old
list postings, it's more the pity that you didn't read any of
the various recent displeasure at people who send MIME text to
this list.  This is a text list discussing a program that works
under pure text scripting.  It is archived in perpetuity in
text format.  There is no reason whatsoever to send HTML or
multipart/alternative mail to this list.  Don't t do it!


Once you find the better syntax to do the original job (my reply
to the posting you quoted anonymously), I can help you do what you
want, because it is trivial.  All you need to do is find the
place in the loop where addresses are accreted to the save-var
and insert a line to skip the save if the @domain.dom part isn't
what you want.

* $ _HOLD ?? ()\/$ADDYCL+ $AHOST[.][a-zA-Z]+

{

ADDRESS = $MATCH

STRIPPED_ADDRESSES =
${STRIPPED_ADDRESSES:+$STRIPPED_ADDRESSES${_ifs}}$ADDRESS


Right there, for instance (or in the similar place in the
improved code I later suggested), you could have a final
condition before the curly brace to skip the save to
STRIPPED_ADDRESSES.  Something like:

 * ! MATCH ?? @mydomain.dom^^


Attachment: mhaeker.vcf
Description: Vcard

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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