procmail
[Top] [All Lists]

Multiple recipients from a single account

1997-07-14 23:43:00
I'm administering a Unix box that is acting as a mail gateway for a
small company.  For historical reasons, all of the mail sent to this
company is sent to a single address, with the To headers intact.  In
other words, all mail sent to the company (x(_at_)foo(_dot_)com, 
y(_at_)foo(_dot_)com, and
z(_at_)foo(_dot_)com) will be sent to the same mailbox at our Internet provider.

The trick, of course, is to download the mail from this single POP
mailbox (which we do, using fetchmail) and then send it to the
appropriate recipients, such that mail with a "To" field of
"x(_at_)foo(_dot_)com" is passed along to user "x", "y(_at_)foo(_dot_)com" is 
passed to user
"y", and so forth.  Mail sent to an unknown user (unknown(_at_)foo(_dot_)com) is
sent to our secretary, who tries to figure out what to do with it.

The problem is this: In order to ensure delivery to multiple
recipients at our site (i.e., a message address to both x(_at_)foo(_dot_)com and
y(_at_)foo(_dot_)com), I used the "c" option in each user-matching recipe.  That
is, for each user on our system, we have the following recipes:

    :0 c:
    * ^(To|cc): *(_dot_)*reuven(_at_)foo(_dot_)com
    ! reuven

    :0 c:
    * ^(To|cc): *(_dot_)*stephen(_at_)foo(_dot_)com
    ! stephen

But because I use the "c" option, our secretary (whose address is set
as $DEFAULT) receives copies of *all* e-mail.  What I would like to do
is send mail to $DEFAULT only if none of the previous recipes matched.
But if more than one non-default recipe matches, then the mail should
be sent to each of those individuals.

I'm sure that there is a way to do this.  Any ideas?

Reuven

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