From owner-freebsd-questions Fri Oct 25 15:25:31 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA25904 for questions-outgoing; Fri, 25 Oct 1996 15:25:31 -0700 (PDT) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id PAA25872 for ; Fri, 25 Oct 1996 15:25:25 -0700 (PDT) Received: from buffnet4.buffnet.net (root@buffnet4.buffnet.net [205.246.19.13]) by who.cdrom.com (8.7.5/8.6.11) with SMTP id NAA17070 for ; Fri, 25 Oct 1996 13:40:36 -0700 (PDT) Received: from buffnet1.buffnet.net (mmdf@buffnet1.buffnet.net [205.246.19.10]) by buffnet4.buffnet.net (8.6.12/8.6.9) with SMTP id PAA26920 for ; Fri, 25 Oct 1996 15:42:40 GMT Received: from buffnet11.buffnet.net by buffnet1.buffnet.net id aa27006; 25 Oct 96 16:47 EDT Date: Fri, 25 Oct 1996 16:47:43 -0400 (EDT) From: Steve To: freebsd-questions@FreeBSD.ORG Subject: virtual domains for email. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk I keep seeing this question posted - below is a post I saved that explains how to do virtual email domains ---------- Forwarded message ---------- 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? 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