procmail
[Top] [All Lists]

Re: How do I avoid messages to be sent back to my email

1998-10-14 03:19:24
daniel wrote:

I posted earlier today a request for help with the subjet "Extract a string
of text from the body and asing it to a variable", Thank you very much
Christopher Lindsey, your solution worked !
Now,

Our support personel is just a group of 4 people, who answer by email.
Everybody should have a copy of all support requests and a copy of all the
answers. So what we do is when answering a support request, we senc cc to
support, so the group gets a copy of all the answers also. Something like
this list, that I receive a copy of my request also.

Now, my question:

1. I don't want the sender to receive a copy of his answer, so
if the To and the From are the same, the recipe should fail.
How do I do that ?
  I think that a better criterion is to check if the "From:"
address is the same as the receiver's email address (This
sound spicky, but is much easier to implement).  I'm assuming
that your domain is "adinet.com.uy".  DEFAULT is a pre-defined
variable where procmail stores the part of your email address
before the "@", i.e. "daniel" in your case.  Note that var
names are case-sensitive in procmail.

MYISP="adinet.com.uy"
:0
* ^From:(_dot_)*${DEFAULT}(_at_)${MYISP}
/dev/null

...or if you want to hard-code it...

0:
* ^From:(_dot_)*${DEFAULT}(_at_)adinet\(_dot_)com\(_dot_)uy
/dev/null

2. Can you give me an idea of how to write the 
condition(if the word emergency is somewhere in
the subject or body) and how to change the From ?

  If this happens most of the time, it's quicker-and-dirtier
to set up potential headers ahead of time, like so.

NEW_SUBJECT="Subject: blah blah blah"
NEW_FROM="From: whoever(_at_)wherever"
0BH:
* emergency
| formail -i "$NEW_SUBJECT" -i "$NEW_FROM"

  If it happens rarely, and setting up headers is an
uglier operation, checking for "emergency" first can
be "kinder and gentler" on the system's cpu.

0BH:
* emergency
{
 NEW_SUBJECT="Subject: blah blah blah"
 NEW_FROM="From: whoever(_at_)wherever"
 0:
 | formail -i "$NEW_SUBJECT" -i "$NEW_FROM"
}

  Note: "-i" (lowercase) re-names previously existing
fields to "Old-Subject:" and "Old-From:", etc, before
sticking in the new header.  "-I" (uppercase) overwrites
the previous header.  It's your decision whether you
want to track original headers.

 The "BH" flag combo instructs procmail to parse both
Body and Headers for any matches.

-- 
Walter Dnes <waltdnes(_at_)interlog(_dot_)com> procmail spamfilter
http://www.interlog.com/~waltdnes/spamdunk/spamdunk.htm
Why a fiscal conservative opposes Toronto 2008 OWE-lympics
http://www.interlog.com/~waltdnes/owe-lympics/owe-lympics.htm

<Prev in Thread] Current Thread [Next in Thread>