John Hamill <[EMAIL PROTECTED]> wrote:
> 
> What I would like to do, is to be able to reject mail on the qmail server
> for users who don't exist at our site. This is people who leave the company
> etc and various spammers who send to any address at our domain. Is there a
> "simple" way I can have a list of users so that the mailboxes can be
> verified prior to onforwarding to the exchange box.

Stock qmail doesn't do this, because the program which receives the mail
(qmail-smtpd) has no knowledge of users, only domains.  Therefore, if a
messages comes in with an envelope recipient which is in any of the domains
you have told qmail to receive mail for (the ones in rcpthosts), it will
be accepted and queued.  If the domain is local or virtual and no appropriate
user exists, the message will later be bounced.

The other reason that determining local users in advance is difficult is
because of qmail's extension addresses system -- if user joe has no .qmail-*
files in his home directory, only joe@domain is valid.  But if joe wants,
he can create .qmail-foobar and put a delivery instruction in it, and
then joe-foobar@domain is valid as well.  qmail doesn't know this until
it tries a local delivery.

I believe someone did patch qmail-smtpd to do the same types of local
user checks as qmail-local.  Check the mailing list archives if you want that.
But this domain isn't local or virtual; it's just being forwarded in
smtproutes...so you'd probably have to fiddle with making it a virtual
domain, creating .qmail-username files for everyone in the domain, and
then implementing this check.

> I am a bit worried if I create a list of users in qmail-users assign file
> that mail will not automatically be onforwarded to exchange. Also I cannot
> seem to find much documentation about rejecting users. There is quite a lot
> about how to forward on unrecognised user names, but I want to discard them
> :-)

They get 'discarded' when the message bounces.  The other way you could do
it is to have an ~alias/.qmail-default which contains only '#'; this would
cause all messages which don't match a given user/etc to be discarded.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon                            <[EMAIL PROTECTED]>
GPL'ed software available at:  http://www.qcc.sk.ca/~charlesc/software/
Any opinions expressed are just that -- my opinions.
-----------------------------------------------------------------------

Reply via email to