Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to configure sendmai

Status
Not open for further replies.

mrnez

Technical User
Sep 11, 2002
37
GB
Is it possible to configure sendmail.cf to allow two smart relay hosts ????
 

I assume from this that you want incomming mail relayed to two different domains?

eg Mail for user1@Domain1.com to go to machine1 and mail for user1@domain2.com to go to a different domain?

If thats what you want then you can simply use the mailertable database

in the sendmail.mc file add an entry for FEATURE(`mailertable') and create a text file named mailertable

Inside the mailertable file add your entries. They'll look something like this.

domain1.com <tab key> esmtp:host.domain1.com
domain2.com <tab key> esmtp:host.domain2.com

..or ..if you have sub level domains eg userA@dept1.domain.com and userB@dept2.domain.com then you can simply have

dept1.domain.com <tab key> esmtp:host1.domain.com
dept2.domain.com <tab key> esmtp:host2.domain.com

compile the mailertable file using
makemap hash /etc/mail/mailertable < /etc/mail/mailertable
and you'll also need to re-compile the sendmail.mc file using the M4 compiler

M4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

This assumes that you're files are in the /etc/mail directory.

two points to note, you can either use esmtp or smtp in the mailertable files depending on your back level SMTP Server and if you don't resolve the IP's to hostnames then you can use the IP addresses in '[ ]' brackets so they'll looking something like

dept1.domain.com <tab key> smtp:host1.domain.com or
dept2.domain.com <tab key> esmtp:[111.1.1.1]

Hopw this helps! Let me know if it's not what you're looking for and I'll see what I can do.

~ Remember - Nothing is Fool Proof to a Talented Fool ~
 
I'm trying to setup two smart relay hosts, (primary and seconday) so that all mail will relay to the first relay hosts and if that smart relay host is not reachable then it will try to relay to the second smart relay hosts. I assume this can be setup in sendmail.cf ???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top