procmail
[Top] [All Lists]

Multiple domains ... again

1996-07-11 13:28:09
Hello,

I just joined the list and I already have a question :)  Sorry, for the
long letter, I'm trying to include all the info I can.

I looked back through the archives and found references to people setting
up multiple domains.  The sendmail side I already have setup, but I'm
having a few problems on the procmail side.

Bob Ramstad <rramstad(_at_)nfic(_dot_)com> Mon, 11 Dec 1995 15:35:23 -0500 
(EST) writes:
first, in order to handle multiple recipients to the same domain
properly, i need to omit the F=m flag in my procmail mailer definition
in sendmail.cf.  this forces individual processing of addresses.

second, i couldn't figure out why ARGV wasn't getting passed to
procmail, as i wanted to pass and use the recipient and sender.  after
experimentation, it turns out that when using /etc/procmailrcs as the
path before the rcfile name, all ARGV appears to be thrown away by
procmail.

Basically, I have it setup so that all email to a domain (say foo.com) 
is sent to a single mail box.  However, from that email box I want to be
able to bounce it on to other accounts.  Here is what I've been using,
it mostly works:

#--.procmailrc-------------start--------------------------------------
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/mail      #you'd better make sure it exists
LOGFILE=$MAILDIR/from   #recommended

:0
* (^TOdragon|^Received:.*for <dragon@)
! dragon(_at_)cyberhighway(_dot_)net

:0
* (^TOwebadmin|^Received:.*for <webadmin@)
! someone(_at_)cyberhighway(_dot_)net
#---------------------------end---------------------------------------

I added the "Received" part because the "^TO" didn't seem to catch messages
coming in from mailing lists.

The problem is that when I mail to 
"dragon(_at_)foo(_dot_)com,someone(_at_)foo(_dot_)com" only
"dragon" gets the message.  The first part of Ramstad's message indicates
omitting F=m in the sendmail.cf, that didn't seem to help me.

Here are relevant parts of sendmail.cf (sendmail 8.7.3)
#--sendmail.cf-------------start--------------------------------------
Mlocal,     P=/usr/local/bin/procmail, F=lsDFMAw5:/|@SPfhn, S=10/30, R=20/40,
            T=DNS/RFC822/X-Unix,
            A=procmail -Y -a $h -d $u
#####  @(#)procmail.m4  8.4 (Berkeley) 4/23/95  #####

Mprocmail,  P=/usr/local/bin/procmail, F=DFMmShu, S=11/31, R=21/31, 
T=DNS/RFC822/X-Unix,
            A=procmail -m $h $f $u
#---------------------------end---------------------------------------

I tried changing the "F=DFMmShu" to "F=DFMShu" and it didn't matter.  Also,
by doing it this way what kind of performance loss am I going to face?  I
currently have 8600+ accounts and it is growing fast.

I have come up with a partial fix, but now they are receiving multiple
copies, and I'm sure there are holes in it.

Here is what I'm trying now:
#--.procmailrc-------------start--------------------------------------
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/mail      #you'd better make sure it exists
LOGFILE=$MAILDIR/from   #recommended
#VERBOSE=true
#FILE="$0"                       # These 3 variables DON'T work.
#SENDER="$1"                     # Get envelope sender from sendmail
#RECIPIENT="$2"                  # Get envelope recipient from sendmail
                                 # Put them in an extra header...
MATCH=false

ADDR=dragon     DEST=dragon(_at_)cyberhighway(_dot_)net    INCLUDERC=sendit.rc
ADDR=webadmin   DEST=someone(_at_)cyberhighway(_dot_)net   INCLUDERC=sendit.rc
# ...

:0
* MATCH ?? false
/usr/mail/foo_default

:0
* MATCH ?? true
/dev/null
#---------------------------end---------------------------------------

#--sendit.rc---------------start--------------------------------------
TOHDR="(^TO$ADDR|^Received:.*for <$ADDR@)"

:0 c
* $ $TOHDR
! $DEST

:0 a
{ MATCH=true }
#---------------------------end---------------------------------------

Last question is the logfile only logs the final default output.  Is there
a way to have it log each time it remails a message in the sendit.rc script?

So can it be saved?  :)

Dan Thibadeau

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