Re: Sendmail to Relay different domains to different hosts

2009-02-06 Thread Giorgos Keramidas
On Fri, 6 Feb 2009 13:15:02 -0500, greg.st...@sungard.com wrote:
 I am using Sendmail on a FreeBSD7.0 server as a mail relay for some of
 our servers.  These servers relay messages to both internal recipients
 and external customers.  I need to be able to relay mail destined to
 our internal domain recipients to our corporate mail servers but relay
 everything else out to our usual smart host.  So basically, I am
 looking to relay emails destined for a certain domain to one host and
 the rest of the mail to another.  Does anyone know how I could
 configure sendmail to accomplish this?

That's what `mailertable' is for.

Enable in your `sendmail.mc' file the mailertable feature:

FEATURE(`mailertable', `hash /etc/mail/mailertable')

Then create an `/etc/mail/mailertable' map with something like:

@internal.domainesmtp:[internal.relay.host]

Generate the `mailertable.db' map with makemap:

# cd /etc/mail
# makemap hash mailertable  mailertable

and you're done.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Sendmail to Relay different domains to different hosts

2009-02-06 Thread Dan Nelson
In the last episode (Feb 06), greg.st...@sungard.com said:
 I am using Sendmail on a FreeBSD7.0 server as a mail relay for some of our
 servers.  These servers relay messages to both internal recipients and
 external customers.  I need to be able to relay mail destined to our
 internal domain recipients to our corporate mail servers but relay
 everything else out to our usual smart host.  So basically, I am looking
 to relay emails destined for a certain domain to one host and the rest of
 the mail to another.  Does anyone know how I could configure sendmail to
 accomplish this?

You want to use the /etc/mail/mailertable file:

http://www.sendmail.org/m4/mailertables.html

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Sendmail to Relay different domains to different hosts

2009-02-06 Thread Steve Bertrand
greg.st...@sungard.com wrote:
 I am using Sendmail on a FreeBSD7.0 server as a mail relay for some of
 our servers.  These servers relay messages to both internal recipients
 and external customers.  I need to be able to relay mail destined to our
 internal domain recipients to our corporate mail servers but relay
 everything else out to our usual smart host.   So basically, I am
 looking to relay emails destined for a certain domain to one host and
 the rest of the mail to another.  

 Does anyone know how I could configure
 sendmail to accomplish this?

Yes.

Take a look at the `mailertable.sample' file. Create an empty
'mailertable' file in /etc/mail, and add the domain-to-server maps to it:

corporate.com   smtp:relay.corporate.com
other.com   smtp:some.other.server.com

...and then IIRC:

# cd /etc/mail
# makemap hash mailertable  mailertable

Steve
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


RE: Sendmail to Relay different domains to different hosts

2009-02-06 Thread Greg.Stark
Great!  I will give this a try.  

If I put a single entry into the mailertable for the corporate domain
would everything else default to the smarthost defined in sendmail.cf?

Thanks,

Greg



-Original Message-
From: Steve Bertrand [mailto:st...@ibctech.ca] 
Sent: Friday, February 06, 2009 2:03 PM
To: Stark, Greg
Cc: freebsd-questions@freebsd.org
Subject: Re: Sendmail to Relay different domains to different hosts

greg.st...@sungard.com wrote:
 I am using Sendmail on a FreeBSD7.0 server as a mail relay for some of
 our servers.  These servers relay messages to both internal recipients
 and external customers.  I need to be able to relay mail destined to
our
 internal domain recipients to our corporate mail servers but relay
 everything else out to our usual smart host.   So basically, I am
 looking to relay emails destined for a certain domain to one host and
 the rest of the mail to another.  

 Does anyone know how I could configure
 sendmail to accomplish this?

Yes.

Take a look at the `mailertable.sample' file. Create an empty
'mailertable' file in /etc/mail, and add the domain-to-server maps to
it:

corporate.com   smtp:relay.corporate.com
other.com   smtp:some.other.server.com

...and then IIRC:

# cd /etc/mail
# makemap hash mailertable  mailertable

Steve


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


RE: Sendmail to Relay different domains to different hosts

2009-02-06 Thread Greg.Stark
Just did some testing.  A single entry for the corporate domain as
described below and the smarthost set for everything else seems to work.


Thanks very much everyone!

Greg


-Original Message-
From: owner-freebsd-questi...@freebsd.org
[mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of
greg.st...@sungard.com
Sent: Friday, February 06, 2009 2:10 PM
To: st...@ibctech.ca
Cc: freebsd-questions@freebsd.org
Subject: RE: Sendmail to Relay different domains to different hosts

Great!  I will give this a try.  

If I put a single entry into the mailertable for the corporate domain
would everything else default to the smarthost defined in sendmail.cf?

Thanks,

Greg



-Original Message-
From: Steve Bertrand [mailto:st...@ibctech.ca] 
Sent: Friday, February 06, 2009 2:03 PM
To: Stark, Greg
Cc: freebsd-questions@freebsd.org
Subject: Re: Sendmail to Relay different domains to different hosts

greg.st...@sungard.com wrote:
 I am using Sendmail on a FreeBSD7.0 server as a mail relay for some of
 our servers.  These servers relay messages to both internal recipients
 and external customers.  I need to be able to relay mail destined to
our
 internal domain recipients to our corporate mail servers but relay
 everything else out to our usual smart host.   So basically, I am
 looking to relay emails destined for a certain domain to one host and
 the rest of the mail to another.  

 Does anyone know how I could configure
 sendmail to accomplish this?

Yes.

Take a look at the `mailertable.sample' file. Create an empty
'mailertable' file in /etc/mail, and add the domain-to-server maps to
it:

corporate.com   smtp:relay.corporate.com
other.com   smtp:some.other.server.com

...and then IIRC:

# cd /etc/mail
# makemap hash mailertable  mailertable

Steve


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
freebsd-questions-unsubscr...@freebsd.org


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Sendmail to Relay different domains to different hosts

2009-02-06 Thread Giorgos Keramidas
On Fri, 6 Feb 2009 14:09:49 -0500, greg.st...@sungard.com wrote:
 Great!  I will give this a try.

 If I put a single entry into the mailertable for the corporate domain
 would everything else default to the smarthost defined in sendmail.cf?

Yes.  If you want *everything* to be handled through mailertable you
have to explicitly configure it to include a . left hand entry:

corporate.domain esmtp:[internal.mail.server]
.esmtp:[override.stp.relay]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org