procmail
[Top] [All Lists]

Re: Procmail recipes

1997-11-21 17:29:41
I don't have a web URL for you, but if you already have procmail
running, then this recipe should do it.

####################################################
:0
* ^TO_info(_at_)domain1(_dot_)com\>
        {  FORWARDTO="$FORWARDTO joe(_at_)domain1(_dot_)com"  }
:0
* ^TO_info(_at_)domain2(_dot_)com\>
        {  FORWARDTO="$FORWARDTO fred(_at_)domain2(_dot_)com"  }
:0 fw
* FORWARDTO ?? @
* ! X-Loop:.*\<your(_at_)address(_dot_)here\>
| formail -A"X-Loop: your(_at_)address(_dot_)here"
:0 a
! $FORWARDTO
####################################################

This sample recipe does the forwarding as you asked, and additionally
handles mail addressed to multiple recipients. If your version of
procmail is old and doesn't support the "^TO_" token, then replace it
with "^TO". Take care that the varname FORWARDTO is unique, or better
still, unset before this recipe is started and unset after this recipe
finishes. Be sure to preserve any double-quotes when using this recipe
as a template. If you have more than 20 or so addresses that could get
forwarded to simultaneously, then set the var LINEBUF to a higher
value than the default of 1024. When specifying the forward-to
addresses, don't use any 'real names', just bare addresses.  If the
username 'info' is a 'plus' address, then info+my-product(_at_)domain(_dot_)com
would need to be info\+my-product(_at_)domain(_dot_)com

David Hunt
ps. Read the following manpages:
procmail
procmailrc
procmailex
grep
egrep

On Fri, 21 Nov 1997, Jim Hribnak wrote:

Date: Fri, 21 Nov 1997 10:24:15 -0700 (MST)
From: Jim Hribnak <hribnak(_at_)nucleus(_dot_)com>
To: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Subject: Procmail recipes
Resent-Date: Fri, 21 Nov 1997 18:27:30 +0100 (MET)
Resent-From: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de


I am looking for a web site that has a list of recipes for procmail..

Particularily I am looking for a filter that will look for mail for a
certain address (ie info@<some domaion> and then forward that off to a
certain user


IE 

info(_at_)domain1(_dot_)com goes to joe(_at_)domain1(_dot_)com
info(_at_)domain2(_dot_)com foes to fred(_at_)domain2(_dot_)com
etc

Jim




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