All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Walberg <twalberg@mindspring.com>
To: Kev <savage-garden@hanikamail.com>
Cc: linux-admin@vger.kernel.org
Subject: Re: Re[2]: Scrip Help
Date: Wed, 4 Jan 2006 21:18:54 -0600	[thread overview]
Message-ID: <20060105031854.GB28860@mindspring.com> (raw)
In-Reply-To: <20060105082839.7C81.SAVAGE-GARDEN@hanikamail.com>

On 01/05/2006 08:31 +0600, Kev wrote:
>>	
>>	On Wed, 4 Jan 2006 07:25:25 -0800 (PST)
>>	"Scott Taylor" <scott@dctchambers.com> 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" <kev@domain.net>
>>	To: Kev <kev@domain.net>
>>	To: <kev@domain.net>
>>	To: <kev@domain.net> "Kev"
>>	
>>	etc etc.... so my above way dont work :(

Something like:

	$EGREP -q -i '^To:.*<kav@domain.net>'

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

  reply	other threads:[~2006-01-05  3:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-04  9:09 Scrip Help Kev
2006-01-04 15:25 ` Scott Taylor
2006-01-05  2:31   ` Re[2]: " Kev
2006-01-05  3:18     ` Tim Walberg [this message]
2006-01-05  4:27       ` Re[4]: " Kev
2006-01-05  9:20       ` Kev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060105031854.GB28860@mindspring.com \
    --to=twalberg@mindspring.com \
    --cc=linux-admin@vger.kernel.org \
    --cc=savage-garden@hanikamail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.