From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Walberg Subject: Re: Re[2]: Scrip Help Date: Wed, 4 Jan 2006 21:18:54 -0600 Message-ID: <20060105031854.GB28860@mindspring.com> References: <20060104150346.A2B2.SAVAGE-GARDEN@hanikamail.com> <2705.192.168.99.70.1136388325.squirrel@192.168.99.70> <20060105082839.7C81.SAVAGE-GARDEN@hanikamail.com> Reply-To: Tim Walberg Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20060105082839.7C81.SAVAGE-GARDEN@hanikamail.com> Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Kev Cc: linux-admin@vger.kernel.org On 01/05/2006 08:31 +0600, Kev wrote: >> >> On Wed, 4 Jan 2006 07:25:25 -0800 (PST) >> "Scott Taylor" 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@domain.net*" < /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" >> To: Kev >> To: >> To: "Kev" >> >> etc etc.... so my above way dont work :( Something like: $EGREP -q -i '^To:.*' 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@domain.ne" followed by zero or more 't' characters. In other words, "To:kav@domain.ne" would match, as would "To: kav@domain.nettttttttttttttttt"... tw -- +--------------------------+------------------------------+ | Tim Walberg | twalberg@mindspring.com | | 830 Carriage Dr. | www.mindspring.com/~twalberg | | Algonquin, IL 60102 | | +--------------------------+------------------------------+