procmail
[Top] [All Lists]

Can't come up with the right recipe...

1996-11-26 09:36:40
I use procmail in combination with sendmail to direct our virtual user
account mail. That is, I direct all inbound mail for a given domain to a
single user account, and then use procmail within that account to redirect
the mail to individual user accounts. It looks something like this:

sendmail rule:

        R$*<@virtualdomain.com> $#local$:vdomain

Then, in the vdomain account is a .forward with:

        "|exec /usr/local/bin/procmail USER=vdomain"

whose .procmailrc has:

        VERBOSE=off
        MAILDIR=$HOME/Mail
        PMDIR=$HOME/.procmail
        INCLUDERC=$PMDIR/rc.filter

and rc.filter holds:

        :0 c
        * (^TO|^CC|^BCC)(_dot_)username(_at_)virtualdomain(_dot_)com
        ! username(_at_)pop2(_dot_)mailhost(_dot_)com

        :0
        {
                :0
                * (^TO|^CC|^BCC)(_dot_)username(_at_)virtualdomain(_dot_)com
                /dev/null
        }

Here's the problem. Some of our users subscribe to mailing lists whose To
field is something other than their name. I can see the actual recipient
usually in the first 'Received: from . . . for 
<username(_at_)virtualdomain(_dot_)com>
id . . . .' but I can't derive a rule that will operate within the above
parameters. Anyone have a rule out there which can solve this?

Secondly, the more I read the man page, the more I'm convinced that the
(^TO|^CC|^BCC) is redundant and should just be ^TO. Am I correct?

Thanks!


Bob Gahl Bicycle (Ryan Vanguard) Mobile ||     @
 ARPA/Internet: bgahl(_at_)thesphere(_dot_)com     ||  !_ \
 URL: http://www.thesphere.com/~bgahl/  ||  (*)-~--+--(*)
"If you're trying to be politically correct you're like a chameleon
 in front of a mirror. What can you say that won't be offensive to
 somebody?"                                        Robin Williams

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