|
|
|
|
| Setting up Qmail virtualhosting with multiple recepiants |
|
Problem: This article describes how to set up a virtualhost with qmail to distribute mail for that domain to multiple user accounts.
|
|
Solution: 1. Add domain to /var/qmail/control/rcpthosts
2. Add domain:user-domainhandle to /var/qmail/control/virtualdomains, e.g.
"exampledomain.org:johndoe-example"
3. "su -" to the admin user for that domain, in this case "johndoe"
4. Create a ".qmail-default" file pointing to the default recepiant (see below)
5. Create a ".qmail-domainhandle-recepiant" file for each recepiant:
* ".qmail-example-johndoe" will control mail for "johndoe@exampledomain.org"
* ".qmail-example-janedoe" will control mail for "janedoe@exampledomain.org"
* ".qmail-example-john:doe" will control mail for "john.doe@exampledomain.org"
* ".qmail-example-default" will control all other mail for exampledomain.org.
Each file may contain one or more recepients for each .qmail file:
* "&john" will cause delivery to a local user called "john"
* "john" will cause delivery to a local user called "john" (i.e the leading ampersand is optional)
* "john@otherdomain.org" will cause delivery to a remote mail exchange
* "| /full/path/to/program" will cause execution of that program, which will receive the full email through STDIN
* "# comment" is a comment (no duh! ;-)
* "/full/path/to/Maildir/" will cause delivery to a locally stored mail DIRECTORY (The trailing slash is important)
* "/full/path/to/Mailbox" will cause delivery to a locally stored mailbox
Finally, reload qmail to activate changes:
/etc/rc.d/init.d/qmail reload
For more information about how to write proper .qmail files: "man dot-qmail"
|
|
|
|
|
|
This is free technical advice without any warranties.
Use at your own risk. Solutions offered may not apply to your particular problem at all.
Opinions and views expressed in the articles are the authors' personal
and may not necessarily reflect or coincide with those of Ano-Tech Computers.
We take no responsibility if anything bad happens from following any of
the intructions given. If you don't understand and accept this, please
contact us for personal assistance instead.
To read our full disclaimer, go
here.
We welcome anyone who is willing to contribute to this public knowledge base,
contact siteadmin@atc.no
if you have information you would like to share. The idea is not to replace
the commercial support sites, but to publish those hard-to-find
solutions you've found yourself looking for over and over again.
Show all articles