From owner-freebsd-questions Thu Jun 20 16: 0:35 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 6298937B410 for ; Thu, 20 Jun 2002 16:00:05 -0700 (PDT) Received: from hades.hell.gr (patr530-b140.otenet.gr [212.205.244.148]) by mailsrv.otenet.gr (8.12.3/8.12.3) with ESMTP id g5KN02MW024918; Fri, 21 Jun 2002 02:00:02 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.4/8.12.4) with ESMTP id g5KMxZLe000650; Fri, 21 Jun 2002 02:00:01 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.4/8.12.4/Submit) id g5KLVwIb008927; Fri, 21 Jun 2002 00:31:58 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 21 Jun 2002 00:31:58 +0300 From: Giorgos Keramidas To: "W. D." Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Master qmail alias for all hosted domains? Message-ID: <20020620213158.GC8735@hades.hell.gr> References: <5.1.0.14.2.20020620134312.04c22a50@us-webmasters.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20020620134312.04c22a50@us-webmasters.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-06-20 13:46 +0000, W. D. wrote: > Is there some way to set up an alias that forwards: > > webmaster@hosteddomain1.com > webmaster@hosteddomain2.com > postmaster@hosteddomain1.com > postmaster@hosteddomain2.com > . > . > . > etc. > > to > > webmaster@mymaindomain.com > > This would be for all domains on the box. > > Ideas? You could always use a script that reads named.conf and generates the alias list on stdout. Running this periodically from cron to update an alias in ~qmail-alias should be easy after you test it for a while. A quick and dirty hack that does something like this could be: $ cat makealias.sh grep '^zone' /etc/namedb/named.conf | \ awk '{print $2}' | \ sed -n -e 's/^"//' -e 's/"$//' -e '/^[[: alpha:]]/ s/^/\&root@/p' When run on my home machine, which is called hades.hell.gr (hell.gr being a fake, unregistered domain), and has a few test domains that I use for various funny purposes, prints: $ sh makealias.sh &root@hell.gr &root@example.gr &root@no.gr Redirecting the output to ~qmail-alias/.qmail-admins should be easy: $ cat updatealias.sh sh makealias.sh > ~qmail-alias/.qmail-admins - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message