> Basically, I need to figure out how to do this with qmail:
>
> - Recieve message
> - Check against a list of exceptions. If exception for destination
> address exists, send it to the target of the exception.
> - Attempt local delivery
> - bounce if local username not found.
I've done this; my method is probably not optimal, but it works.
You can do this using .qmail and, in particular, .qmail-default
addresses. Part of the answer is in FAQ 3.2:
----
3.2. How do I set up a virtual domain? I'd like any mail for
nowhere.mil, including [EMAIL PROTECTED] and [EMAIL PROTECTED] and
so on, to be delivered to Bob. I've set up the MX already.
Answer: Put
nowhere.mil:bob
into control/virtualdomains. Add nowhere.mil to control/rcpthosts. If
qmail-send is running, give it a HUP (or do svc -h /var/run/qmail if
qmail is supervised).
Now mail for [EMAIL PROTECTED] 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 [EMAIL PROTECTED], etc.
----
Now, to arrange the default delivery to local user, use a
.qmail-default file similar to the one listed in FAQ 4.1:
----
4.1. How do I forward unrecognized usernames to another host? I'd like
to set up a LUSER_RELAY pointing at bigbang.af.mil.
Answer: Put
| forward "$LOCAL"@bigbang.af.mil
into ~alias/.qmail-default.
----
I think I ended up having to use "$USER"@... instead of "$LOCAL"@...
because $LOCAL ended up picking up part of the initial redirection. There's
some way to find out what variables are available in .qmail; I forget
offhand...
So what I ended up with is:
Put example.com:example in virtualdomains
Either create a user 'example' or use .qmail-example-BLAH in
/var/qmail/alias.
Then, ~example/.qmail-default (or ~alias/.qmail-example-default) contains
the recipe to attempt local delivery.
~example/.qmail-postmaster (or ~alias/.qmail-example-postmaster) points to
whatever address you want mail for postmaster to go to instead. (replace
postmaster with whatever address you want an exception for).
--
gowen -- Greg Owen -- [EMAIL PROTECTED]