procmail
[Top] [All Lists]

generate delivery file from To: header

2001-12-01 22:40:19

This was discussed here fairly recently, I believe, but finding the
discussion is proving somewhat difficult.  

I want to know how to create the delivery target from a message
header.

For example:
A message coming thru has a `to' header like: To: Alonzo(_at_)my(_dot_)machine

I want it to be delivered to a file called Alonzo but without having
to know in advance.

So ` :0
    * To:.*Alonzo
   Alonzo
Isn't what I mean.

More like:

  :0 
  [ ] # <== someting that grabs the To: header and clips off whatever is
      # before the @, creating TO_VAR
 ${TO_VAR}.in    

It needs to work when the `to' address has more
than one address by grabbing only the first one to create the delivery
target but that will be easy to see if I see the main technique described. 

I guess the MATCH operator is what is used, but I didn't read the
previous discussion closely since I wasn't needing it at that time.

Following the hits on MATCH in the various man pages I was
disappointed to find the best one was this:
MATCH       This variable is assigned to by procmail when­
                   ever  it is told to extract text from a match­
                   ing regular expression.  It will  contain  all
                   text  matching the regular expression past the
                   `\/' token.

Really doesn't leave one knowing how to use this.  Past `\/'.  Is
pretty weak.  This looks like a good place for one small example.

I expected to find something in `procmailex' but the hits on MATCH
there were even less usefull.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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