Sending email from solaris 9 system

hi

i read threads for sending email to public mail ids like gmail.com, yahoo.com from solaris 9 system but i could not succeed.

can some body help me out.

I have tried following method for DNS config.

touch /etc/resolv.conf
vi /etc/resolv.conf 
nameserver 4.2.2.2
nameserver 218.248.240.208
cp nsswitch.dns /etc/nsswitch.conf

am able to ping public domains now..

tried sending mail using mailx

mailx aemunathan.r@gmail.com
Subject : test
test mail
EOT

output of the mailq command is as follows

n2LBwHsg010847       64 Sat Mar 21 17:28 <root@rtmssrv1.com>
                 (Deferred: Connection timed out with gmail.com)
                                         <aemunathan.r@gmail.com>

another try i made it with

/usr/lib/sendmail aemu.real@gmail.com
Subject : test
test mail
.

result is:

n2LH8jsg011156       37 Sat Mar 21 22:38 <root@rtmssrv1.com>
                 (Deferred: Connection timed out with gmail.com)
                                         <aemu.real@gmail.com>

Response from the host is:

Where am making mistakes....??/

Try running:
$ nslookup -query=mx

Then enter the domain you are trying to send mail to (e.g. gmail.com) you should a list of mail exchangers listed, if not then for Solaris 8 you could put a line in /etc/hosts with an alias of mailhost so that your knows what mail server to send to, not sure of Solaris 9.

If you run:
$ echo "Test Message" | mailx -v -s "test message" aemu.real@gmail.com

Then mailx will will show you it sending the mail, talking to the mailserver and to what mailserver it is talking, because of the -v for verbose.

HTH

Tony

hi
Am getting default server not available for the nslookup. . . ,

the sendmail.cf contains a line like this

# "Smart" relay host (may be null)
DSmailhost$?m.$m$.

Should i edit this one?

Looks like the DNS servers your system is using are down, if you run:

$ cat /etc/resolv.conf

and you can see 64.233.161.83 in one of the nameserver lines then that confirms it.

If 64.233.161.83 is in /etc/resolv.conf but is pingable then the DNS server process (named for Unix) is not working, if it is not pingable then perhaps the wrong IP addresses are in /etc/resolv.conf for the DNS servers?

At the moment your email is staying locally on the machine (127.0.0.1), unless /var/mail is NFS mounted from a mail server.

I'm no sendmail expert but the sendmail.cf file means that if you did know the IP address of your mailserver you could addit to your hosts file with a mailhost alias, e.g.:

1.2.3.4 mailservername mailhost

All the same you really need DNS to be working anyway!

Hi

The nameservers are correct.

and am reachable ..both the IPs

What is the big mistake am doing i dont know....

As suspected your mail is staying local to the machine hence seeing it in /var/spool/mqueue, suggest you therefore put your network's mailserver that the mail should be forwarded to into /etc/hosts with the alias of mailhost, e.g.:

10.20.30.40 mailserver.foo.bar mailhost

Restart sendmail and try again.