Virtual Site Creation - Email Message Issue

In the email template for a new site, I am using the $PREFIX variable to provide a link to the automatically created alias domain under my main domain, but the $PREFIX variable is not being inserted. Instead, it appears that the full domain name (i.e. the $DOMAIN) variable is being used.

In "System Settings > Server Templates > Default Settings > Virtual Server Creation" I have:

  • Automatically create alias domain = sites.novoops.com
  • Suffix for alias domain = First part of domain

Thus, when I create a domain such as iangoldstein.com it should (and does) create an alias for it called iangoldstein.sites.novoops.com. This works perfectly.

In the email template, I'm using "http://${PREFIX}.sites.novoops.com" and obviously I'm expecting to see "http://iangoldstein.sites.novoops.com" in the email for that domain. However, instead I am receiving "http://iangoldstein.com.sites.novoops.com".

Shouldn't the $PREFIX var be providing just the first part of the domain name as I'm expecting? Am I not understanding the $PREFIX var or is there another way to accomplish this?

Status: 
Closed (fixed)

Comments

I've attached a copy of the template in question (copied from /usr/local/etc/webmin/virtual-server/domain-template) in case you need to look at it. You'll find my use of the $PREFIX variable on line 50.

There is a better solution - if you want to get the name of the automatically created alias domain, use $AUTOALIAS instead. This will save you from having to use $PREFIX, which isn't always necessarily the first part of the domain name..

Thanks, I'll use that instead.

So when can we rely on $PREFIX to be the first part of the domain name, and when is it not?

$PREFIX is actually the text appended to mailbox usernames to make them unique. It will only be the first part of the domain name if no other virtual server is using that same prefix .. so if you host foo.com and foo.net, their prefixes would likely be foo and foo.net respectively.

That's interesting. The domain I setup for a test (iangoldstein.com) was the only such one on my system, so I would have expected $PREFIX to be set to "iangoldstein". It wasn't. It was "iangoldstein.com". I thought perhaps this may have been because I had created it, deleted it, re-created it, etc., but it's also true with a couple of other domains I recently setup. In the site creation email, the $PREFIX always seems to hold the full domain name. Odd.

No big deal, as the $AUTOALIAS is an even better solution.

When you add that $PLAN variable the email will be near perfect ;-) (Of course, I still need to put together a bunch of support docs I'm planning, reference them in that email, etc, etc.... )

Thanks.

The plan variable will be $PLAN_NAME

Automatically closed -- issue fixed for 2 weeks with no activity.