Sendmail - point to local ip rather than external

Posted on 2010-01-07
Last Modified: 2013-12-17
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?
Question by:freejaso
    LVL 26

    Expert Comment

    It's probably getting that IP from DNS, so to override that you could add an entry in the /etc/hosts file:

    You might have to restart sendmail after that...not sure.
    LVL 26

    Accepted Solution

    Actually a better would be to add the domain to the /etc/mail/mailertable file:     esmtp:[]

    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.

    Author Comment


    I added in the following to /etc/mail/mailertable    esmtp:[]    esmtp:[]

    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

    Author Comment

    Oh... got it fixed: (Thanks a ton!)

    needed to be:    esmtp:[]    esmtp:[]

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Microsoft Outlook is not just an email client but it is full featured Personal Information Manager. But sometimes Outlook gets disconnected and you simply can’t access it. What steps can you perform before calling IT support? In this article we will…
    Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
    In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now