?? faq
字號:
1. Controlling the appearance of outgoing messages1.1. How do I set up host masquerading?1.2. How do I set up user masquerading?1.3. How do I set up Mail-Followup-To automatically?2. Routing outgoing messages2.1. How do I send local messages to another host?2.2. How do I set up a null client?2.3. How do I send outgoing mail through UUCP?2.4. How do I set up a separate queue for a SLIP/PPP link?2.5. How do I deal with ``CNAME lookup failed temporarily''?3. Routing incoming messages by host3.1. How do I receive mail for another host name?3.2. How do I set up a virtual domain?3.3. How do I set up several virtual domains for one user?4. Routing incoming messages by user4.1. How do I forward unrecognized usernames to another host?4.2. How do I set up a mailing list?4.3. How do I use majordomo with qmail?4.4. How do I use procmail with qmail?4.5. How do I use elm's filter with qmail?4.6. How do I create aliases with dots?4.7. How do I use sendmail's .forward files with qmail?4.8. How do I use sendmail's /etc/aliases with qmail?4.9. How do I make qmail defer messages during NFS or NIS outages?4.10. How do I change which account controls an address?5. Setting up servers5.1. How do I run qmail-smtpd under tcpserver?5.2. How do I set up qmail-qmtpd?5.3. How do I set up qmail-pop3d?5.4. How do I allow selected clients to use this host as a relay?5.5. How do I fix up messages from broken SMTP clients?5.6. How do I set up qmail-qmqpd?6. Configuring MUAs to work with qmail6.1. How do I make BSD mail generate a Date with the local time zone?6.2. How do I make pine work with qmail?6.3. How do I make MH work with qmail?6.4. How do I stop Sun's dtcm from hanging?7. Managing the mail system7.1. How do I safely stop qmail-send?7.2. How do I manually run the queue?7.3. How do I rejuvenate a message?7.4. How do I organize a big network?7.5. How do I back up and restore the queue disk?7.6. How do I run a supervised copy of qmail?7.7. How do I avoid syslog?8. Miscellany8.1. How do I tell qmail to do more deliveries at once?8.2. How do I keep a copy of all incoming and outgoing mail messages?8.3. How do I switch slowly from sendmail to qmail?1. Controlling the appearance of outgoing messages1.1. How do I set up host masquerading? All the users on this host,zippy.af.mil, are users on af.mil. When joe sends a message to fred, themessage should say ``From: joe@af.mil'' and ``To: fred@af.mil'', without``zippy'' anywhere.Answer: echo af.mil > /var/qmail/control/defaulthost; chmod 644/var/qmail/control/defaulthost.1.2. How do I set up user masquerading? I'd like my own From lines toshow boss@af.mil rather than god@heaven.af.mil.Answer: Add MAILHOST=af.mil and MAILUSER=boss to your environment. Tooverride From lines supplied by your MUA, add QMAILINJECT=f to yourenvironment.1.3. How do I set up Mail-Followup-To automatically? When I send amessage to the sos@heaven.af.mil mailing list, I'd like to include``Mail-Followup-To: sos@heaven.af.mil''.Answer: Add QMAILMFTFILE=$HOME/.lists to your environment, and putsos@heaven.af.mil into ~/.lists.2. Routing outgoing messages2.1. How do I send local messages to another host? All the mail foraf.mil should be delivered to our disk server, pokey.af.mil. I've set upan MX from af.mil to pokey.af.mil, but when a user on the af.mil hostsends a message to boss@af.mil, af.mil tries to deliver it locally. Howdo I stop that?Answer: Remove af.mil from /var/qmail/control/locals. If qmail-send isrunning, give it a HUP. Make sure the MX is set up properly before youdo this. Also make sure that pokey can receive mail for af.mil---seequestion 3.1.2.2. How do I set up a null client? I'd like zippy.af.mil tosend all mail to bigbang.af.mil.Answer: echo :bigbang.af.mil > /var/qmail/control/smtproutes;chmod 644 /var/qmail/control/smtproutes. Disable local delivery as inquestion 2.1. Turn off qmail-smtpd in /etc/inetd.conf.2.3. How do I send outgoing mail through UUCP? I need qmail to send alloutgoing mail via UUCP to my upstream UUCP site, gonzo.Answer: Put :alias-uucpinto control/virtualdomains and |preline -df /usr/bin/uux - -r -gC -a"${SENDER:-MAILER-DAEMON}" gonzo!rmail "($DEFAULT@$HOST)"(all on one line) into ~alias/.qmail-uucp-default. (For some UUCPsoftware you will need to use -d instead of -df.) If qmail-send isrunning, give it a HUP.2.4. How do I set up a separate queue for a SLIP/PPP link?Answer: Use serialmail (http://pobox.com/~djb/serialmail.html).2.5. How do I deal with ``CNAME lookup failed temporarily''? The logshowed that a message was deferred for this reason. Why is qmail doingCNAME lookups, anyway?Answer: The SMTP standard does not permit aliased hostnames, so qmailhas to do a CNAME lookup in DNS for every recipient host. If therelevant DNS server is down, qmail defers the message. It will try againsoon.3. Routing incoming messages by host3.1. How do I receive mail for another host name? I'd like our diskserver, pokey.af.mil, to receive mail addressed to af.mil. I've set upan MX from af.mil to pokey.af.mil, but how do I get pokey to treataf.mil as a name for the local host?Answer: Add af.mil to /var/qmail/control/locals and to/var/qmail/control/rcpthosts. If qmail-send is running, give it a HUP(or do svc -h /var/run/qmail if qmail is supervised).3.2. How do I set up a virtual domain? I'd like any mail fornowhere.mil, including root@nowhere.mil and postmaster@nowhere.mil andso on, to be delivered to Bob. I've set up the MX already.Answer: Put nowhere.mil:bobinto control/virtualdomains. Add nowhere.mil to control/rcpthosts. Ifqmail-send is running, give it a HUP (or do svc -h /var/run/qmail ifqmail is supervised).Now mail for whatever@nowhere.mil will be delivered locally tobob-whatever. Bob can set up ~bob/.qmail-default to catch all thepossible addresses, ~bob/.qmail-info to catch info@nowhere.mil, etc.3.3. How do I set up several virtual domains for one user? Bob wantsanother virtual domain, everywhere.org, but he wants to handlenowhere.mil users and everywhere.org users differently. How can we dothat without setting up a second account?Answer: Put two lines into control/virtualdomains: nowhere.mil:bob-nowhere everywhere.org:bob-everywhereAdd nowhere.mil and everywhere.org to control/rcpthosts. If qmail-sendis running, give it a HUP (or do svc -h /var/run/qmail if qmail issupervised).Now Bob can set up separate .qmail-nowhere-* and everywhere-* files. Hecan even set up .qmail-nowhere-default and .qmail-everywhere-default.4. Routing incoming messages by user4.1. How do I forward unrecognized usernames to another host? I'd liketo set up a LUSER_RELAY pointing at bigbang.af.mil.Answer: Put | forward "$LOCAL"@bigbang.af.milinto ~alias/.qmail-default.4.2. How do I set up a mailing list? I'd like me-sos@my.host.name to beforwarded to a bunch of people.Answer: Put a list of addresses into ~me/.qmail-sos, one per line. Thenincoming mail for me-sos will be forwarded to each of those addresses.You should also touch ~me/.qmail-sos-owner so that bounces come back toyou rather than the original sender.Alternative: ezmlm (http://pobox.com/~djb/ezmlm.html) is a modernmailing list manager, supporting automatic subscriptions, confirmations,archives, fully automatic bounce handling (including warnings tosubscribers saying which messages they've missed), and more.4.3. How do I use majordomo with qmail?Answer: See ftp://ftp.eyrie.org/pub/software/majordomo/mjqmail andhttp://www.qmail.org for various methods. majordomo 2.0 is expected tosupport qmail directly.Beware that majordomo's lists are not crashproof.4.4. How do I use procmail with qmail?Answer: Put | preline procmailinto ~/.qmail. You'll have to use a full path for procmail unlessprocmail is in the system's startup PATH. Note that procmail will try todeliver to /var/spool/mail/$USER by default; to change this, seeINSTALL.mbox.4.5. How do I use elm's filter with qmail?Answer: Put | preline filterinto ~/.qmail. You'll have to use a full path for filter unless filteris in the system's startup PATH.4.6. How do I create aliases with dots? I tried setting up~alias/.qmail-P.D.Q.Bach, but it doesn't do anything.Answer: Use .qmail-p:d:q:bach. Dots are converted to colons, anduppercase is converted to lowercase.4.7. How do I use sendmail's .forward files with qmail?Answer: Install the dot-forward package(http://pobox.com/~djb/dot-forward.html).4.8. How do I use sendmail's /etc/aliases with qmail?Answer: Install the fastforward package(http://pobox.com/~djb/fastforward.html).4.9. How do I make qmail defer messages during NFS or NIS outages? If~joe suddenly disappears, I'd like mail for joe to be deferred.Answer: Build a qmail-users database, so that qmail no longer checkshome directories and the password database. This takes three steps.First, put your complete user list (including local and NIS passwords)into /var/qmail/users/passwd. Second, run # qmail-pw2u -h < /var/qmail/users/passwd > /var/qmail/users/assignHere -h means that every user must have a home directory; if you happento run qmail-pw2u during an NFS outage, it will print an error messageand stop. Third, run # qmail-newuMake sure to rebuild the database whenever you change your user list.4.10. How do I change which account controls an address? I set up~alias/.qmail-www, but qmail is looking at ~www/.qmail instead.Answer: If you do # chown root ~wwwthen qmail will no longer consider www to be a user; see qmail-getpw.0.For more precise control over address assignments, see qmail-users.0.5. Setting up servers5.1. How do I run qmail-smtpd under tcpserver? inetd is barfing at highloads, cutting off service for ten-minute stretches. I'd also likebetter connection logging.Answer: First, install the tcpserver program, part of the ucspi-tcppackage (http://pobox.com/~djb/ucspi-tcp.html). Second, remove the smtpline from /etc/inetd.conf, and put the line tcpserver -u 7770 -g 2108 0 smtp /var/qmail/bin/qmail-smtpd &into your system startup files. Replace 7770 with your qmaild uid, andreplace 2108 with your nofiles gid. Don't forget the &. The change willtake effect at your next reboot.By default, tcpserver allows at most 40 simultaneous qmail-smtpdprocesses. To raise this limit to 400, use tcpserver -c 400. To keeptrack of who's connecting and for how long, run (on two lines) tcpserver -v -u 7770 -g 2108 0 smtp /var/qmail/bin/qmail-smtpd \ 2>&1 | /var/qmail/bin/splogger smtpd 3 &5.2. How do I set up qmail-qmtpd?Answer: Two steps. First, put a qmtp 209/tcpline into /etc/services. Second, put (all on one line) qmtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-qmtpdinto /etc/inetd.conf, and give inetd a HUP.If you have tcpserver installed, skip the inetd step, and set up tcpserver -u 7770 -g 2108 0 qmtp /var/qmail/bin/qmail-qmtpd &replacing 7770 and 2108 with the qmaild uid and nofiles gid. Seequestion 5.1 for more details on tcpserver.5.3. How do I set up qmail-pop3d? My old POP server works with mboxdelivery; I'd like to switch to maildir delivery.Answer: Four steps. First, install the checkpassword program(http://pobox.com/~djb/checkpwd.html). Second, make sure you have a