procmail
[Top] [All Lists]

Re: How do i save to forwards to separate files according to

2000-09-28 13:56:08
poohba(_at_)io(_dot_)com wrote,

| What I have so far is:

... the code I wrote plus a From condition ...

| :0
|   * ^From.*gerber
|   * ^Subject:(.*:)? *\/[^ :]+\<.*
|   {
|    SUBJECT=$MATCH
|    # use $HOME variable in case admins reorganize the system and move it
|    STORIES=$HOME/public-web/Stories
| 
| 
|    :0
|    * SUBJECT ?? /
|    SUBJECT=| echo "$SUBJECT" | tr / %
| 
| 
|    :0bc:
|    $STORIES/"$SUBJECT"
|   }

| The thing is that it creates a file with the subject name but it has the 
| Fwd: and it has spaces.  What I need is the fw or fwd removed and the 
| spaces turned into "_".  I am assuming that i would use the "s/\s/_/" but 
| not really sure about that nor do i know where to put it.

The spaces are still spaces because until now you didn't say anything about
them.  No problem: just add them to the tr parameters.  We'll convert tabs
to underscores as well.

As to the other thing, I was hoping that [^ :]+\< would force procmail to
mark the beginning of $MATCH in front of a word that was not closed with a
colon.  Unfortunately, then \< matches the colon.

So I'll give it another stab, keeping poohba's From condition.  All blanks
between brackets are tab+space:

 :0
   * ^From.*gerber
   * ^Subject:(.*:)?[    ]*\/[^  :]+([^-:a-z0-9].*|$)
   {
    SUBJECT=$MATCH
 
    :0
    * SUBJECT ?? [/      ]
    SUBJECT=| echo "$SUBJECT" | tr \\11/\\40 _%_
 
    # use $HOME variable in case admins reorganize the system and move it
    :0bc:
    $HOME/public-web/Stories/"$SUBJECT"
   }


_______________________________________________
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>