Configure mailx in Solaris 10

Hello,

We are using exchange server in our environment. I need to configure mailx to send email from Solaris box to one mail I'd which is on exchange server. I know ip of exchange server.. Let me know where should I configure that ip to do the needful?

In Solaris it is probably most easy to define a host alias mailhost for your mail server's IP-addr.

getent mailhost

should state the IP-addr.
If you use a DNS server, this is the place to define the mailhost .
If you have many Solaris systems, and they use DNS, then they all will send to it.
If you don't use DNS, you can define mailhost in /etc/inet/hosts.
--
As an alternative, you can put the mailserver behind the DS entry in /etc/mail/sendmail.cf with no space, like DSservername .
It might be that servername can be an IP-address, otherwise you need to map one in DNS or /etc/inet/hosts.
After a change in /etc/mail/sendmail.cf you need to restart the service with

svcadm restart sendmail

Hi

Thanks for reply. I condifured sendmail with exchange server IP but mail is not getting delivered. Please find below error

bash-3.2# echo "testmail" | mailx -vvv -s "fromsolaris" abc@xyz.com
You have new mail in /var/mail/root
bash-3.2# abc@xyz.com... Connecting to [127.0.0.1] via relay...
220 hostname.xcv.zsd.AFF ESMTP Sendmail 8.14.5+Sun/8.14.5; Fri, 22 Jan 2016 14:57:54 +0530 (IST)
>>> EHLO hostname.xcv.zsd.AFF
250-hostname.xcv.zsd.AFF Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<root@hostname.xcv.zsd.AFF> SIZE=84
250 2.1.0 <root@hostname.xcv.zsd.AFF>... Sender ok
>>> RCPT To:<abc@xyz.com>
>>> DATA
250 2.1.5 <abc@xyz.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <abc@xyz.com>... Connecting to 10.10.1.13 via relay...
050 220 mailserverdomainname.com Microsoft ESMTP MAIL Service ready at Fri, 22 Jan 2016 14:57:53 +0530
050 >>> EHLO hostname.xcv.zsd.AFF
050 250-ailserverdomainname.com Hello [10.5.2.14]
050 250-SIZE
050 250-PIPELINING
050 250-DSN
050 250-ENHANCEDSTATUSCODES
050 250-STARTTLS
050 250-X-ANONYMOUSTLS
050 250-AUTH NTLM
050 250-X-EXPS GSSAPI NTLM
050 250-8BITMIME
050 250-BINARYMIME
050 250-CHUNKING
050 250-XEXCH50
050 250-XRDST
050 250 XSHADOW
050 >>> STARTTLS
050 220 2.0.0 SMTP server ready
050 >>> EHLO hostname.xcv.zsd.AFF
050 250-mailserverdomainname.com Hello [10.5.2.14]
050 250-SIZE
050 250-PIPELINING
050 250-DSN
050 250-ENHANCEDSTATUSCODES
050 250-AUTH NTLM LOGIN
050 250-X-EXPS GSSAPI NTLM
050 250-8BITMIME
050 250-BINARYMIME
050 250-CHUNKING
050 250-XEXCH50
050 250-XRDST
050 250 XSHADOW
050 >>> MAIL From:<root@hostname.xcv.zsd.AFF> SIZE=428
050 250 2.1.0 Sender OK
050 >>> RCPT To:<abc@xyz.com>
050 >>> DATA
050 250 2.1.5 Recipient OK
050 354 Start mail input; end with <CRLF>.<CRLF>
050 >>> .
050 550 5.7.1 Anonymous client does not have permissions to send as this sender
050 <root@abc@xyz.com>... Connecting to local...
050 220 hostname LMTP ready
050 >>> LHLO OTTPSR5CWEB03.aiu.aig.AIUMEMSA
050 250-hostname
050 250-8BITMIME
050 250-ENHANCEDSTATUSCODES
050 250 PIPELINING
050 >>> MAIL From:<>
050 250 2.5.0 ok
050 >>> RCPT To:<root>
050 >>> DATA
050 250 2.1.5 ok
050 354 go ahead
050 >>> .
050 250 2.1.5 root OK
050 <root@hostname.xcv.zsd.AFF>... Sent
250 2.0.0 u0M9RsaI028723 Message accepted for delivery
abc@xyz.com... Sent (u0M9RsaI028723 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 hostname.xcv.zsd.AFF closing connection