procmail
[Top] [All Lists]

re: need alternative for `fgrep --quiet'

2000-11-08 15:20:08
At 15:23 2000-11-08 -0500, Justin F. Kuo wrote:
>>I'm not too familiar with UNIX but believe fgrep, at my ISP, does not
>>allow the -quiet option. What may I use instead to make my recipe work?
>
>Uh, perhaps you could indicate why it is you need it - to abort the search
>early, or to suppress output somehow?

My reciepe (borrowed from Craig Johnston) searches the $FRIENDS file for people I always want to get mail from. If the mail is from one of them, then forward a copy to work.

   :0
   * ? (formail -x From: -x Sender: | fgrep -iqf $FRIENDS)
   {
     :0 c:
     ${DEFAULT}

     :0 fhw
     | cat - ; \
     echo "======= Forwarded Mail from kuo(_at_)world(_dot_)std(_dot_)com 
=========="

     :0 fhw
     | formail -A"X-Loop: kuo(_at_)world(_dot_)std(_dot_)com"

     :0
     !jkuo(_at_)meditech(_dot_)com
   }

I think the -q is supposed to suppress all normal output. Would this line work?

If you need it in this way, omission of it won't make a difference - fgrep is successful. This output isn't being sent to a file or into your message, or the log. -q would slightly improve performance if you were dealing with either a large friends file, or a large group of headers to match against. In your example, this is unlikely to be substantial.

For example, I use a recipe similar to the following:

#
:0:
* $? $FORMAIL -xFrom: | $FGREP -i -f $PMDIR/friends.dat
$MAILDIR/friends

I have absolutely no problems with this.

($FGREP points to the path for fgrep, $FORMAIL to formail, $PMDIR and $MAILDIR are directories to specific resources).

Your includsion of '-x Sender' shouldn't be a problem, just an additional header you're checking that I don't.

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395

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