Sendmail relay

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 mailhost.mydomain.com in the /etc/hosts file to point to ip address of the localhost.

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

When I do a test with the command-- sendmail -v me.name@mydomain.com < /tmp/test.msg
The message goes to root's email with a message--
   ----- Transcript of session follows -----
553 5.3.5 mailhost.mydomain.com 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?

Thanks!
LVL 1
jsfaldAsked:
Who is Participating?
 
jar3817Commented:
"So what I did was change mailhost.mydomain.com 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.



0
 
jsfaldAuthor Commented:
This is my new sendmail.mc file, the main change was replacing mailhost with mainsmpt---
divert(0)dnl
VERSIONID(`@(#)sendmail.mc      1.11 (Sun) 06/21/04')
OSTYPE(`solaris8')dnl
DOMAIN(`solaris-generic')dnl
define(`confFALLBACK_SMARTHOST', `mainsmpt$?m.$m$.')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl

Then mailhost.mydomain.com 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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.