On 12-Oct-2000 Brett Randall wrote:
> [EMAIL PROTECTED] writes:
> 
>> What about something like
>> 
>> | [ "$HOST" != city.hillsong.com ] && { forward
>> "$LOCAL"@city.hillsong.com ; exit 99 } ./Maildir/

I just realized this is wrong, you want something like

| [ `hostname` != kermit.hillsong.com ] ...

so that qmail-local on the appropriate server can figure
out whether the email is to be delivered locally or not,
$HOST is derived from the address and will always be the
same.

Alternatively start the SMTP servers with an environment
variable that identifies the local server, eg

export THISMACHINE=`hostname`
tcpserver ... qmail-smtpd ...

and

| [ "$THISMACHINE" != kermit.hillsong.com ] ...

> 
> OK I have made the following .qmail file:
> 
>| [ "$HOST" != "kermit.hillsong.com" ] && { forward
> "$LOCAL"@kermit.hillsong.com ; exit 99 }
> ./Maildir/
> (only 2 lines)
> 
> Then when I try and send an e-mail to a test user on kermit (test
> machine), it says in the logs:
> 
> 2000-10-12 11:01:27.222460500 new msg 611
> 2000-10-12 11:01:27.222494500 info msg 611: bytes 1105 from
> <[EMAIL PROTECTED]> qp 6773 uid 0
> 2000-10-12 11:01:27.319300500 starting delivery 21: msg 611 to local
> [EMAIL PROTECTED]
> 2000-10-12 11:01:27.319360500 status: local 1/10 remote 0/20
> 2000-10-12 11:01:27.396615500 delivery 21: deferral:
> 2000-10-12 11:01:27.396659500 status: local 0/10 remote 0/20
> 
> Showing a deferral (presumably the exit 99 is being called). I can't
> figure out what's happening...Any ideas? Tx
> 

The "exit 99" shouldn't cause a deferral, try adding "exit 0" to
the line:

[ "$THISMACHINE ... ] && { ... ; exit 99 } || exit 0


> -- 
> /BR
> 
> Manager
> InterPlanetary Solutions
> http://ipsware.com/

-- 
Rick Lyons
WebCentral

Reply via email to