Greetings All,

I am currently in the planning stages of setting up a moderately
large distributed email system and have run into a little snag
in the way I would like the system to work.

I believe I know how I would like to architect the solution to
the problem; but I am unsure of how to execute the changes and
was wondering if anyone had some advice or ideas on the following:

a) I would like to rename the program qmail-remote to qmail-remote.real
   and insert another program in its place. (Likely to be a shell script).

b) The script would look at the domain of the intended recipient and if 
   it matched maildomain.com (for example) it would then look at the
   username being sent to.
   A small(ish) text file would be kept on the mail server with a list of
   usernames. If the username was found in the list, then the script would
   modify the recipient's email address to [EMAIL PROTECTED]
   and place the message back into the qmail-queue (or qmail-inject if that
   is better).

   If no match is found then the message would be handed onto
qmail-remote.real 
   for normal processing.

   [The effect would be to 'hijack' (for legitimate reasons) mail for a
subset of an 
    upstream domain, and deliver it locally. (Attempting to cut down on WAN
traffic)].

Is this possible, and easily achievable?

(I think my biggest problem (related to qmail  :-p ) is my lack of
understanding about 
 how to read the parameters from stdinput in a shell script, manipulate
them,
 and then how to pass control back to qmail-remote.)

Thanks in advance,

Greg Elliott
E-mail:   [EMAIL PROTECTED]

Reply via email to