I could be wrong but I'm fairly sure you can't do this without patching the code. How where you planning on getting user credentials? If by From or the reply-to I can't see it buying you much. Otherwise you would be using ssl or smtp-auth neither of which qmail supports out of the box. It should be fairly simple though to have a patched qmail-smtpd pass qmail-queue an environment var that contains the authenticated users name and then make the deciesion on that. There is a patch to allow a custom Qmail-queue to be used which is just a wrapper around DJB's qmail-queue. Something similar could then be done for local mail, though if they have sh access they could just use their own "mta" for sending mail.