Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Anonymous on May 13, 2004, 09:05:46 PM

Title: Virtual domains
Post by: Anonymous on May 13, 2004, 09:05:46 PM
First I want to say thank you to all the people who have contributed and
developed this software, excellent job!

When I set up a virtual domain the users can log in using only their
username and not with their username@domain.com, is this the correct
way? What happens when two users have the same name but in different
domains? I have seen a couple of contribs that I think is what I am
looking for but am not sure.

Also, is there a way to setup an ldap server for the virtual domains?
When I added a user in the server manager it added them into my primary
domain but I wanted them to be in the virtual domain. I installed
phpldapadmin and was able to change their email address to the correct
domain. Is there and easier way to manage this? Am I missing the
obvious?

Thanks for any help,

Jon
Title: Virtual Domain (Dungog.net)
Post by: excalibur on July 07, 2004, 04:36:03 PM
Hi Jon,

No you are not missing the obvious. I have been using 5.6 for 1.½ years and now 6.0. I have all this time wanted a way to seperate my users into their respective domains. Eventually I found the http://www.dungog.net release dungog-vdomain*. This did NOT seperate my users into ONLY their seperate domains. So I am not sure the package worked as intended.

Still looking for this Virtual domain package that can do this on SME 6.0.

Thanks

Morten
Title: Virtual domains
Post by: raem on July 07, 2004, 04:55:05 PM
See this HOWTO based on Darrell Mays HOWTO which I believe was based on work by Gordon Rowell & Charlie Brady.

Virtual domain email aliases HOWTO

Release applicable: sme server v6.0, 6.0.1
Author: Ray Mitchell mitchellcpa_AT_yahoo.com.au
Original author: Darrell May
Contributor: Gordon Rowell
Revision date: June 3, 2004 v1

Problem:
You need to set-up virtual e-mail domains that support for example info@domain1.com and forward this e-mail to the appropriate recipient. For our example will send info@domain1.com to the user fred.

Step 1- Virtual Domain Set-up:

Use the e-smith-manager, Configuration/Domains panel to set-up the virtual domain, domain1.com. Instructions are found in the user manual.

Step 2 - Create your user:
Use the e-smith-manager, User accounts panel to set-up the user fred. Instructions are found in the user manual.

Step 3 - Create a templates-custom fragment:
   mkdir -p /etc/e-smith/templates-custom/var/qmail/control/virtualdomains
   pico /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/90aliases
In this 90aliases file enter all your virtual aliases in the form alias:username. In the example below info@domain1.com is to go to user fred.
   info@domain1.com:fred
If you want all domain mail going into one account, enter your virtual alias in the form domain:username. In the example below domain1.com:fred sends all @domain1.com mail to user fred.
   domain1.com:fred
If you want all domain mail going into one account, except for defined users, enter your virtual aliases in the form shown below. In the example below domain1.com:fred sends all @domain1.com mail to user fred except for jim and bob who get their mail directly..
   domain1.com:fred
   jim@domain1.com:jim
   bob@domain1.com:bob

Step 4 - Save the file above and execute a email-update:
   /sbin/e-smith/signal-event email-update
This recreates the file var/qmail/control/virtualdomains with the above alias entries preceeding the domain entries and restarts qmail.

Step 5 - Test the above virtual aliases:
Send an e-mail to info@domain1.com to test that it is received by the qmail server without error and reach the intended recipient (fred) mailbox.


Should readers of this HOWTO wish to configure email aliases on earlier versions of sme server, they need to do the following steps as well (in the correct sequence) or alternatively refer to earlier versions of this HOWTO by Darrell May

Step 2a - Create users .qmail-default: (not required in v6.0 sme server)
In the users home directory, /home/e-smith/files/users/fred create a file named .qmail-default containing only one line, the users name, fred.
   pico /home/e-smith/files/users/fred/.qmail-default
   - add the one word fred
   - save the file

Step 2b - Set the ownership and rights on .qmail-default to the user only: (not required in v6.0 sme server)
   chown fred:fred /home/e-smith/files/users/fred/.qmail-default
   chmod 644 /home/e-smith/files/users/fred/.qmail-default
Title: Minor add to
Post by: d6hq2 on July 08, 2004, 01:00:53 AM
It is also possible to do this without setting up a virtual domain in server manager

You need to do as stated but instead of adding a virtual domain in server manager simply add the domain to a rcpthosts fragment,a virtualdomains fragment and in some instances a mailrules.default fragment all in /etc/e-smith/templates-custom/var/qmail/control

we use 20addons as the fragement in all cases

in rcpthosts/20addons you simply declare mydomain.com

in virtualdomains/20addons you declare either

user@mydomain.com:esmithuser1
user2@mydomain.com:esmithuser2
and/or
mydomain.com:esmithuser3 - a catchall

mailrules.default comes from a contrib (can't recall what its called or where from) that bounces unknown addresses - if you have it then the requirements are another fragment containing

k*:@mydomain.com - to accept anything
OR
k*:user@mydomain.com - to accept mail for that user with
d*:*@mydomain.com - to deny everything else

the order is important

The above makes it possible to have info@domain1.com & info@domain2.com without entering either domain in server manager

Hope that makes sense
Title: Virtual domains
Post by: d6hq2 on July 08, 2004, 01:20:55 AM
Should have added why this is a good way of doing it.

Reason is if you add the virtaul domain via server-manager then every existing user is potentially a valid address at your new domain. If you don't intend providing any web services via the new domain and want to separate it for email only then the rcpthosts method is better. If coupled with domain based addressing contrib - again I can't remember its name or where from - you can develop a very flexible system. Bear in mind that any user you create will ahve a valid email address(es) at your primary domain unless you explicitly deny it.

Checked and found that
mailrules.default comes from e-smith-mailfront rpm
domain based addressing comes from e-smith-domain_mail_user rpm
Title: Virtual domains
Post by: d6hq2 on July 08, 2004, 01:23:11 AM
Should have added why this is a good way of doing it.

Reason is if you add the virtaul domain via server-manager then every existing user is potentially a valid address at your new domain. If you don't intend providing any web services via the new domain and want to separate it for email only then the rcpthosts method is better. If coupled with domain based addressing contrib - again I can't remember its name or where from - you can develop a very flexible system. Bear in mind that any user you create will ahve a valid email address(es) at your primary domain unless you explicitly deny it.

Checked and found that
mailrules.default comes from e-smith-mailfront rpm
domain based addressing comes from e-smith-domain_mail_user rpm