procmail
[Top] [All Lists]

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

2000-10-06 10:29:52
Poobz is puzzled.

I offered this code,

| >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"
| >    }

| This creates the file msg.blahblahblah  not "$SUBJECT"

Is tr in your .procmailrc's $PATH?  It seems to be producing null output,
leaving $SUBJECT null.

Either call tr by its full absolute path, adjust $PATH to include the
directory where tr lives, or use sed instead of tr:

     SUBJECT=| echo "$SUBJECT" | sed -e 's/[    ]/_/g' -e 's-/-%-g'

where the brackets enclose space and tab.

Another possibility is that your tr doesn't like the syntax I used; this
might work with it (the apostrophes enclose tab, slash, space):

     SUBJECT=| echo "$SUBJECT" | tr '   / ' _%_


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