Sendmail relay

Posted on 2009-04-30
Last Modified: 2013-12-17
I have an application that tries to connect directly to the main smtp server but the connection occasionally times out. Therefore I want sendmail on the same server as the application to receive the messages and queue them, and then forward the mail to the main smtp server. I tried to setup Sendmail on Solaris 10 to forward messages to our main smtp server.

So what I did was change in the /etc/hosts file to point to ip address of the localhost.

I made a backup and the modified the file and then added the following two lines--
define(`SMART_HOST', '')dnl
I also create the /etc/mail/relay-domains file with the name of the to and from FQDNs. I then ran "make", and then moved the file to /etc/mail/ directory. I then restarted sendmail.

When I do a test with the command-- sendmail -v < /tmp/test.msg
The message goes to root's email with a message--
   ----- Transcript of session follows -----
553 5.3.5 config error: mail loops back to me (MX problem?)
554 5.3.5 Local configuration error

How can I set sendmail to accept and then forward email messages to another server given my situation?

Question by:jsfald
    LVL 26

    Accepted Solution

    "So what I did was change in the /etc/hosts file to point to ip address of the localhost."

    You shouldn't have to change anything in /etc/hosts, try getting rid of that line that points the domain back to localhost.

    LVL 1

    Author Closing Comment

    This is my new file, the main change was replacing mailhost with mainsmpt---
    VERSIONID(`@(#)      1.11 (Sun) 06/21/04')
    define(`confFALLBACK_SMARTHOST', `mainsmpt$?m.$m$.')dnl

    Then is still pointing to localhost. The fix to one other error I was getting-- Name server timeout -- was to fix the /etc/nsswitch.conf file. DNS was not setup so it needed to be removed from the .conf file.

    These changes allowed the application configuration to remain the same while allowing sendmail to be a middleman for the main smtp server---as was the subject to my question.

    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

    Automapping, a wonderful feature with Exchange 2010 (SP2 onwards I believe), allows additional/Shared mailboxes that a user has access to be automatically mapped on Outlook client, simplifying the process by adding them while Outlook launches. Ho…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

    734 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

    19 Experts available now in Live!

    Get 1:1 Help Now