Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 1997 15:01:02 -0400 (EDT)
From:      Patrick McConnell <patrick@interlog.com>
To:        Jan A Knepper <Jan@jak.nl>
Cc:        freebsd-isp@FreeBSD.ORG
Subject:   Re: Two domains with UUCP e-mail
Message-ID:  <Pine.BSI.3.96.970711145913.618C-200000@patrick.interlog.com>
In-Reply-To: <33C6780A.323C0F7B@jak.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Jan,

I've attached a file I found in the FreeBSD mailing list archives. I found
it helpful in setting up mail for virtual hosts.

Patrick


On Fri, 11 Jul 1997, Jan A Knepper wrote:

> Hi,
> 
> 
> I've got the following problem:
> 
> Right now I have one machine running FreeBSD and serving as an e-mail
> gateway. The 'domainname' is 'jak.nl'.
> Everything works just fine. The systems dials to the provider evey hour,
> exchanges the e-mail and users are able to handle their e-mail on
> NT-workstations using Netscape Mail.
> 
> Now I have got a second domainname 'knp.nl'.
> I need to run the e-mail for this second domain at the same system as
> 'jak.nl'.
> 
> I have resolved it so far that a symbolic link is made as '/etc/uucp'
> are made before 'uucico' runs.
> Also the 'domainname' is changed.
> 
> The next step however is that I want to have a user 'john' on 'jak.nl'
> and a user 'john' at 'knp.nl'. These users will have to be different
> persons!
> Is there anyway to resolve this problem.
> 
> Is there a different (better) way to setup a system which serves more
> than one uucp e-mail domain?
> 
> Thanks
> Jan
> 
> 
> 
> 


-- 
Patrick McConnell (patrick@interlog.com)
Finger info: http://www.interlog.com/~patrick/finger

"640k ought to be enough for anybody."
			       -Bill Gates, 1981

[-- Attachment #2 --]
What you will need to do is first modify
sendmail.cf to deal with two 
databases in the /etc directory that will handle
the aliasing.

add these two lines to sendmail.cf

Kvirtualhosts btree /etc/virtualhosts.db
Kvirtualmasqs btree /etc/virtualmasqs.db

add this rule set for the return mail masq

S40
     
R$* < @ $* > $*         $@ $1 < @ $2 > $3      
already fully qualified
#bc instead of automatically using $M, lookup
masquerade in virtualmasqs
R$*                     $: $(virtualmasqs $1 $:
$1 @ $M $)
#bcR$*                  $: $1 @ $M             
add local qualification
R$* @                   $: $1 @ $j             
if $M not defined

add this rule set for the virtual hosts

S98 

################################
# sendmail for virtual domains #
################################

R$+ < @ $+  . >         $: $1 < @ $2 > .
R$+ < @ $+ > $*         $: $(virtualhosts $1@$2
$: $1 < @ $2 > $3 $)
R$+ < @ $+ > $*         $: $(virtualhosts $2 $:
$1 < @ $2 > $3 $)
R$+ < @ $* > .          $: $1 < @ $2 . >



for inbound mail:

create /etc/virtualhosts with your favorite text
editor, there can be 
as many lines as you want for each virtual host.

virtdomain.com                  john@mydomain.com
  (all mail goes to john)
sam@virtdomain.com              sam@mydomain.com
webmaster@virtdomain.com       
bob@other.domain.com (forward mail to 
                                                 
      third system)

create the database virtualhosts.db from
virtualhosts with the makemap 
command (makemap comes with sendmail)

makemap btree virtualhosts.db <virtualhosts

for outbound mail (they need an account on your
system)
create /etc/virtualmasqs (if you use PINE do this
in setup)

frank   frank@virtdomain.com
gloria  gloria@virtdomain.com
fred    fred@virtdomain.com

create the database virtualmasqs.db from
virtualmasqs with the makemap 
command

makemap btree virtualmasqs.db <virtualmasqs


****************************************
EACH TIME YOU ADD ANOTHER VIRTUAL DOMAIN
****************************************
(this is from part of the instructions I give
sysop's on our system)

5. Add Cw line in /etc/sendmail.cf

        Cw new.domain.com

6. Add alias to /etc/virtualhosts

        webmaster@new.domain.com       
        account@real.domain

        run command:

        makemap btree virtualhosts.db <
        virtualhosts

7. if they have an account on our machine and
want mail to look like it 
is coming from their domain.

        add alias to /etc/virtualmasqs

        username        anyname@new.domain.com

        run command:

        makemap btree virtualmasqs.db <
        virtualmasqs

8. restart sendmail

        get the pid with

        ps -aux | grep sendmail

        run command:

        kill -HUP sendmail.pid





******************************************************************************
  /\    Mark Mathis     Micro Access Technologies
   "Behind every successful
 /\/\   Mark@Mat.Net    PO Box 92224             
  cat is an obedient owner"
/\/\/\  202/529-5001    Washington, DC  20090
******************************************************************************


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.96.970711145913.618C-200000>