procmail
[Top] [All Lists]

Ignoring multiple 'to 's

1998-04-14 05:53:38

Hi all, I actually posted this some time back, but never got the
problem resolved.  I've worded it better this time I hope.

I'm using this recipe to extract addresses from the *body* of bounced mails.

:0Bwir:
    * !^To:.*,+
    * ^To:[     ]*\/[^  ].*
    | echo "$MATCH" >>IN.BadAddress.$DATE

However sometimes I get back a mail which had a cc'd address too, like this:

[snipped from the mail returned to me - not the original mail]


  from <jobfinder(_at_)infolive(_dot_)ie>
  to <harry3dee(_at_)hotmailcom>
  to <maria(_dot_)dorgan(_at_)digital(_dot_)com>
  <3 lines snipped>
  From: InfoLive JobFinder <jobfinder(_at_)infolive(_dot_)ie>
  Message-Id: <199804061137(_dot_)MAA15463(_at_)infolive(_dot_)ie>
  To: maria(_dot_)dorgan(_at_)digital(_dot_)com

harry3dee was cc'd on the mail.  Its his address that has
actually bounced, but because maria was the main (To:) addressee,
her address (in the last line above) is the one that goes into my
bounced addresses file. (Double trouble..I dont get my man, and
a correct address goes on the 'to axe' list)

How would I be able to set the recipe such that it can check for
more than one 'to ' lines in row ?

So then I can _not_ follow thru with the recipe above if thats the case,
and secondly, use the same method in a subsequent recipe to send the
bounce to a separate bounce file.



Many thanks for any gray matter turned to the problem...will summarize,


Tony.



__________________________________________________
Tony Moran                      IT Manager
Ph:   (+353-1)-8303455          Scope Communications.
Fax: (+353-1)-8300888
http://www.jobfinder.ie         http://www.infolive.ie
      Ireland's online Jobs and IT resources Web Site - Check us out !
__________________________________________________
How to complain about Spam: http://weber.ucsd.edu/~pagre/spam.html


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