i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail.
actually i am trying to automate the high cpu usage and disk usage cases , So that i can recieve mail if the server is NOK.
Although its not a 100% solution but its working .
Just add your mail server address in /etc/hosts
12.115.40.19 amit.com
then check you are able to connect to the mail sever @smtp port (25)
bash-3.00# telnet amit.com 25
Trying 12.115.40.19 ...
Connected to amit.com.
Escape character is '^]'.
220 mumrel002.emea.amit-intra.net ESMTP generic mail handler
quit
221 2.0.0 mumrel002.emea.amit-intra.net closing connection
Then if everything is ok you can send the mail using this simple script from your machine. This is used by me on solaris 10 machine , you can adapt it to any other OS.
#!/bin/ksh
auser=` who am i | awk '{print $1}'`
hname=`hostname`
( echo open amit.com 25
echo "HELO nsn.com"
echo "MAIL FROM:<$auser@$hname>"
echo "RCPT TO:<amit.ranjan.sahu@amit.com>"
echo "RCPT TO:<amit@amit.com>"
echo "DATA"
echo "what ever you want to send"
echo "."
echo "quit" ) | telnet
connect to ip with user and pwd.
echo "$data" |mailx -s "subject" "amit.com"
this will data to mail..
regrds
rajesh