Questions and answers:

1. This host is vangogh.cs.berkeley.edu, but I want it to masquerade as
cs.berkeley.edu---I want people to see From: eric@cs.berkeley.edu in my
outgoing messages so that their replies go to eric@cs.berkeley.edu. How
do I do that?

Answer: echo cs.berkeley.edu > /var/qmail/control/defaulthost; chmod 644
/var/qmail/control/defaulthost.

2. Okay, that's fine for most of us, but actually I've decided that I'd
prefer From: god@sendmail.org, so that replies go to my other account.
How do I set up masquerading for just _my_ outgoing mail?

Answer: Add MAILHOST=sendmail.org and MAILUSER=god to your environment.

3. Our hub is named hofmann.cs.berkeley.edu. I'd like it to receive mail
addressed to foo.cs.berkeley.edu. I know how to set up an MX record
pointing from foo.cs.berkeley.edu to hofmann.cs.berkeley.edu, but how do
I get hofmann to treat foo.cs.berkeley.edu as a name for the local host?

Answer: Add foo.cs.berkeley.edu to /var/qmail/control/locals.

4. We'd like to keep centralized mail spools on the hub. How do I get
vangogh to forward local mail to hofmann? I put vangogh.cs.berkeley.edu
into control/locals on hofmann, and I set up an MX from vangogh to
hofmann. But if a vangogh user sends mail to eric@vangogh, vangogh tries
to deliver it locally. How do I stop that?

Answer: Remove vangogh from /var/qmail/control/locals (on vangogh). Make
sure the MX is set up properly before you do this.

5. Okay, that worked. Now how do I turn vangogh into a nullclient? I'd
like it to forward _remote_ mail directly to hofmann.

Answer: echo hofmann.cs.berkeley.edu > /var/qmail/control/smarthost;
chmod 644 /var/qmail/control/smarthost. Turn off qmail-smtpd in
/etc/inetd.conf on vangogh.

6. How do I set up a virtual domain? I'd like any mail for nowhere.mil,
including root@nowhere.mil and postmaster@nowhere.mil and so on, to be
delivered to Bob.

Answer: echo nowhere.mil:bob >> /var/qmail/control/virtualdomains; chmod
644 /var/qmail/control/virtualdomains. Now mail for whatever@nowhere.mil
will be delivered locally to bob-whatever. Bob can set up
~bob/.qmail-default to catch all the possible addresses,
~bob/.qmail-info to catch info@nowhere.mil, and so on.

7. Actually, Bob wants another virtual domain, everywhere.org, but he
wants to handle nowhere.mil users and everywhere.org users differently.
How can we do that without setting up a second account?

Answer: Put two lines into control/virtualdomains:

     nowhere.mil:bob-nowhere
     everywhere.org:bob-everywhere

Now Bob can set up separate .qmail-nowhere-* and everywhere-* files. He
can even set up .qmail-nowhere-default and .qmail-everywhere-default.

8. The qmail-send daemon doesn't seem to have noticed all these control
changes. I guess I'll have to kill it and restart it. Back when we were
running sendmail, it was always tricky to kill sendmail without risking
ths loss of current deliveries; what should I do with qmail-send?

Answer: Go ahead and kill the qmail-send process. It will shut down
cleanly. Wait for ``exiting'' to show up in the log. Now run qmail-start
the same way as it's run from your system boot scripts.

9. I don't want people using this host as a relay: if a message comes in
by SMTP, and isn't for a local address, it should bounce. How can I set
that up?

Answer: Put the allowed hosts into /var/qmail/control/rcpthosts. You may
want to simply ln -s locals /var/qmail/control/rcpthosts, if you aren't
using virtualdomains.

10. Oh no! This user's computer is going to be down just a few more days
than he expected. I know he's been expecting a big important message. In
fact, I see it sitting here in /var/qmail/queue/mess/26902. It's been in
the queue for six days; is there any way I can rejuvenate this one
message so that hofmann doesn't bounce it tomorrow?

Answer: Just touch /var/qmail/queue/info/26902.

11. How do I set up a LUSER_RELAY? I'd like to forward all unrecognized
usernames to hofmann.

Answer: Put

   |forward "$USEREXT"@hofmann.cs.berkeley.edu

into ~alias/.qmail-default.
