> You mean unless the mail is destined for particular domains?

Yes, or IP's

> If I'm reading this right, on the inbound box you have some school
> district domains that you are scanning mail for, and need to forward their
> mail on to them directly.  Anything else, you want to be sent to the
> outbound gateway?

This is correct. The incoming gateway needs to (and is) forwarding inbound
mail to domains inside our WAN.

> In that case (if I understand your problem correctly), set the inbound
> server to use the outbound one as a smarthost (look for "DS" at the
> beginning of a line in sendmail.cf, and make the line look like:)
>
> DSoutbound.server.name


This works, but it sends all mail to the outbound relay server. I need
only mail from my local domain to be forwarded to the relay. That is why I
thought having it IP based is better, since all mail that is forwarded to
the schools is sent from my local domain. As I viewed messages in
Mailwatch I could see it is causing a loop, so I disabled the
DSoutbound.relay.server for now.


> And then config the school domains in mailertable with the correct routing
> info:
>
> edit /etc/mail/mailertable:
> school1.com	smtp:smtp.server.for.school1.com
> school2.com	smtp:smtp.server.for.school2.com

My current config of the incoming gateway server has this.


> And rebuild the mailertable hash:
> $ makemap hash /etc/mail/mailertable < /etc/mail/mailertable
>
> This should force all your outgoing mail from the internal box to be
> relayed through the outbound gateway, except for the domains that you put
> in mailertable will be relayed to the mailservers you specify for each
> domain.
>

That is what we need