From owner-freebsd-questions Fri Jan 3 06:06:01 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id GAA22702 for questions-outgoing; Fri, 3 Jan 1997 06:06:01 -0800 (PST) Received: from buffnet4.buffnet.net (root@buffnet4.buffnet.net [205.246.19.13]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id GAA22697 for ; Fri, 3 Jan 1997 06:05:57 -0800 (PST) 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 JAA22134 for ; Fri, 3 Jan 1997 09:07:52 -0500 Received: from buffnet11.buffnet.net by buffnet1.buffnet.net id aa10656; 3 Jan 97 9:06 EST Date: Fri, 3 Jan 1997 09:06:27 -0500 (EST) From: Steve To: freebsd-questions@freebsd.org Subject: Re: Virtual mail hosting? (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Please dont spam me for reposting this - I just keep seeing this question come up again and thought I would be helpful. ---------- 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