Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jun 2002 00:31:58 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        "W. D." <WD@US-Webmasters.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Master qmail alias for all hosted domains?
Message-ID:  <20020620213158.GC8735@hades.hell.gr>
In-Reply-To: <5.1.0.14.2.20020620134312.04c22a50@us-webmasters.com>
References:  <5.1.0.14.2.20020620134312.04c22a50@us-webmasters.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020620213158.GC8735>