old-www/HOWTO/VMailMgr-HOWTO-3.html

126 lines
6.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE> VMailMgr HOWTO: Setup</TITLE>
<LINK HREF="VMailMgr-HOWTO-2.html" REL=previous>
<LINK HREF="VMailMgr-HOWTO.html#toc3" REL=contents>
</HEAD>
<BODY>
Next
<A HREF="VMailMgr-HOWTO-2.html">Previous</A>
<A HREF="VMailMgr-HOWTO.html#toc3">Contents</A>
<HR>
<H2><A NAME="s3">3. Setup</A></H2>
<H2><A NAME="ss3.1">3.1 Setting Up a Virtual Domain</A>
</H2>
<P>The following steps are necessary to set up a virtual domain with vmailmgr
(assuming vmailmgr has been compiled and installed). As an example, we'll
set up a virtual user `<CODE>me@mydomain.org</CODE>`, with aliases of `<CODE>myself@mydomain.org</CODE>`
and `<CODE>myname@mydomain.org</CODE>`.
<OL>
<LI>Set up a DNS entry for the domain. I won't cover this here, as it is dependant
on far too many other things.
I will mention that to make IP based virtual domains work a PTR record which matches
an entry in virtualdomains is nessesary, for example, if nslookup 10.56.33.122 returns
<CODE>mail.mydomain.com</CODE>, `<CODE>virtualdomains</CODE>` needs an entry like `<CODE>mail.mydomain.com:myuser</CODE>`
<P>For the example, we'll assume that the mail exchanger for mydomain.org is already set up to point to your computer.
</LI>
<LI>Set up a base user for the domain. Create a user, with a name of your choosing.
Since the maildirs for all the users in the virtual domain will be stored under
this user's home directory, make sure you set the user up in a partition or disk
that is appropriate for such storage. The tools that you should use to accomplish
this step vary greatly between different systems. For our example, I'll add a user `<CODE>myuser</CODE>`.</LI>
<LI>Configure qmail to recognize the domain. To do this, you need to modify two of
qmail's configuration files in `<CODE>/var/qmail/control</CODE>` `<CODE>rcpthosts</CODE>` and `<CODE>virtualdomains</CODE>`.
<UL>
<LI>To `<CODE>rcpthosts</CODE>` :
add the line `<CODE>mydomain.org</CODE>`. </LI>
<LI>To `<CODE>virtualdomains</CODE>` :
add the line `<CODE>mydomain.org:myuser</CODE>`.</LI>
</UL>
If you wish to have mail to `<CODE>anything.mydomain.org</CODE>` be delivered in the same way, add the following
<UL>
<LI>To `<CODE>rcpthosts</CODE>` :
add the line `<CODE>.mydomain.org</CODE>`. </LI>
<LI>To `<CODE>virtualdomains</CODE>` :
add the line `<CODE>.mydomain.org:myuser</CODE>`.</LI>
</UL>
</LI>
<LI>Configure qmail-popup/qmail-pop3d to use `<CODE>checkvpw</CODE>` as the password checker. This step
is dependant on how you have installed qmail.
<UL>
<LI>Replace `<CODE>checkpassword</CODE>` in the command you use to invoke qmail-popup/qmail-pop3d
(either in `<CODE>/etc/inet.conf</CODE>` or in a `<CODE>tcpserver</CODE>` command) with `<CODE>checkvpw</CODE>`.</LI>
<LI>And/Or at the prompt type: `<CODE>echo checkvpw > /var/qmail/control/checkpassword</CODE>`</LI>
</UL>
</LI>
<LI>Add users or aliases to the domain. Either change user to the user you just created
(for example, type `<CODE>su - myuser</CODE>`) or log in (with either telnet or at the console) as
the new user, and use the included programs to add users and aliases.
<P>For our example, we would
<UL>
<LI>type: `<CODE>vadduser me</CODE>` (which prompts for a password)</LI>
<LI>type: `<CODE>vaddalias me myself</CODE>`</LI>
<LI>and type: `<CODE>vaddalias me myname</CODE>`</LI>
</UL>
</LI>
</OL>
After you have completed all these steps, you will need to kill and restart `<CODE>qmail-send</CODE>` to
make it read the new `<CODE>virtualdomains</CODE>` table.
<P>If you are using `<CODE>inetd</CODE>` to launch `<CODE>qmail-popup</CODE>`, `<CODE>kill -HUP</CODE>` the `<CODE>inetd</CODE>` process as well.
<H2><A NAME="ss3.2">3.2 Using one IP address for mutiple domains</A>
</H2>
<H3>Logging in as a virtual user?</H3>
<P>There are two ways to log in without using multiple IP addresses.
<P>
<OL>
<LI>The first way is to log in as `<CODE>userSEPvirtual.domain.org</CODE>`, where `<CODE>user</CODE>` is the mailbox name of the virtual user, SEP is one of `<CODE>@</CODE>` or
`<CODE>:</CODE>` (by default, this is configurable in the `<CODE>/etc/vmailmgr/</CODE>' directory), and `<CODE>virtual.domain.org</CODE>' is the virtual domain's name, as
listed in `<CODE>/var/qmail/control/virtualdomains</CODE>'. </LI>
<LI>The second way is to use the internal form of the mailbox name -- that is, `<CODE>baseuser-user</CODE>', where `<CODE>user</CODE>' is the same as above, and
`<CODE>baseuser</CODE>' is the username of the managing user. </LI>
</OL>
Example: `<CODE>/var/qmail/control/virtualdomains</CODE>' contains
<PRE>
testdomain.org:testuser
</PRE>
User `<CODE>myuser</CODE>' exists, and has set up a virtual mailbox with the name `<CODE>me</CODE>'. The `<CODE>separators</CODE>' variable in `<CODE>/etc/vmailmgr/</CODE>' contains
`<CODE>@:</CODE>'. This virtual user could log in as `<CODE>me@mydomain.com</CODE>', `<CODE>me:mydomain.cm</CODE>', or `<CODE>myuser-me</CODE>'.
<P>
<H2><A NAME="ss3.3">3.3 Catch all misdirected mail?</A>
</H2>
<P>In the `<CODE>vmailmgr/</CODE>' configuration directory, there is an entry called `<CODE>default-username</CODE>'. If mail to a virtual domain does not match any
users or aliases in that domain, it is delivered to the name listed in this configuration item if it exists (which defaults to `<CODE>+</CODE>'). To make this deliver
to you, simply type:
<PRE>
vaddalias me +
</PRE>
<H2><A NAME="ss3.4">3.4 Setup VMailMgr IMAP support?</A>
</H2>
<P>VMailMgr supports Courier-IMAP, but Courier-IMAP does not auto detect VMailMgr.
This means that some minor work is required for making the two work together.
<UL>
<LI>You must copy `<CODE>/usr/local/bin/authvmailmgr</CODE>` to
`<CODE>/usr/lib/courier-imap/libexec/authlib/authvmailmgr</CODE>`.</LI>
<LI>Then modify the `<CODE>AUTHMODULES</CODE>` statement in
`<CODE>/usr/lib/courier-imap/etc/imapd.config</CODE>` and add `<CODE>authvmailmgr</CODE>` as the first
authentication module. </LI>
</UL>
<HR>
Next
<A HREF="VMailMgr-HOWTO-2.html">Previous</A>
<A HREF="VMailMgr-HOWTO.html#toc3">Contents</A>
</BODY>
</HTML>