On 01/05/2006 08:31 +0600, Kev wrote: >> >> On Wed, 4 Jan 2006 07:25:25 -0800 (PST) >> "Scott Taylor" <scott@xxxxxxxxxxxxxxx> wrote: >> >> > >> > Kev said: >> > > im seting up a scrip pipe for postfix + spamassassin as a filter in >> > > postfix. >> > > >> > > this really works how ever i have a prb with the FWD depending on the >> > > recipent, can any one help me with this line >> > > >> > > if $EGREP -q -i "To: *kav@xxxxxxxxxx*" < /var/tempfs/out.$$ >> > > >> > > how can i tell egrep to check for any format of To: in the email heder. >> > >> > You did. Perhaps something else in your query is blocking you, or maybe >> > you just want grep, it doesn't look like you are using "Extended Regex" >> > here. >> > >> > 'man grep' might be some more help to you. >> >> yeah i got it to work with the way i have put there, but the prb is that >> email addred comes as many formats like >> >> To: "Kev" <kev@xxxxxxxxxx> >> To: Kev <kev@xxxxxxxxxx> >> To: <kev@xxxxxxxxxx> >> To: <kev@xxxxxxxxxx> "Kev" >> >> etc etc.... so my above way dont work :( Something like: $EGREP -q -i '^To:.*<kav@xxxxxxxxxx>' should do the job - note the couple of differences: ^ to match only at beginning of line .* to match any number of any character other than newline between To: and the e-mail address enclosed in brackets One subtle (?) bug in your original is that it says, roughly, "match the literal string "To:" followed by zero or more space characters followed by the literal string "kav@xxxxxxxxx" followed by zero or more 't' characters. In other words, "To:kav@xxxxxxxxx" would match, as would "To: kav@xxxxxxxxxxxxxxxxxxxxxxxxxx"... tw -- +--------------------------+------------------------------+ | Tim Walberg | twalberg@xxxxxxxxxxxxxx | | 830 Carriage Dr. | www.mindspring.com/~twalberg | | Algonquin, IL 60102 | | +--------------------------+------------------------------+ - : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html