procmail
[Top] [All Lists]

Re: selective mail forwarding

2003-02-21 13:41:20
On Fri, Feb 21, 2003 at 08:45:07PM +0100, Henson Sturgill wrote:
wanted to see if you guys can think of a better way to do this.  i'm new 
to this, and wrote the script to:

1. forwarded any mails formatted with 'send to address(_at_)wherever' in the 
subject.  that is if the address is a valid e-mail address.

2. only forward addresses from aol users (it's embaressing to be one, they 
deserve a mail forwarding service!)

3. junk the mail after forwarding.  is it right that after you forward a 
mail it still romps through your other recipes?  i had to add the dev/null 
just to get rid of it.

any suggestions?

:0
* ^Subject: +send +to +\/[^ ]+
{
      :0
      * $MATCH ?? [A-Z0-9a-z]+(_at_)(_dot_)+\(_dot_)(net|com|edu|be)
      {
              :0fb
              * ^From: (_dot_)+(_at_)aol\(_dot_)com
              | mail $MATCH -s"forwarded mail"
      }

      :0a
      /dev/null
}

Try something like this (untested, of course).  You can put many
conditions in a procmail recipe and you can use the builtin '!' to
forward msgs.  Of course, your email condition won't catch emails from
accounts ending with .mil or .cc or etc, but that may be intentional.

:0
* ^Subject: +send +to +\/[^ ]+
* MATCH ?? [a-zA-Z0-9(_dot_)+=-](_at_)(_dot_)+\(_dot_)(net|com|edu|be)
* ^From:(_dot_)*(_at_)aol\(_dot_)com
! $MATCH

-- 
- Matt Dunford <> zoot(_at_)zotikos(_dot_)com ..
-. www.zotikos.com -- o,;-
        
Be great in act, as you have been in thought.
  -- William Shakespeare
--

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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