Interesting. Below reveals the fruits of my trials and tribulations
getting wildcards working to make all email to any wildcard act local.
I use the ".local" domain for my internal network. Since people like
to rename their machines and I want all machine coming to a central
place, I defined a wildcard MX record in DNS and set the following up
on the single internal mail server:
control/rcpthosts (wildcards are allowed)
localhost
local
.local
control/locals (wildcards are NOT allowed)
localhost
control/virtualdomains (wildcards are allowed)
local:alias-virtualdomains
.local:alias-virtualdomains
~alias/.qmail-virtualdomains-default
# Hack allowing virtualdomains using wildcards to act as if they were
# in locals. This is necessary because virtualdomains allows wildcards
# but locals does not. Forward the email to a local user regardless of
# the domain name to which it was originally sent for all virtualdomains
# that use this. --GPS
| forward "$DEFAULT"@localhost
Pretty simple all told, although not the most efficient.
Now for a few questions:
1) What happens to the foo.local domain if I have the following:
control/virtualdomains
local:alias-virtualdomains
foo.local:
.local:alias-virtualdomains
It would seem that this is an exclusion. Mail to foo.local never
gets through.
2) What happens if there is absolutely no colon (:) on a line in
virtualdomains? It doesn't seem to do anything.
3) Do people see any flaws in the following?
Wouldn't it be so nice if we could merge control/locals and
control/virtualdomains? In virtualdomains,
Any line without a colon would be local
Any line with a colon but a blank prepend would not accept mail
Any line with a colon and something in the prepend would act
just as virtualdomains does right now.
This could be improved further to be merged with control/rcpthosts.
control/locals would now not exist
control/rcpthost would now not exist
control/virtualdomains would be required to exist and a default
install would set it up only for localhost. qmail would not
start without it existing (even if it were blank)
On startup, qmail would read smtproutes and virtualdomains and
would only accept mail for these domains
Thanks for the insight.
Glenn Strauss
<[EMAIL PROTECTED]>