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