*BSD News Article 44055


Return to BSD News archive

Xref: sserve comp.mail.sendmail:17653 comp.os.386bsd.questions:17497
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!classic.iinet.com.au!news.uoknor.edu!news.ecn.uoknor.edu!paladin.american.edu!zombie.ncsc.mil!news.mathworks.com!hookup!news.Direct.CA!cynic.portal.ca!curt
From: curt@cynic.portal.ca (Curt Sampson)
Newsgroups: comp.mail.sendmail,comp.os.386bsd.questions
Subject: Re: Aliasing for multiple domains
Date: 14 May 1995 19:12:22 GMT
Organization: Internet Direct, Inc.
Lines: 73
Distribution: inet
Message-ID: <3p5kmm$keb@stud.Direct.CA>
References: <3or5op$cj2@news1.channel1.com> <ABD6DE58966855603@brad.his.com>
NNTP-Posting-Host: cynic.portal.ca

In article <ABD6DE58966855603@brad.his.com>, Brad Knowles <brad@his.com> wrote:
>In article <3or5op$cj2@news1.channel1.com>,
>mcgovern@mcgovern.channel1.com (Brian J. McGovern) wrote:
>
>> So, what I'd like to do is be able to keep these in an alias file and have
>> something like this work:
>> 
>> support@domain1.com: userx
>> support@domain2.com: usery
>> support@domain3.com: userz
>
>Basically, you're asking for non-local aliasing (the user in question
>doesn't externally appear to be local to your machine).  Folks have posted
>notes to comp.mail.sendmail recently about how this can be hacked together
>with current versions of sendmail V8 under certain circumstances...
>...
>If anyone has any more current information on this subject, I'd appreciate
>hearing about it (go ahead and post the info publicly, unless you've got
>reason to keep it private and want to continue to keep it private).

I found this pretty darn easy to add to my V8 sendmail configuration,
even though I'm a relative novice when it comes to sendmail. I just
create a separate alias file for each new domain I want; for example:

----- /etc/aliases.xyz
postmaster      postmaster
webmaster       webmaster
joe		joe
jim		jim
info            xyz-info
help         	xyz-help
-----

This then gets compiled into a hash file with the command:

	makemap hash /etc/aliases.xyz.db </etc/aliases.xyz

I add the database to my sendmail.cf:

    # maps for our client domains (incoming mail only)
    Kxyz hash -a. /etc/aliases.xyz

And in ruleset S98, which is the local part of ruleset 0 in the
more-or-less generic sendmail.cf that I have, we add rules to
check for the client domain and tranlsate the IDs in that domain
to IDs in our default mail domain:

----- from /etc/sendmail.cf
S98

# mail to our client domains has the name translated and then is
# delivered to our domain

R$*<@xyz.com.>$*     $:$(xyz $1 $)<@xyz.com.>$2
R$*.<@xyz.com.>$*    $:$1<@$m.>$2
R$*<@xyz.com.>$*     $#error $: "User unknown"
-----

I'm thinking that this might be a bit unweildy for faking a hundred
domains, though it does fine for just a few. I've not given much
thought as to how to do large numbers of fake domains.

If anyone has any thoughts on this method, especially potential
problems that could occur with it, I'd appreciate hearing about
them. If you post, I'd appreciate it if you could forward a copy
to me by e-mail as well, as I'm pretty busy and sometimes miss
news.

cjs
-- 
Curt Sampson    curt@portal.ca
Internet Portal Services, Ltd.     Beside the willow'd river bank
Vancouver, BC   (604) 257-9400     Repose I, still and thinking...