procmail
[Top] [All Lists]

script works in shell, but not procmail

2006-10-05 16:33:04
I tested this recipe from a command line, and the relevant bit worked. 
I put it into a recipe and it stops working.  The line that doesn't work 
is the last condition.

    :0:
    * ^X-Original-To:["$WS"]*\/.*
    * $! ? grep -i -x $MATCH $RCPT_WHITELIST
    * $? formail -zxSubject: |\
       grep -i \"`sed '/^[     ]*$/d' subj_blacklist_ryb`\" -
    $SUBJECTJUNK

If you take the last condition (both lines of it) and remove the \" 
surrounding the sed statement and replace them with ", it works in sh. 
Formail tosses up the contents of the Subject header, and gives it to 
grep which uses all the strings that sed churns out (taking - for 
stdin).  These strings from sed can be regular expressions.  Sed is 
there to remove blank lines from the file (just in case).

When you put it through procmail (as above), this is what happens in the 
log:

procmail: Assigning "MATCH="
procmail: Matched " 12345(_at_)mydomain(_dot_)tld"
procmail: Match on "^X-Original-To:["$WS"]*\/.*"
procmail: Executing 
"grep,-i,-x,12345(_at_)mydomain(_dot_)tld,/home/user/.procmail/rcpt_whitelist_ryb"
procmail: Non-zero exitcode (1) from "grep"
procmail: Match on ! "grep -i -x 12345(_at_)mydomain(_dot_)tld 
/home/user/.procmail/rcpt_whitelist_ryb"
procmail: Executing "sed '/^[   ]*$/d' subj_blacklist_ryb"
sed: subj_blacklist_ryb: No such file or directory
procmail: Executing " formail -zxSubject: |grep -i "" -"
procmail: Match on " formail -zxSubject: |grep -i "" -"
procmail: Locking "junk_subject.lock"

It seems to be running the sed command first rather than the entire 
command.

Many thanks,
Steve :)

____________________________________________________________
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>
  • script works in shell, but not procmail, Steve A <=