1833737 Members
2753 Online
110063 Solutions
New Discussion

Sendmail relay question.

 
Jason Young_3
Occasional Advisor

Sendmail relay question.

Hi Everyone,

Just after some guidance with a problem I am having with a sendmail server. The scenario is :

We have 3 mail relays into our network.
1 – is mail.abcd.com.au (MX Record priority 10)
2 – is mail2.efgh.net.au (MX Record priority 20)
3 – is postoffice.telstra.net.au (MX Record priority 30)

Mail.for myuser@abcd.com.au is usually routed in from the internet to No.1 relay which works fine. When No.1 fails the incoming mail is relayed to No.2. This server accepts the mail (it is allowed in the relay-domains file) and then does a lookup for the domain abcd.com.au, trys to deliver to No.1 which fails, trys to deliver to No.2 which gives a routing loop so then delivers to No.3 (my interpretation).
What I want to happen is that when No.2 receives mail for the abcd.com.au domain it delivers the mail directly to an internal IP Address (10.X.X.X) which is an internal mail relay server. Is there a way to map a domain name to a specific mail relay internal IP address in sendmail without looking up MX records in DNS?

I am open to any suggestions.

Regards
J
6 REPLIES 6
Rajeev  Shukla
Honored Contributor

Re: Sendmail relay question.

You can do this on sendmail version 8.12.
I haven't tried on HPUX but i have sendmail running on Linux with version 8.12, in which you have a file called mailertable.
This file maps the domain to the respective hostname. So when sendmail recieves the mail for that domain instead of looking at MX record is relays to the defined host in the mailertable

Cheers
Rajeev
Kevin Wright
Honored Contributor

Re: Sendmail relay question.

Correct, you can use a mailertable to map domains to mail servers.

BTW, when host 2 receives an email when host 1 is down, it will not send mail to itself or host 3 as they have a lower preference value.
Jason Young_3
Occasional Advisor

Re: Sendmail relay question.

Thanks for the reply. I have created the mailertable file in the /etc/mail directory. The file has :

abcd.com.au smtp:10.4.32.200

I have compiled the file with "makemap dbm mailertable < mailertable" , I have uncommented the entry in the sendmail.cf file for :

# Mailer table (overriding domains)
Kmailertable dbm -o /etc/mail/mailertable

And stopped and started sendmail. It still seems to be trying to deliver to the original destination, can I use IP addresses or do they have to be names in the file ... or have i done something wrong here?

Jason
Ermin Borovac
Honored Contributor

Re: Sendmail relay question.

I think you will also need to make the following changes (if you haven't already).

(1) Uncomment relevent sections in sendmail.cf. Search for mailertable will reveal them (ruleset 90 etc)

(2) Try using square brackets around 10.4.32.200 in /etc/mail/mailertable to prevent sendmail from looking up MX record for that server.

abcd.com.au smtp:[10.4.32.200]

If you make changes to mailertable don't forget to rerun makemap and restart sendmail.
Jason Young_3
Occasional Advisor

Re: Sendmail relay question.

Everything seems to work fine now that I have all the sendmail.cf file etc setup correctly. Thanks for all the help.
Jason Young_3
Occasional Advisor

Re: Sendmail relay question.

Thanks Everyone.