You can set up qmail to use the same local delivery agent as sendmail,
through a mechanism called qsmhook. This file says how.

Before you do this, may I ask why? If you simply don't want the hassle
of moving user mailboxes from /usr/spool/mail to ~, please reconsider---
/usr/spool/mail has always been a big security problem. See, for
example, CERT advisory 95:02.

If you're trying to preserve /etc/aliases and ~user/.forward, you're
looking the wrong way---those are handled by sendmail internally, not by
the local delivery agent. You can use your old /etc/aliases with qmail
by installing the qmsmac package.

Perhaps you've set up an advanced agent like procmail. But most people
use procmail for nothing more than sorting mail into several mailboxes;
and that's much easier with qmail's local forwarding mechanism, which
gives each user control over user-anything. If you have a few users who
really do need procmail, they can easily run procmail from their own
.qmail files.

Do you still want to set up qsmhook? Send me some e-mail and let me know
why. Perhaps I can provide something for you in a future qmail release.

Here's what to do. First, tack ``:alias'' onto the end of each address
in /var/qmail/control/locals, and put the results into
/var/qmail/control/virtualdomains. For example, if control/locals has

   localhost
   silverton.berkeley.edu

then control/virtualdomains should now have (without extra spaces)

   localhost:alias
   silverton.berkeley.edu:alias

Second, cp /dev/null control/locals.

Third, put a line into ~alias/.qmail-default, based on sendmail's Mlocal
line. For example, if sendmail.cf has

   Mlocal, P=/bin/mail, F=lsDFMPrmn, S=10, R=20, A=mail -d $u

then ~alias/.qmail-default should have

   |qsmhook -x alias- -lsDFMPmn /bin/mail -r %g -d %u

As another example, if sendmail.cf has

   Mlocal, P=/usr/lib/mail.local, F=flsSDFMmnP, S=10, R=20, A=mail.local -d $u

then ~alias/.qmail-default should have

   |qsmhook -x alias- -lsDFMmnP /usr/lib/mail.local -f %g -d %u