Here are the entries I added to /etc/mail/virtusertable. Note that
there is a tab between the address on the left and the text on the right. Do not use
spaces.
terry@fakedomain1.org terry
terry@anotherfake1.edu error:nouser No such user here
After saving these changes, I issued the following command:
[root@ducky:/etc/mail] # makemap hash virtusertable <
virtusertable
In this case, mail sent to terry@fakedomain1.org will be delivered to the local user
terry. But mail sent to terry@anotherfake1.edu will fail. This is good.
However, if I have another domain on my box, say realdomain.com, mail sent to
terry@realdomain.com will be delivered to terry's mailbox. This is not good.
Apart from adding an "error:nouser" line for each domain/user combination, I
don't know how to get around this. Check back later.
Well, it's now later. Here's what I'm doing for my incoming mail. I use
/etc/mail/virtusertable and I have a section within that file for each domain. So I
have something like this:
#
# firstdomain.org
#
owner-majordomo@firstdomain.org owner-majordomo-nz-freebsd-org
majordomo-owner@firstdomain.org owner-majordomo-nz-freebsd-org
majordomo@firstdomain.org majordomo-nz-freebsd-org
marc@firstdomain.org marc
@firstdomain.org error:nouser No such user here
For firstdomain.org, the first three entires are for are majordomo (the names on the
right hand side will in turn be resolved by some other aliases, but that is beyond the
scope of this example). The mail for marc@firstdomain.org is delivered locally to
marc's mailbox. All other mail for this domain is rejected with an error message.
#
# fakedomain.com
#
owner-majordomo@fakedomain.com owner-majordomo-racingsystem-com
majordomo-owner@fakedomain.com owner-majordomo-racingsystem-com
majordomo@fakedomain.com majordomo-racingsystem-com
For fakedomain.com, only these aliases are allowed. I'm not sure what would happen for
other mail for this domain. But if it matched a local user, it would be delivered to
them. It's far better to have a wildcard alias for each domain (such as
@fakedomain.com).
#
# other.org
#
marc@other.org dan
se@other.org sue@lather.org
@other.org dan
For other.org, mail for marc is delivered locally. Mail for se is delivered to
sue@lather.org. All other mail for this domain is sent to mar. |