sendmail question

Robert Meyer meyer_rm at yahoo.com
Mon Oct 22 16:52:28 EDT 2001


HMMM... This looks like a job for PROCMAIL!!  Do you think that I'd remember
the syntax for 'from' line filtering?!  NOOOO!!! Of course not!  :-)

It's a really easy thing to to. The next pile of drivel comes from me reading
the man pages for 'procmail' and 'procmailex' and trying to cobble something
together from the mish-mash my brain makes of things like this...

First, put the next line in your '.forward' file for the user that would
normally recieve the mail that you're trying to filter:
|IFS=' '&&p=/usr/bin/procmail&&test -f $p&&exec $p -Yf-||exit 75 #YOUR_USERNAME

Next, make a '.procmailrc' file that contains something like:
PATH=/bin:/usr/bin:/usr/bin
MAILDIR=$HOME/Mail      #you'd better make sure it exists
DEFAULT=$MAILDIR/mbox   #completely optional
LOGFILE=$MAILDIR/from   #recommended                                     
:0
* ^From.*wiseguy at adelphia.com
{
:0 c
   ! darin at nflug.org
}                                                                 

Now, if you're trying to do it on a global basis, there is a hack in the
procmail man page that tells how to hack it into the sendmail rules.  If you're
using 'qmail', then you're on your own on how to implement...

Hope this helps...

Cheers!

Bob


--- Darin Perusich <Darin.Perusich at cognigencorp.com> wrote:
> setting up an email alias is not going to work in this case. here's my
> example, i have 3+ users darin at nflug.org, slick at nflug.org, and
> wiseguy at adelphia.com. 
> 
> wiseguy at adelphia.com is sending email to slick at nflug.org, i want to
> intercept all email From: wiseguy at adelphia.com and push it over to
> darin at nflug.org.
> 
> aliases and virtuserstable will not work because they look at who the
> message it being delivered To: and map that name to the actual user,
> address, or alias.
> 
> Joe Bielli wrote:
> > 
> > Do what Dege says :) for basic forwarding all you need is aliases.
> > Here is another trick I've learned with sendmail.. if you want to use
> > virtusertable to map a non-existant name on a specific domain to a
> > distribution list or more than one recipient:
> > 
> > Create an entry in virtusertable:
> > 
> > dist at somedomain.com  distlist
> > 
> > Then, in /etc/aliases create the following:
> > 
> > distlist:      me at mydomain.com, user2, user3 at otherdomain.com
> > 
> > ...... The reason for this? Virtusertable will not allow more than one
> > recipient; you need to feed it an alias from the aliases file which will
> > handle it from there.
> > 
> > (ps. don't forget to do the makemap and newaliases)
> > 
> > Joe Bielli
> > Computer SOS, inc.
> > 1505 Cleveland Drive
> > Buffalo, NY 14225
> > P:// 716.635.0086
> > E:// jbielli at netsos.com
> > 
> > 
> > -----Original Message-----
> > From: owner-nflug at nflug.org [mailto:owner-nflug at nflug.org] On Behalf Of
> > Darin Perusich
> > Sent: Monday, October 22, 2001 10:07 AM
> > To: nflug at nflug.org
> > Subject: sendmail question
> > 
> > hello,
> > 
> > i have a sendmail question that i'm trying to solve and i keep getting
> > half way there but it never pans out. i want to send all incoming email
> > from user at domain.com and forward to mymailbox at mydomain.com. here's a few
> > things that i've look at.
> > 
> > 1. access database - access allows you to take
> >         From:user at domain.com    RELAY/REJECT/OK
> > 
> > 2. virtuserstable - maps nonexistant address or domains to real
> > addresses. doesn't appear to allow headed specific info, at least that
> > i've found yet.
> > 
> > these looked the most promising. has anyone ever done something list
> > this?
> > 
> > --
> > Darin Perusich
> > Unix Systems Administrator
> > Cognigen Corp.
> > darinper at cognigencorp.com
> 
> -- 
> Darin Perusich
> Unix Systems Administrator
> Cognigen Corp.
> darinper at cognigencorp.com


=====
Bob Meyer
Knightwing Communications, Inc.
36 Cayuga Blvd
Depew, NY 14043
Phone: 716-308-8931 or 716-681-0076
Meyer_RM at Yahoo.com

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



More information about the nflug mailing list