debian/rules: Use `git' potty wrapper.
[qmail] / FAQ
CommitLineData
2117e02e
MW
11. Controlling the appearance of outgoing messages
21.1. How do I set up host masquerading?
31.2. How do I set up user masquerading?
212b6f5d 41.3. How do I set up Mail-Followup-To automatically?
2117e02e
MW
5
62. Routing outgoing messages
72.1. How do I send local messages to another host?
82.2. How do I set up a null client?
92.3. How do I send outgoing mail through UUCP?
102.4. How do I set up a separate queue for a SLIP/PPP link?
112.5. How do I deal with ``CNAME lookup failed temporarily''?
12
133. Routing incoming messages by host
143.1. How do I receive mail for another host name?
153.2. How do I set up a virtual domain?
163.3. How do I set up several virtual domains for one user?
17
184. Routing incoming messages by user
194.1. How do I forward unrecognized usernames to another host?
204.2. How do I set up a mailing list?
214.3. How do I use majordomo with qmail?
224.4. How do I use procmail with qmail?
234.5. How do I use elm's filter with qmail?
244.6. How do I create aliases with dots?
212b6f5d
MW
254.7. How do I use sendmail's .forward files with qmail?
264.8. How do I use sendmail's /etc/aliases with qmail?
274.9. How do I make qmail defer messages during NFS or NIS outages?
284.10. How do I change which account controls an address?
2117e02e
MW
29
305. Setting up servers
315.1. How do I run qmail-smtpd under tcpserver?
325.2. How do I set up qmail-qmtpd?
335.3. How do I set up qmail-pop3d?
345.4. How do I allow selected clients to use this host as a relay?
355.5. How do I fix up messages from broken SMTP clients?
212b6f5d 365.6. How do I set up qmail-qmqpd?
2117e02e
MW
37
386. Configuring MUAs to work with qmail
396.1. How do I make BSD mail generate a Date with the local time zone?
212b6f5d 406.2. How do I make pine work with qmail?
2117e02e
MW
416.3. How do I make MH work with qmail?
426.4. How do I stop Sun's dtcm from hanging?
43
447. Managing the mail system
457.1. How do I safely stop qmail-send?
467.2. How do I manually run the queue?
477.3. How do I rejuvenate a message?
487.4. How do I organize a big network?
497.5. How do I back up and restore the queue disk?
212b6f5d
MW
507.6. How do I run a supervised copy of qmail?
517.7. How do I avoid syslog?
2117e02e
MW
52
538. Miscellany
548.1. How do I tell qmail to do more deliveries at once?
558.2. How do I keep a copy of all incoming and outgoing mail messages?
568.3. How do I switch slowly from sendmail to qmail?
57
58
59
601. Controlling the appearance of outgoing messages
61
62
631.1. How do I set up host masquerading? All the users on this host,
64zippy.af.mil, are users on af.mil. When joe sends a message to fred, the
65message should say ``From: joe@af.mil'' and ``To: fred@af.mil'', without
66``zippy'' anywhere.
67
68Answer: echo af.mil > /var/qmail/control/defaulthost; chmod 644
69/var/qmail/control/defaulthost.
70
71
721.2. How do I set up user masquerading? I'd like my own From lines to
73show boss@af.mil rather than god@heaven.af.mil.
74
75Answer: Add MAILHOST=af.mil and MAILUSER=boss to your environment. To
76override From lines supplied by your MUA, add QMAILINJECT=f to your
77environment.
78
79
212b6f5d
MW
801.3. How do I set up Mail-Followup-To automatically? When I send a
81message to the sos@heaven.af.mil mailing list, I'd like to include
82``Mail-Followup-To: sos@heaven.af.mil''.
83
84Answer: Add QMAILMFTFILE=$HOME/.lists to your environment, and put
85sos@heaven.af.mil into ~/.lists.
86
87
2117e02e
MW
88
892. Routing outgoing messages
90
91
922.1. How do I send local messages to another host? All the mail for
93af.mil should be delivered to our disk server, pokey.af.mil. I've set up
94an MX from af.mil to pokey.af.mil, but when a user on the af.mil host
95sends a message to boss@af.mil, af.mil tries to deliver it locally. How
96do I stop that?
97
98Answer: Remove af.mil from /var/qmail/control/locals. If qmail-send is
99running, give it a HUP. Make sure the MX is set up properly before you
100do this. Also make sure that pokey can receive mail for af.mil---see
101question 3.1.
102
103
1042.2. How do I set up a null client? I'd like zippy.af.mil to
105send all mail to bigbang.af.mil.
106
107Answer: echo :bigbang.af.mil > /var/qmail/control/smtproutes;
108chmod 644 /var/qmail/control/smtproutes. Disable local delivery as in
109question 2.1. Turn off qmail-smtpd in /etc/inetd.conf.
110
111
1122.3. How do I send outgoing mail through UUCP? I need qmail to send all
113outgoing mail via UUCP to my upstream UUCP site, gonzo.
114
115Answer: Put
116
117 :alias-uucp
118
119into control/virtualdomains and
120
212b6f5d
MW
121 |preline -df /usr/bin/uux - -r -gC
122 -a"${SENDER:-MAILER-DAEMON}" gonzo!rmail "($DEFAULT@$HOST)"
2117e02e 123
212b6f5d
MW
124(all on one line) into ~alias/.qmail-uucp-default. (For some UUCP
125software you will need to use -d instead of -df.) If qmail-send is
2117e02e
MW
126running, give it a HUP.
127
128
1292.4. How do I set up a separate queue for a SLIP/PPP link?
130
131Answer: Use serialmail (http://pobox.com/~djb/serialmail.html).
132
133
1342.5. How do I deal with ``CNAME lookup failed temporarily''? The log
135showed that a message was deferred for this reason. Why is qmail doing
136CNAME lookups, anyway?
137
138Answer: The SMTP standard does not permit aliased hostnames, so qmail
212b6f5d
MW
139has to do a CNAME lookup in DNS for every recipient host. If the
140relevant DNS server is down, qmail defers the message. It will try again
141soon.
2117e02e
MW
142
143
144
1453. Routing incoming messages by host
146
147
1483.1. How do I receive mail for another host name? I'd like our disk
149server, pokey.af.mil, to receive mail addressed to af.mil. I've set up
150an MX from af.mil to pokey.af.mil, but how do I get pokey to treat
151af.mil as a name for the local host?
152
153Answer: Add af.mil to /var/qmail/control/locals and to
212b6f5d
MW
154/var/qmail/control/rcpthosts. If qmail-send is running, give it a HUP
155(or do svc -h /var/run/qmail if qmail is supervised).
2117e02e
MW
156
157
1583.2. How do I set up a virtual domain? I'd like any mail for
159nowhere.mil, including root@nowhere.mil and postmaster@nowhere.mil and
160so on, to be delivered to Bob. I've set up the MX already.
161
162Answer: Put
163
164 nowhere.mil:bob
165
166into control/virtualdomains. Add nowhere.mil to control/rcpthosts. If
212b6f5d
MW
167qmail-send is running, give it a HUP (or do svc -h /var/run/qmail if
168qmail is supervised).
2117e02e
MW
169
170Now mail for whatever@nowhere.mil will be delivered locally to
171bob-whatever. Bob can set up ~bob/.qmail-default to catch all the
172possible addresses, ~bob/.qmail-info to catch info@nowhere.mil, etc.
173
174
1753.3. How do I set up several virtual domains for one user? Bob wants
176another virtual domain, everywhere.org, but he wants to handle
177nowhere.mil users and everywhere.org users differently. How can we do
178that without setting up a second account?
179
180Answer: Put two lines into control/virtualdomains:
181
182 nowhere.mil:bob-nowhere
183 everywhere.org:bob-everywhere
184
185Add nowhere.mil and everywhere.org to control/rcpthosts. If qmail-send
212b6f5d
MW
186is running, give it a HUP (or do svc -h /var/run/qmail if qmail is
187supervised).
2117e02e
MW
188
189Now Bob can set up separate .qmail-nowhere-* and everywhere-* files. He
190can even set up .qmail-nowhere-default and .qmail-everywhere-default.
191
192
193
1944. Routing incoming messages by user
195
196
1974.1. How do I forward unrecognized usernames to another host? I'd like
198to set up a LUSER_RELAY pointing at bigbang.af.mil.
199
200Answer: Put
201
202 | forward "$LOCAL"@bigbang.af.mil
203
204into ~alias/.qmail-default.
205
206
2074.2. How do I set up a mailing list? I'd like me-sos@my.host.name to be
208forwarded to a bunch of people.
209
210Answer: Put a list of addresses into ~me/.qmail-sos, one per line. Then
211incoming mail for me-sos will be forwarded to each of those addresses.
212You should also touch ~me/.qmail-sos-owner so that bounces come back to
212b6f5d 213you rather than the original sender.
2117e02e 214
212b6f5d
MW
215Alternative: ezmlm (http://pobox.com/~djb/ezmlm.html) is a modern
216mailing list manager, supporting automatic subscriptions, confirmations,
217archives, fully automatic bounce handling (including warnings to
218subscribers saying which messages they've missed), and more.
2117e02e
MW
219
220
2214.3. How do I use majordomo with qmail?
222
212b6f5d
MW
223Answer: See ftp://ftp.eyrie.org/pub/software/majordomo/mjqmail and
224http://www.qmail.org for various methods. majordomo 2.0 is expected to
225support qmail directly.
226
227Beware that majordomo's lists are not crashproof.
228
2117e02e
MW
229
230
2314.4. How do I use procmail with qmail?
232
233Answer: Put
234
235 | preline procmail
236
237into ~/.qmail. You'll have to use a full path for procmail unless
238procmail is in the system's startup PATH. Note that procmail will try to
212b6f5d
MW
239deliver to /var/spool/mail/$USER by default; to change this, see
240INSTALL.mbox.
2117e02e
MW
241
242
2434.5. How do I use elm's filter with qmail?
244
245Answer: Put
246
247 | preline filter
248
249into ~/.qmail. You'll have to use a full path for filter unless filter
250is in the system's startup PATH.
251
252
2534.6. How do I create aliases with dots? I tried setting up
254~alias/.qmail-P.D.Q.Bach, but it doesn't do anything.
255
256Answer: Use .qmail-p:d:q:bach. Dots are converted to colons, and
257uppercase is converted to lowercase.
258
259
212b6f5d
MW
2604.7. How do I use sendmail's .forward files with qmail?
261
262Answer: Install the dot-forward package
263(http://pobox.com/~djb/dot-forward.html).
264
265
2664.8. How do I use sendmail's /etc/aliases with qmail?
267
268Answer: Install the fastforward package
269(http://pobox.com/~djb/fastforward.html).
270
271
2724.9. How do I make qmail defer messages during NFS or NIS outages? If
273~joe suddenly disappears, I'd like mail for joe to be deferred.
274
275Answer: Build a qmail-users database, so that qmail no longer checks
276home directories and the password database. This takes three steps.
277First, put your complete user list (including local and NIS passwords)
278into /var/qmail/users/passwd. Second, run
279
280 # qmail-pw2u -h < /var/qmail/users/passwd > /var/qmail/users/assign
281
282Here -h means that every user must have a home directory; if you happen
283to run qmail-pw2u during an NFS outage, it will print an error message
284and stop. Third, run
285
286 # qmail-newu
287
288Make sure to rebuild the database whenever you change your user list.
289
290
2914.10. How do I change which account controls an address? I set up
292~alias/.qmail-www, but qmail is looking at ~www/.qmail instead.
293
294Answer: If you do
295
296 # chown root ~www
297
298then qmail will no longer consider www to be a user; see qmail-getpw.0.
299For more precise control over address assignments, see qmail-users.0.
300
301
2117e02e
MW
302
3035. Setting up servers
304
305
3065.1. How do I run qmail-smtpd under tcpserver? inetd is barfing at high
307loads, cutting off service for ten-minute stretches. I'd also like
308better connection logging.
309
310Answer: First, install the tcpserver program, part of the ucspi-tcp
311package (http://pobox.com/~djb/ucspi-tcp.html). Second, remove the smtp
312line from /etc/inetd.conf, and put the line
313
314 tcpserver -u 7770 -g 2108 0 smtp /var/qmail/bin/qmail-smtpd &
315
316into your system startup files. Replace 7770 with your qmaild uid, and
317replace 2108 with your nofiles gid. Don't forget the &. The change will
318take effect at your next reboot.
319
320By default, tcpserver allows at most 40 simultaneous qmail-smtpd
321processes. To raise this limit to 400, use tcpserver -c 400. To keep
322track of who's connecting and for how long, run (on two lines)
323
324 tcpserver -v -u 7770 -g 2108 0 smtp /var/qmail/bin/qmail-smtpd \
325 2>&1 | /var/qmail/bin/splogger smtpd 3 &
326
327
3285.2. How do I set up qmail-qmtpd?
329
330Answer: Two steps. First, put a
331
332 qmtp 209/tcp
333
334line into /etc/services. Second, put (all on one line)
335
336 qmtp stream tcp nowait qmaild
337 /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-qmtpd
338
339into /etc/inetd.conf, and give inetd a HUP.
340
341If you have tcpserver installed, skip the inetd step, and set up
342
343 tcpserver -u 7770 -g 2108 0 qmtp /var/qmail/bin/qmail-qmtpd &
344
345replacing 7770 and 2108 with the qmaild uid and nofiles gid. See
212b6f5d 346question 5.1 for more details on tcpserver.
2117e02e
MW
347
348
212b6f5d
MW
3495.3. How do I set up qmail-pop3d? My old POP server works with mbox
350delivery; I'd like to switch to maildir delivery.
2117e02e
MW
351
352Answer: Four steps. First, install the checkpassword program
353(http://pobox.com/~djb/checkpwd.html). Second, make sure you have a
354
355 pop3 110/tcp
356
212b6f5d
MW
357line in /etc/services. Third, put (all on one line, including
358qmail-popup twice)
2117e02e 359
212b6f5d
MW
360 pop3 stream tcp nowait root
361 /var/qmail/bin/qmail-popup qmail-popup
362 YOURHOST /bin/checkpassword /var/qmail/bin/qmail-pop3d Maildir
2117e02e
MW
363
364into /etc/inetd.conf, and give inetd a HUP; replace YOURHOST with your
365host's fully qualified domain name. Fourth, set up Maildir delivery for
366any user who wants to read mail via POP.
367
368If you have tcpserver installed, skip the inetd step, and set up (on two
369lines)
370
371 tcpserver 0 pop3 /var/qmail/bin/qmail-popup YOURHOST \
372 /bin/checkpassword /var/qmail/bin/qmail-pop3d Maildir &
373
374replacing YOURHOST with your host's fully qualified domain name. See
212b6f5d 375question 5.1 for more details on tcpserver.
2117e02e
MW
376
377Security note: pop3d should be used only within a secure network;
378otherwise an eavesdropper can steal passwords.
379
380
3815.4. How do I allow selected clients to use this host as a relay? I see
382that qmail-smtpd rejects messages to any host not listed in
212b6f5d 383control/rcpthosts.
2117e02e
MW
384
385Answer: Three steps. First, install tcp-wrappers, available separately,
386including hosts_options. Second, change your qmail-smtpd line in
387inetd.conf to
388
389 smtp stream tcp nowait qmaild /usr/local/bin/tcpd
390 /var/qmail/bin/tcp-env /var/qmail/bin/qmail-smtpd
391
392(all on one line) and give inetd a HUP. Third, in tcpd's hosts.allow,
393make a line setting the environment variable RELAYCLIENT to the empty
394string for the selected clients:
395
396 tcp-env: 1.2.3.4, 1.2.3.5: setenv = RELAYCLIENT
397
398Here 1.2.3.4 and 1.2.3.5 are the clients' IP addresses. qmail-smtpd
399ignores control/rcpthosts when RELAYCLIENT is set. (It also appends
400RELAYCLIENT to each envelope recipient address. See question 5.5 for an
401application.)
402
212b6f5d
MW
403Alternative procedure, if you are using tcpserver 0.80 or above: Create
404/etc/tcp.smtp containing
2117e02e
MW
405
406 1.2.3.6:allow,RELAYCLIENT=""
407 127.:allow,RELAYCLIENT=""
408
409to allow clients with IP addresses 1.2.3.6 and 127.*. Run
410
212b6f5d 411 tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
2117e02e
MW
412
413Finally, insert
414
212b6f5d 415 -x /etc/tcp.smtp.cdb
2117e02e 416
212b6f5d 417after tcpserver in your qmail-smtpd invocation.
2117e02e
MW
418
419
4205.5. How do I fix up messages from broken SMTP clients?
421
422Answer: Three steps. First, put
423
212b6f5d
MW
424 | bouncesaying 'Permission denied' [ "@$HOST" != "@fixme" ]
425 | qmail-inject -f "$SENDER" -- "$DEFAULT"
2117e02e
MW
426
427into ~alias/.qmail-fixup-default. Second, put
428
429 fixme:fixup
430
431into /var/qmail/control/virtualdomains, and give qmail-send a HUP.
432Third, follow the procedure in question 5.4, but set RELAYCLIENT to the
433string ``@fixme'':
434
435 tcp-env: 1.2.3.6, 1.2.3.7: setenv = RELAYCLIENT @fixme
436
437Here 1.2.3.6 and 1.2.3.7 are the clients' IP addresses. If you are using
212b6f5d 438tcpserver instead of inetd and tcpd, put
2117e02e
MW
439
440 1.2.3.6:allow,RELAYCLIENT="@fixme"
441 1.2.3.7:allow,RELAYCLIENT="@fixme"
442
212b6f5d
MW
443into /etc/tcp.smtp, and run tcprules as in question 5.4.
444
445
4465.6. How do I set up qmail-qmqpd? I'd like to allow fast queueing of
447outgoing mail from authorized clients.
448
449Answer: Make sure you have installed tcpserver 0.80 or above. Create
450/etc/qmqp.tcp in tcprules format to allow connections from authorized
451hosts. For example, if queueing is allowed from 1.2.3.*:
452
453 1.2.3.:allow
454 :deny
455
456Convert /etc/qmqp.tcp to /etc/qmqp.cdb:
457
458 tcprules /etc/qmqp.cdb /etc/qmqp.tmp < /etc/qmqp.tcp
459
460Finally, set up
461
462 tcpserver -x /etc/qmqp.cdb -u 7770 -g 2108 0 628 /var/qmail/bin/qmail-qmqpd &
463
464replacing 7770 and 2108 with the qmaild uid and nofiles gid. See
465question 5.1 for more details on tcpserver.
2117e02e
MW
466
467
468
4696. Configuring MUAs to work with qmail
470
471
4726.1. How do I make BSD mail generate a Date with the local time zone?
473When I send mail, I'd rather use the local time zone than GMT, since
474some MUAs don't know how to display Date in the receiver's time zone.
475
476Answer: Put
477
478 set sendmail=/var/qmail/bin/datemail
479
480into your .mailrc or your system-wide Mail.rc. Beware that BSD mail is
481neither secure nor reliable.
482
483
212b6f5d 4846.2. How do I make pine work with qmail?
2117e02e
MW
485
486Answer: Put
487
488 sendmail-path=/usr/lib/sendmail -oem -oi -t
489
490into /usr/local/lib/pine.conf. (This will work with sendmail too.)
491Beware that pine is neither secure nor reliable.
492
493
4946.3. How do I make MH work with qmail?
495
496Answer: Put
497
498 postproc: /usr/mh/lib/spost
499
500into each user's .mh_profile. (This will work with sendmail too.) Beware
501that MH is neither secure nor reliable.
502
503
5046.4. How do I stop Sun's dtcm from hanging?
505
506Answer: There is a novice programming error in dtcm, known as ``failure
507to close the output side of the pipe in the child.'' Sun has, at the
508time of this writing, not yet provided a patch. Sorry.
509
510
511
5127. Managing the mail system
513
514
5157.1. How do I safely stop qmail-send? Back when we were running
516sendmail, it was always tricky to kill sendmail without risking the loss
517of current deliveries; what should I do with qmail-send?
518
519Answer: Go ahead and kill the qmail-send process. It will shut down
212b6f5d
MW
520cleanly. Wait for ``exiting'' to show up in the log. To restart qmail,
521run /var/qmail/rc the same way it is run from your system boot scripts,
522with the proper PATH, resource limits, etc.
523
524Alternative, if qmail is supervised: svc -t /var/run/qmail. The
525supervise process will kill qmail, wait for it to stop, and restart it.
526Use -d instead of -t if you don't want qmail to restart automatically;
527to manually restart it, use -u.
2117e02e
MW
528
529
5307.2. How do I manually run the queue? I'd like qmail to try delivering
531all the remote messages right now.
532
212b6f5d
MW
533Answer: Give the qmail-send process an ALRM. (Do svc -a /var/run/qmail
534if qmail is supervised.)
535
536You may want to run qmail-tcpok first, to guarantee that qmail-remote
537will try all addresses. Normally, if an address fails repeatedly,
538qmail-remote leaves it alone for an hour.
2117e02e
MW
539
540
5417.3. How do I rejuvenate a message? Somebody broke into Eric's computer
542again; it's going to be down for at least another two days. I know Eric
543has been expecting an important message---in fact, I see it sitting here
544in /var/qmail/queue/mess/15/26902. It's been in the queue for six days;
545how can I make sure it isn't bounced tomorrow?
546
547Answer: Just touch /var/qmail/queue/info/15/26902. (This is the only
548form of queue modification that's safe while qmail is running.)
549
550
5517.4. How do I organize a big network? I have a lot of machines, and I
552don't know where to start.
553
554Answer: First, choose the domain name where your users will receive
555mail. This is normally the shortest domain name you control. If you are
556in charge of *.movie.edu, you can use addresses like joe@movie.edu.
557
558Second, choose the machine that will know what to do with different
559users at movie.edu. Set up a host name in DNS for this machine:
560
561 mailhost.movie.edu IN A 1.2.3.4
562 4.3.2.1.in-addr.arpa IN PTR mailhost.movie.edu
563
564Here 1.2.3.4 is the IP address of that machine.
565
566Third, make a list of machines where mail should end up. For example, if
567mail for Bob should end up on Bob's workstation, put Bob's workstation
568onto the list. For each of these machines, set up a host name in DNS:
569
570 bobshost.movie.edu IN A 1.2.3.7
571 7.3.2.1.in-addr.arpa IN PTR bobshost.movie.edu
572
573Fourth, install qmail on bobshost.movie.edu. qmail will automatically
574configure itself to accept messages for bob@bobshost.movie.edu and
575deliver them to ~bob/Mailbox on bobshost. Do the same for the other
576machines where mail should end up.
577
578Fifth, install qmail on mailhost.movie.edu. Put
579
580 movie.edu:alias-movie
581
582into control/virtualdomains on mailhost. Then forward bob@movie.edu to
583bob@bobshost.movie.edu, by putting
584
585 bob@bobshost.movie.edu
586
587into ~alias/.qmail-movie-bob. Do the same for other users.
588
589Sixth, put movie.edu into control/rcpthosts on mailhost.movie.edu, so
590that mailhost.movie.edu will accept messages for users at movie.edu.
591
592Seventh, set up an MX record in DNS to deliver movie.edu messages to
593mailhost:
594
595 movie.edu IN MX 10 mailhost.movie.edu
596
597Eighth, on all your machines, put movie.edu into control/defaulthost.
598
599
6007.5. How do I back up and restore the queue disk?
601
602Answer: You can't.
603
604One difficulty is that you can't get a consistent snapshot of the queue
605while qmail-send is running. Another difficulty is that messages in the
606queue must have filenames that match their inode numbers.
607
608However, the big problem is that backups---even twice-daily backups---
609are far too unreliable for mail. If your disk dies, there will be very
610little overlap between the messages saved in the last backup and the
611messages that were lost.
612
613There are several ways to add real reliability to a mail server. Battery
614backups will keep your server alive, letting you park the disk to avoid
615a head crash, when the power goes out. Solid-state disks have their own
616battery backups. RAID boxes let you replace dead disks without losing
617any data.
618
619
212b6f5d
MW
6207.6. How do I run a supervised copy of qmail? svc sounds useful.
621
622Answer: Install daemontools (http://pobox.com/~djb/daemontools.html).
623Create a /var/run/qmail directory. Change
624
625 /var/qmail/rc
626
627to
628
629 supervise /var/run/qmail /var/qmail/rc
630
631in your boot scripts. Make sure that supervise is in the startup PATH.
632Now you can use svc to stop or restart qmail, and svstat to check
633whether qmail is running.
634
635
6367.7. How do I avoid syslog? It chews up a lot of CPU time and isn't
637reliable.
638
639Answer: Install daemontools (http://pobox.com/~djb/daemontools.html).
640Make a /var/log/qmail directory, owned by qmaill, mode 2700. Do
641
642 qmail-start ./Mailbox /usr/local/bin/accustamp \
643 | setuser qmaill /usr/local/bin/cyclog /var/log/qmail &
644
645in /var/qmail/rc.
646
647If you are logging tcpserver connections, make a /var/log/smtpd
648directory, and use cyclog /var/log/smtpd for tcpserver. You shouldn't
649run several copies of cyclog with the same log directory.
650
651By default, cyclog keeps 10 automatically rotated log files, each
652containing up to 100KB of log data. To keep 20 files with 1MB each, use
653cyclog -s 1000000 -n 20.
654
655
2117e02e
MW
656
6578. Miscellany
658
659
6608.1. How do I tell qmail to do more deliveries at once? It's running
661only 20 parallel qmail-remote processes.
662
663Answer: Decide how many deliveries you want to allow at once. Put that
664number into control/concurrencyremote. Restart qmail-send as in question
6657.1. If your system has resource limits, make sure you set the
666descriptors limit to at least double the concurrency plus 5; otherwise
667you'll get lots of unnecessary deferrals whenever a big burst of mail
668shows up. Note that qmail also imposes a compile-time concurrency limit,
669120 by default; this is set in conf-spawn.
670
671
6728.2. How do I keep a copy of all incoming and outgoing mail messages?
673
674Answer: Set QUEUE_EXTRA to "Tlog\0" and QUEUE_EXTRALEN to 5 in extra.h.
675Recompile qmail. Put ./msg-log into ~alias/.qmail-log.
676
677You can also use QUEUE_EXTRA to, e.g., record the Message-ID of every
678message: run
679
680 | awk '/^$/ { exit } /^[mM][eE][sS][sS][aA][gG][eE]-/ { print }'
681
682from ~alias/.qmail-log.
683
684
6858.3. How do I switch slowly from sendmail to qmail? I'm thinking of
686moving the heaven.af.mil network over to qmail, but first I'd like to
687give my users a chance to try out qmail without affecting current
688sendmail deliveries. We're using NFS.
689
690Answer: Find a host in your network, say pc.heaven.af.mil, that isn't
691running an SMTP server. (If addresses at pc.heaven.af.mil are used, you
692should already have an MX pointing pc.heaven.af.mil to your mail hub.)
693
694Set up a new MX record pointing lists.heaven.af.mil to pc.heaven.af.mil.
695Install qmail on pc.heaven.af.mil. Replace pc with lists in the control
696files. Make the qmail man pages available on all your machines.
697
698Now tell your users about qmail. A user can forward joe@heaven.af.mil to
699joe@lists.heaven.af.mil to get ~/Mailbox delivery; he can set up .qmail
700files; he can start running his own mailing lists @lists.heaven.af.mil.
701
702When you're ready to turn sendmail off, you can set up pc.heaven.af.mil
703as your new mail hub. Add heaven.af.mil to control/locals, and change
704the heaven.af.mil MX to point to pc.heaven.af.mil. Make sure you leave
705lists.heaven.af.mil in control/locals so that transition addresses will
706continue to work.