How to set-up virtual domain e-mail aliases

Problem:
You need
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, Virtual domain 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 users .qmail-default:

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 4 - Set the ownership and rights on .qmail-default to the user only:

	chown fred:fred /home/e-smith/files/users/fred/.qmail-default
	chmod 644 /home/e-smith/files/users/fred/.qmail-default
Step 5 - 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 6 - Save the file above and execute a console-save:

	/sbin/e-smith/signal-event console-save

This recreates the file var/qmail/control/virtualdomains with the above alias entries preceeding the domain entries.

Step 7 - Restart Qmail:

Issue the command "killall -HUP qmail-send" to restart qmail and re-read in the updated var/qmail/control/virtualdomains file.

	killall -HUP qmail-send
or
	/etc/rc.d/init.d/qmail.init restart

Step 8 - 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.