procmail
[Top] [All Lists]

Re: How to enable reply to selective addresses

1999-12-06 20:18:23
On Mon, 06 Dec 1999 18:19:45 -0800, Prasad Narasimha
<prasad_narasimha(_at_)hotmail(_dot_)com> wrote:

I have a requirement wherein all mails coming from my local
domain i.e. internal mails not processed but only those mails
coming from 'outside' of my Organsation be forwarded to a
specific address, say my hotmail address.
  That sentence is a bit confusing.  I'll assume that you meant
to say "internal mails (are) not (to be) processed but only those
mails coming from 'outside' of my Organsation (are to) be forwarded
to a specific address".  I'm not complaining about your English.  I
congratulate you for making the effort to learn another language.

I guess I should look for From address in my incoming mails and
extract domain name portion. Here again, some of the internal
mails sent out from few unix machines don't include domain names
in From addresses.
  And you also want emails, without a domain name in the "From:"
header, to be forwarded to you. I'll pretend that your internal
domain is "narasimha.org" in this example.  Replace it with your
actual domain name.  Here is a simple recipe using "scoring"...

 :0
 *  1^0 ^From:(_dot_)*(_at_)narasimha\(_dot_)org
 *  1^0 ! ^From:.*@
 * -2^0 ^From.*[<][>]
 ! prasad_narasimha(_at_)hotmail(_dot_)com

  In ordinary procmail comparisons, multiple tests are logical
"AND" tests.  I.e. both conditions would have to be true to work.
You want "OR" tests, where one or both conditions can trigger the
relay.  In procmail scoring, the counter starts at zero.  If the
counter is positive at the end of the recipe, the action line is
executed.
  1) The first test adds 1 to the counter if your domain is in
     the "From:" header.
  2) The second test adds 1 to the counter if there is no "@"
     in the "From:" header.
  3) The third test subtracts 2 from the counter if a null
     address is found, e.g. in bounces.  I don't think you
     want bounces going to your Hotmail account.

-- 
Walter Dnes <waltdnes(_at_)waltdnes(_dot_)org>

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