From owner-freebsd-questions Thu Aug 15 19:39:41 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA22766 for questions-outgoing; Thu, 15 Aug 1996 19:39:41 -0700 (PDT) Received: from cais.cais.com (cais.com [199.0.216.4]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id TAA22752 for ; Thu, 15 Aug 1996 19:39:37 -0700 (PDT) Received: from earth.mat.net (root@mat.net [205.252.122.1]) by cais.cais.com (8.6.10/8.6.5) with ESMTP id WAA05898; Thu, 15 Aug 1996 22:39:33 -0400 Received: from earth.mat.net (mark@earth.mat.net [205.252.122.1]) by earth.mat.net (8.6.12/8.6.12) with SMTP id WAA06332; Thu, 15 Aug 1996 22:39:31 -0400 Date: Thu, 15 Aug 1996 22:39:30 -0400 (EDT) From: Mark Mathis To: "Jun, Gyu-Chang" cc: questions@FreeBSD.ORG Subject: Re: Virtual mail hosting? In-Reply-To: <2.2.32.19960816012700.00ac31d8@ktnet.co.kr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Fri, 16 Aug 1996, Jun, Gyu-Chang wrote: > > Now, here is the question. Is it possible to set up virtual mail host? > I think if I set Cw record in sendmail.cf, aaa@www.aaa.com and > bbb@www.bbb.com can be handled. My point is that ONE FBSD box can accept > mail for webmaster@www.aaa.com and webmaster@www.bbb.com simutaneously.. > 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