[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Sendmail - point to local ip rather than external

I am attempting to get sendmail up and running on a linux box.   The issue is I want the sendmail to hit an internal ip rather than the outside.  In the logs I get the following:

Jan  7 09:51:02 *** sendmail[29762]: o07Go24R029761: to=jason@****.net, ctladdr=<jason@***.net> (530/101), delay=00:01:00, xdelay=00:01:00, mailer=esmtp, pri=30827, relay=*****. [XX.XX.XX.X], dsn=4.0.0, stat=Deferred: Connection timed out with *****.

The ip it reports is the external ip.  How do I configure sendmail to send to the internal ip?
0
freejaso
Asked:
freejaso
  • 2
  • 2
1 Solution
 
jar3817Commented:
It's probably getting that IP from DNS, so to override that you could add an entry in the /etc/hosts file:

10.1.1.1    domain.com
10.1.1.1    mail.domain.com

You might have to restart sendmail after that...not sure.
0
 
jar3817Commented:
Actually a better would be to add the domain to the /etc/mail/mailertable file:

emaildomain.com     esmtp:[10.1.1.1]

This I know you'll have to remake the sendmail maps and restart it. This is the official way to override MX records and have mail for a specific domain sent to a specific IP.
0
 
freejasoAuthor Commented:
jar3817

I added in the following to /etc/mail/mailertable

mail.domain1.net    esmtp:[192.168.2.27]
mail.domain2.com    esmtp:[192.168.2.28]

Then did:
sudo makemap hash /etc/mail/mailertable < /etc/mail/mailertable
sudo /sbin/service sendmail restart

Logs still show mail is trying to send to external ip
0
 
freejasoAuthor Commented:
Oh... got it fixed: (Thanks a ton!)

needed to be:
domain1.net    esmtp:[192.168.2.27]
domain2.com    esmtp:[192.168.2.28]
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now