procmail
[Top] [All Lists]

Re: multiple action on delivered-main

2003-01-29 15:58:05
dman wrote:
:0fW
* ?(echo "$FROM" | $FGREP -i -f $HOME/.procmail/spam)
| /usr/bin/formail -I "Status: R"
[...]
By the way, fgrep will become confused if $FROM starts with a
hyphen.

No, it's not seen as a command line argument, but read from standard
input (unless FGREP is set to "xargs fgrep" :-)); no problem with
leading hyphens there.

What version of fgrep are you using?  Modern fgrep implies the `-f'
already -- unless I've misunderstood something about your syntax.

I think you have: he's not telling fgrep to look for the pattern $FROM
in the file $HOME/.procmail/spam, but the other way around (with the
same result): standard input (as provided by echo) is checked for all
patterns in the file (hence -f). Your method

      * ? $FGREP -qsix -e "$FROM" some/file

is more elegant, though. (And *there* you need the -e to deal with
leading hyphens.)

/HW

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