procmail
[Top] [All Lists]

Can't change the Subject:

2005-07-14 01:13:47
I'm trying to write a recipe to prepend a word to the SUBJECT: line.  
This ought to be simple but I can't get it to work.  I've scoured the 
web but most of the documentation is over my head, and what I did try 
didn't work.  Here's one method:

        :0
        * textToMatch
        | $FORMAIL  -I "Subject: SPAM - $SUBJECT"

After a bunch more recipes to catch junk, the final recipe is:

        :0:
        $HOME/Maildir/

When this fails here's what my logfile says:

        Subject: textToMatch
          Folder: -I Subject: SPAM -  textToMatch                               
    988
        Subject: SPAM -  textToMatch: Subject: SPAM -  textToMatch: No such 
file or directory

------------------------

I also tried this:

        TAG = ""

        :0
        * textToMatch
        { TAG = "SPAM" }

        MATCH       # kill this

        :0 fhw
        * !  TAG ?? ^^^^
        *   ^Subject: *\/[^ ].*
        | $FORMAIL -I "Subject: $TAG - ${MATCH:-<no subject>}"

When this fails my logfile says:

        procmail: Match on "^Subject: *\/[^ ].*"
        procmail: Executing " $FORMAIL -I "Subject: $TAG - ${MATCH:-<no 
subject>}""
        /bin/sh: -I: command not found

I've really tried to solve this myself but a couple of hours of reading 
and testing hasn't helped.  Thanks in advance for any help you can 
provide.


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