doc/FAQ.html
changeset 0 6f7a81934006
child 2 b3afb9f1e801
equal deleted inserted replaced
-1:000000000000 0:6f7a81934006
       
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
       
     2 <HTML>
       
     3 <HEAD>
       
     4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
       
     5  <TITLE>  VMailMgr FAQ</TITLE>
       
     6 
       
     7 
       
     8 </HEAD>
       
     9 <BODY>
       
    10 <H1>  VMailMgr FAQ</H1>
       
    11 
       
    12 <H2>Bruce Guenter 
       
    13 <A HREF="mailto:bruceg@em.ca">mailto:bruceg@em.ca</A>,
       
    14   Dan Kuykendall 
       
    15 <A HREF="mailto:dan@kuykendall.org">mailto:dan@kuykendall.org</A></H2>  v1.0, 23 April 2000
       
    16 <P><HR>
       
    17 <EM>  VMailMgr Frequently Asked Questions.</EM>
       
    18 <HR>
       
    19 <H2><A NAME="s1">1. Building and Installing</A></H2>
       
    20 
       
    21 <H2>1.1 What compiler and libraries do I need to build vmailmgr?</H2>
       
    22 
       
    23 <P>You will need a working C and C++ compiler and linker. You will not
       
    24 need any C++ libraries.  The package is being developed under Linux
       
    25 using egcs and glibc version 2, and may rely on some gcc/g++
       
    26 extensions.
       
    27 <H2>1.2 Does vmailmgr work with shadow passwords?</H2>
       
    28 
       
    29 <P>This package should work without changes both with and without
       
    30 shadow passwords as long as the shadow password libraries are
       
    31 present when this package is built. The `configure' script will
       
    32 detect what method of shadow passwords are being used and the
       
    33 programs will be built accordingly.
       
    34 <H2>1.3 Does vmailmgr support IMAP?</H2>
       
    35 
       
    36 <P>Yes, vmailmgr supports Courier-IMAP.  Some minor steps are needed to
       
    37 make them work, the steps are in the next section of this file.
       
    38 <H2><A NAME="s2">2. Setup and Configuration</A></H2>
       
    39 
       
    40 <H2>2.1 What other software is needed to run vmailmgr?</H2>
       
    41 
       
    42 <P>VMailMgr is based around qmail's handling of virtual users, and as
       
    43 such requires qmail for its operation. If you wish to use the `init'
       
    44 file to start/stop vmailmgrd or are installing the RPM package,
       
    45 supervise-scripts version 2.2 (or later, available at 
       
    46 <A HREF="http://em.ca/~bruceg/supervise-scripts/">http://em.ca/~bruceg/supervise-scripts/</A>) and daemontools 0.60
       
    47 (or later, available at 
       
    48 <A HREF="http://em.ca/~bruceg/rpms/daemontools/">http://em.ca/~bruceg/rpms/daemontools/</A>) packages are
       
    49 required.  If you need to use the <CODE>vmailmgrd</CODE> daemon, you
       
    50 will also need the <CODE>unixserver</CODE> program, from the ucspi-unix
       
    51 package, available at 
       
    52 <A HREF="http://em.ca/~bruceg/ucspi-unix/">http://em.ca/~bruceg/ucspi-unix/</A>.
       
    53 <P>If you want to use the autoresponse feature, I recommend the use of
       
    54 my own autoresponder program, <CODE>qmail-autoresponder</CODE> available
       
    55 at 
       
    56 <A HREF="http://em.ca/~bruceg/qmail-autoresponder/">http://em.ca/~bruceg/qmail-autoresponder/</A>.
       
    57 <H2>2.2 How do I record the output of vmailmgrd with syslog?</H2>
       
    58 
       
    59 <P>Output from vmailmgrd can be recorded by either splogger (part of
       
    60 qmail) or with the logger that comes with several flavours of
       
    61 UNIX. To use splogger, pipe the output of vmailmgrd into the command
       
    62 `splogger vmailmgrd'. This will timestamp each entry and tag them
       
    63 with the word `vmailmgrd'. By default, splogger logs to facility 2
       
    64 (mail). To use logger, pipe the output of vmailmgrd into the
       
    65 comamand `<CODE>logger -t vmailmgrd -p mail.notice</CODE>'. See the
       
    66 respective man pages of these two programs for more information.
       
    67 <P>Note: The use of syslog for logging messages is strongly discouraged
       
    68 due to problems with inefficent and buggy implementation of syslog.
       
    69 <H2>2.3 How do I record the output of vmailmgrd with multilog?</H2>
       
    70 
       
    71 <P>Make a directory into which the output will go, for example
       
    72 `<CODE>/var/log/vmailmgrd</CODE>'. Pipe the output of vmailmgrd into the
       
    73 command `<CODE>multilog t /var/log/vmailmgrd</CODE>'. See the
       
    74 documentation for multilog for more information on how to adjust its
       
    75 output.
       
    76 <H2>2.4 How do I setup VMmailMgr IMAP support?</H2>
       
    77 
       
    78 <P>VMailMgr supports Courier-IMAP, but Courier-IMAP does not auto
       
    79 detect VMailMgr.  This means that some minor work is required for
       
    80 making the two work together.
       
    81 <UL>
       
    82 <LI>You must copy `<CODE>/usr/local/bin/authvmailmgr</CODE>` to
       
    83 `<CODE>/usr/lib/courier-imap/libexec/authlib/authvmailmgr</CODE>`.</LI>
       
    84 <LI>Then modify the `<CODE>AUTHMODULES</CODE>` statement in
       
    85 `<CODE>/usr/lib/courier-imap/etc/imapd.config</CODE>` and add
       
    86 `<CODE>authvmailmgr</CODE>` as the first authentication module.</LI>
       
    87 </UL>
       
    88 <H2>2.5 Upgrading from Previous Versions</H2>
       
    89 
       
    90 <P>If you are upgrading from an older version, you may need to make
       
    91 some changes to your system before or after doing the upgrade. The
       
    92 following table outlines the necessary changes. Note that you need
       
    93 to follow the instructions for all later versions of the software.
       
    94 <P>If you are upgrading from version: 
       
    95 <DL>
       
    96 <DT><B>0.96.6 or earlier</B><DD><P>The `vmailmgrd' daemon needs to be run by unixserver, as opposed
       
    97 to being a stand-alone program previously.
       
    98 <DT><B>0.96.2 or earlier</B><DD><P>Make sure the `vmailmgrd' daemon and vmailmgr CGIs are disabled
       
    99 before upgrading, and upgrade them along with the main
       
   100 package. Changes were made to the daemon interface that will
       
   101 cause adding users and aliases to flake out. As well, the
       
   102 listdomain interface was completely redone.
       
   103 <P>
       
   104 <DT><B>0.94 or earlier, using the POP bulletin facility</B><DD><P>The POP bulletin facility has been moved into a stand-alone
       
   105 program that needs to be executed through `checkvpw-postsetuid'.
       
   106 <P>
       
   107 <DT><B>0.93 or earlier</B><DD><P>If you do not use the CGIs, you no longer need to run the
       
   108 `vmailmgrd' daemon.
       
   109 <P>
       
   110 <DT><B>0.92.2 or earlier</B><DD><P>The configuration changed from reading a single file to reading a
       
   111 set of files in a directory. Read the configuration documentation
       
   112 and run the program `vconf2dir'.
       
   113 <P>
       
   114 <DT><B>0.90.2 or earlier</B><DD><P>The name of the user to which mail to an unknown user is
       
   115 delivered changed from `*' to `+'. If you were using this
       
   116 feature, either change all your domains to accomodate this
       
   117 change, or set the `default-username' config file to contain `*'.
       
   118 <P>
       
   119 <DT><B>0.88 or earlier</B><DD><P>The file format of the virtual password tables has changed from
       
   120 plain text files to CDB tables. You will need to suspend local
       
   121 deliveries before upgrading, and run the program `vpasswd2cdb' as
       
   122 each base user after upgrading, before re-enabling local
       
   123 deliveries.
       
   124 </DL>
       
   125 <H2>2.6 How do I configure qmail+patches to use vmailmgr for POP?</H2>
       
   126 
       
   127 <P>Put the string `<CODE>checkvpw</CODE>' into the file
       
   128 `<CODE>/etc/qmail/control/checkpassword</CODE>' and restart pop3d by
       
   129 typing `<CODE>/etc/rc.d/init.d/pop3d restart</CODE>'.
       
   130 <H2>2.7 How do I allow clients to relay SMTP through me?</H2>
       
   131 
       
   132 <P>Download and install relay-ctrl from 
       
   133 <A HREF="http://em.ca/~bruceg/relay-ctrl/">http://em.ca/~bruceg/relay-ctrl/</A>.
       
   134 It works with vmailmgr, for both POP3 and IMAP clients.
       
   135 <H2><A NAME="s3">3. Usage</A></H2>
       
   136 
       
   137 <H2>3.1 I can only use one IP address. How do I log in as a virtual user?</H2>
       
   138 
       
   139 <P>There are two ways to log in without using multiple IP addresses.
       
   140 <P>The first way is to log in as `userSEPvirtual.domain.org', where
       
   141 `user' is the mailbox name of the virtual user, SEP is one of `@' or
       
   142 `:' (by default, this is configurable in the
       
   143 `<CODE>/etc/vmailmgr/</CODE>' directory), and
       
   144 `<CODE>virtual.domain.org</CODE>' is the virtual domain's name, as
       
   145 listed in `<CODE>/var/qmail/control/virtualdomains</CODE>'.
       
   146 <P>The second way is to use the internal form of the mailbox name --
       
   147 that is, `<CODE>baseuser-user</CODE>', where `<CODE>user</CODE>' is the same
       
   148 as above, and `<CODE>baseuser</CODE>' is the username of the managing
       
   149 user.
       
   150 <P>Example: `<CODE>/var/qmail/control/virtualdomains</CODE>' contains 
       
   151 <PRE>
       
   152   testdomain.org:testuser
       
   153 </PRE>
       
   154 
       
   155 User `<CODE>testuser</CODE>' exists, and has set up a virtual mailbox
       
   156 with the name `<CODE>v</CODE>'. The `<CODE>separators</CODE>' variable in
       
   157 `<CODE>/etc/vmailmgr/</CODE>' contains `<CODE>@:</CODE>'. This virtual user
       
   158 could log in as `<CODE>v@testdomain.org</CODE>',
       
   159 `<CODE>v:testdomain.org</CODE>', or `<CODE>testuser-v</CODE>'.
       
   160 <P>
       
   161 <P>
       
   162 <H2>3.2 How do I get all misdirected mail sent to me?</H2>
       
   163 
       
   164 <P>In the `<CODE>vmailmgr/</CODE>' configuration directory, there is an
       
   165 entry called `<CODE>default-username</CODE>'. If mail to a virtual
       
   166 domain does not match any users or aliases in that domain, it is
       
   167 delivered to the name listed in this configuration item if it exists
       
   168 (which defaults to `<CODE>+</CODE>'). To make this deliver to you,
       
   169 simply type:
       
   170 <PRE>
       
   171   vaddalias + me
       
   172 </PRE>
       
   173 <H2><A NAME="s4">4. Troubleshooting</A></H2>
       
   174 
       
   175 <H2>4.1 Bind error message from vmailmgrd.</H2>
       
   176 
       
   177 <P>If vmailmgrd reports `<CODE>vmailmgrd: bind: no such file or
       
   178 directory</CODE>' when you start it up, it means that can't create its
       
   179 socket file.  By default, it will try to create the socket file
       
   180 `<CODE>/tmp/.vmailmgrd</CODE>'. You must ensure that `<CODE>/tmp</CODE>' is
       
   181 writable, or that the socket is created in some other place by
       
   182 setting `<CODE>socket-file</CODE>' in the configuration.
       
   183 <H2>4.2 Error sending to an alias: qmail-queue exited with an error!</H2>
       
   184 
       
   185 <P>If qmail reports "deferral: vdeliver: qmail-queue exited with an
       
   186 error!", check where your qmail is installed.  On Debian systems,
       
   187 you will need to type "<CODE>ls -s /usr/sbin /var/qmail/bin</CODE>",
       
   188 since they've installed the qmail binaries into /usr/sbin.
       
   189 <H2>4.3 Running vmailmgrd fails.</H2>
       
   190 
       
   191 <P>When run by itself, vmailmgrd will report "<CODE>Timed out waiting for
       
   192 remote</CODE>".  vmailmgrd needs to be run from unixserver, part of
       
   193 the ucspi-unix package available at 
       
   194 <A HREF="http://em.ca/~bruceg/ucspi-unix/">http://em.ca/~bruceg/ucspi-unix/</A>.
       
   195 <H2>4.4 POP3 or IMAP logins take 30 seconds or longer.</H2>
       
   196 
       
   197 <P>This is almost certainly a DNS lookup problem.  Make sure that DNS
       
   198 lookups aren't timing out, that lookups on all your IP addresses
       
   199 aren't failing, and that you can lookup remote addresses as well.
       
   200 <P>If you are using 'tcpserver' for the head end to qmail-pop3d, then you
       
   201 may want to the following 2 switches to the command line: <CODE>-R</CODE>
       
   202 and <CODE>-H</CODE>.  The former prevents tcpserver from attempting to
       
   203 obtain TCPREMOTEINFO from the remote host.  This eliminates an "ident"
       
   204 lookup that may be being blocked or silently dropped by a firewall.
       
   205 The latter prevents tcpserver from doing a DNS lookup on the remote
       
   206 IP.
       
   207 <H2><A NAME="s5">5. Miscellaneous</A></H2>
       
   208 
       
   209 <H2>5.1 How do I get in contact with other users?</H2>
       
   210 
       
   211 <P>There is a mailing list run by the author. To subscribe, send an
       
   212 e-mail (content and subject line is ignored) to 
       
   213 <A HREF="mailto:vmailmgr-subscribe@lists.em.ca">mailto:vmailmgr-subscribe@lists.em.ca</A>.
       
   214 <P>Remember that if you have a problem that you want us to diagnose, we
       
   215 need to know the following important details:
       
   216 <OL>
       
   217 <LI>The output of `<CODE>qmail-showctl</CODE>` </LI>
       
   218 <LI>The contents of the vmailmgrd log for the attempt you are
       
   219 trying to diagnose</LI>
       
   220 <LI>The contents of the qmail and smtpd logs for a failed delivery
       
   221 attempt</LI>
       
   222 <LI>The contents of the pop3d logs for a failed login attempt</LI>
       
   223 <LI>The complete command line with which vmailmgrd and qmail-pop3d
       
   224 was invoked</LI>
       
   225 </OL>
       
   226 
       
   227 Please do not contact the author directly with vmailmgr questions. 
       
   228 <H2>5.2 Are development version of vmailmgr available anywhere?</H2>
       
   229 
       
   230 <P>Yes, they are available through anonymous CVS.
       
   231 To access the CVS server, set your <CODE>CVSROOT</CODE> to
       
   232 <CODE>:pserver:cvs@bruce-guenter.dyndns.org:/CVS</CODE>, log in with an
       
   233 empty password, and check out the <CODE>vmailmgr</CODE> module.
       
   234 <H2>5.3 How does incoming email get handled?</H2>
       
   235 
       
   236 <P>Incoming email is first received by the qmail SMTP daemon and
       
   237 inserted into the qmail queue. Then `<CODE>qmail-send</CODE>' examines
       
   238 the email envelope (which details the recipient address or
       
   239 addresses) to determine how to dispatch the message. It looks up the
       
   240 domain name of each recipient in
       
   241 `<CODE>/var/qmail/control/virtualdomains</CODE>', and prefixes the user
       
   242 name with the string that it finds. It then looks up the resulting
       
   243 user name in the system password table (or in
       
   244 `<CODE>/var/qmail/users/cdb</CODE>' if it exists) to find the base user
       
   245 name and home directory (which I will call `<CODE>$HOME</CODE>'). It
       
   246 then looks for the file `<CODE>$HOME/.qmail-VIRTUAL</CODE>'. If that's
       
   247 not found, it looks for the file `<CODE>$HOME/.qmail-default</CODE>',
       
   248 which will contain an instruction to pipe the message to
       
   249 `<CODE>vdeliver</CODE>'.
       
   250 <P>This is where vmailmgr first enters the picture. The virtual user
       
   251 name is sent to `vdeliver' through environment variables. It looks
       
   252 in the configuration files (in `<CODE>$HOME/.vmailmgr</CODE>' and then
       
   253 in `<CODE>/etc/vmailmgr</CODE>') to determine the location of the
       
   254 password table, and looks up the virtual user name in the table to
       
   255 determine delivery instructions. If the name is not found, the
       
   256 message is bounced and delivery ends. Otherwise, it then looks for
       
   257 the `<CODE>vdeliver-predeliver</CODE>' script in the configuration
       
   258 directories (in reverse order) and executes any that are found. It
       
   259 then delivers the message to all the listed destinations -- an
       
   260 optional mailbox directory and zero or more forwarding
       
   261 addresses. Finally, it looks for the `<CODE>vdeliver-postdeliver</CODE>'
       
   262 script and executes any that are found.
       
   263 <H2>5.4 How does outgoing email get handled?</H2>
       
   264 
       
   265 <P>Outgoing email is not handled by vmailmgr. For details on outgoing
       
   266 email handling, check the qmail documentation.
       
   267 <H2>5.5 What about security of CGI and PHP functions?</H2>
       
   268 
       
   269 <P>The socket used by the daemon is a UNIX-domain socket (as opposed to
       
   270 Internet-domain), meaning you need local access on the computer to
       
   271 open up a connection.  The path for this socket is run-time
       
   272 configurable.
       
   273 <P>The daemon forks a new connection for each connection, up to a
       
   274 configurable maximum (at which point it stops listening, IIRC, I
       
   275 should verify this).  The idea of threading has been completely
       
   276 discarded to avoid a bug in a command creeping in and makeing the
       
   277 whole server break.
       
   278 <P>The protocol spoken over the socket is explicitly bounded to at most
       
   279 64kB of data, and all data is prefixed by a size.  Static-sized
       
   280 buffers are only used with static-sized reads, and therefore can't be
       
   281 overflowed with stack-smashing tricks.
       
   282 <P>The daemon commands setuid to the appropriate user as soon as the base
       
   283 user has been verified, to avoid doing any more than necessary as
       
   284 root, as well as to avoid the possibility of tricking the daemon into
       
   285 reading a file another user wouldn't normally have access to.
       
   286 <P>To help avoid DoS on the local computer, a 1-second alarm is set as
       
   287 soon as the connection is received, and is only cleared once all the
       
   288 data has been read.  If it takes longer than 1 second to read the data
       
   289 from the socket, the server process exits.
       
   290 <H2>5.6 What are the differences between vmailmgr and vpopmail?</H2>
       
   291 
       
   292 <P>The primary difference between vmailmgr and vpopmail is the use of
       
   293 base users.  With vmailmgr there is one base user for each virtual
       
   294 domain.  With vpopmail, there is one base user for the entire
       
   295 virtual domain system.
       
   296 </BODY>
       
   297 </HTML>