Sending email from solaris 9 system


 
Thread Tools Search this Thread
Operating Systems Solaris Sending email from solaris 9 system
# 1  
Old 03-21-2009
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.
Code:
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
Code:
mailx aemunathan.r@gmail.com
Subject : test
test mail
EOT

output of the mailq command is as follows
Code:
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
Code:
/usr/lib/sendmail aemu.real@gmail.com
Subject : test
test mail
.

result is:
Code:
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:

Quote:
This is a MIME-encapsulated message

--n2LBcxsg010829.1237635539/rtmssrv1.com

The original message was received at Sat, 21 Mar 2009 17:08:59 +0530 (IST)
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<aemunathan@bsnl.co.in>

----- Transcript of session follows -----
550 5.1.2 <aemunathan@bsnl.co.in>... Host unknown (Name server: mailhost.com: host not found)

--n2LBcxsg010829.1237635539/rtmssrv1.com
Content-Type: message/delivery-status

Reporting-MTA: dns; rtmssrv1.com
Received-From-MTA: DNS; localhost
Arrival-Date: Sat, 21 Mar 2009 17:08:59 +0530 (IST)

Final-Recipient: RFC822; aemunathan@bsnl.co.in
Action: failed
Status: 5.1.2
Remote-MTA: DNS; mailhost.com
Last-Attempt-Date: Sat, 21 Mar 2009 17:08:59 +0530 (IST)
Where am making mistakes....??/

Last edited by aemunathan; 03-21-2009 at 02:53 PM..
# 2  
Old 03-21-2009
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

Last edited by TonyFullerMalv; 03-21-2009 at 03:24 PM..
# 3  
Old 03-21-2009
hi
Am getting default server not available for the nslookup. . . ,
Quote:
*** Can't find server name for address 64.233.161.83: No response from server
*** Default servers are not available
Quote:
<root@rtmssrv1:/>echo "test mail 1" | mailx -v -s "test mail 1" aemunathan@bsnl.co.in
<root@rtmssrv1:/>aemunathan@bsnl.co.in... Connecting to [127.0.0.1] via relay...
220 rtmssrv1.com ESMTP Sendmail 8.12.10+Sun/8.12.10; Sun, 22 Mar 2009 09:00:28 +0530 (IST)
>>> EHLO rtmssrv1.com
250-rtmssrv1.com 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
>>> MAIL From:<root@rtmssrv1.com> SIZE=79
250 2.1.0 <root@rtmssrv1.com>... Sender ok
>>> RCPT To:<aemunathan@bsnl.co.in>
>>> DATA
250 2.1.5 <aemunathan@bsnl.co.in>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 n2M3USsg011546 Message accepted for delivery
aemunathan@bsnl.co.in... Sent (n2M3USsg011546 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 rtmssrv1.com closing connection
the sendmail.cf contains a line like this
Code:
# "Smart" relay host (may be null)
DSmailhost$?m.$m$.

Should i edit this one?

Last edited by aemunathan; 03-22-2009 at 12:54 AM..
# 4  
Old 03-22-2009
Looks like the DNS servers your system is using are down, if you run:
Code:
$ 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.:
Code:
1.2.3.4 mailservername mailhost

All the same you really need DNS to be working anyway!
# 5  
Old 03-23-2009
Hi

The nameservers are correct.
Quote:
<root@rtmssrv1:/>cat /etc/resolv.conf
nameserver 4.2.2.2
nameserver 218.248.240.208
<root@rtmssrv1:/>
and am reachable ..both the IPs
Quote:
<root@rtmssrv1:/>ping 4.2.2.2
4.2.2.2 is alive
<root@rtmssrv1:/>ping 218.248.240.208
218.248.240.208 is alive
<root@rtmssrv1:/>
<root@rtmssrv1:/>ping gmail.com
gmail.com is alive
<root@rtmssrv1:/>
What is the big mistake am doing i dont know....

Quote:
<root@rtmssrv1:/>echo "test mail 2" | mailx -v -s "test mail 2" aemunathan.r@gmail.com
<root@rtmssrv1:/>aemunathan.r@gmail.com... Connecting to [127.0.0.1] via relay...
220 rtmssrv1.com ESMTP Sendmail 8.12.10+Sun/8.12.10; Mon, 23 Mar 2009 13:36:01 +0530 (IST)
>>> EHLO rtmssrv1.com
250-rtmssrv1.com 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
>>> MAIL From:<root@rtmssrv1.com> SIZE=80
250 2.1.0 <root@rtmssrv1.com>... Sender ok
>>> RCPT To:<aemunathan.r@gmail.com>
>>> DATA
250 2.1.5 <aemunathan.r@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 n2N861sg012273 Message accepted for delivery
aemunathan.r@gmail.com... Sent (n2N861sg012273 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 rtmssrv1.com closing connection

<root@rtmssrv1:/>mailq
/var/spool/mqueue (9 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
n2N861sg012273* 12 Mon Mar 23 13:36 <root@rtmssrv1.com>
<aemunathan.r@gmail.com>
# 6  
Old 03-23-2009
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.:
Code:
10.20.30.40 mailserver.foo.bar mailhost

Restart sendmail and try again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending email in UNIX

can you tell me what is the syntax if I need to keep someone in cc with the below email. mailx -s "shell script completed successfully" arun@gmail.com < /dev/null (4 Replies)
Discussion started by: ramkumar15
4 Replies

2. Shell Programming and Scripting

Sending an email if system disk space is low

Hello i have a working script that sends me an email if system disk space is above 98%. I would like to add an extra command to the if condition. If disk space is above 98% it would also add an output of cd /var/log && du -sBM * |sort -n 2>&1 |grep -v -e "0M" -e "1M" command to the email. I'm... (2 Replies)
Discussion started by: taf130
2 Replies

3. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

4. UNIX for Advanced & Expert Users

Sending email to different domain

Hi, I am looking for info based on direct experience in using DataStage EE with Unix. A scenario in the client remote desktop I work for company Switch, my client is Master. Notification Activity Stage (IBM Asential Data Stage component) SMTP Mail server name is blank. Sender... (1 Reply)
Discussion started by: dsnaveen
1 Replies

5. Linux

sending an email

I have used an already-built ActiveX control to send email from my asp web pages. One of the parameters I fill is FromName which defines the tittle the recipient will see in the From entrance in his Inbox. Now Iīm trying to use mail to send an email from a Shell but I havenīt found the... (1 Reply)
Discussion started by: RandomAccess
1 Replies

6. Shell Programming and Scripting

Sending email from Unix

I am using the following syntax to send an e-mail from Unix (Sun OS). mail -s "hello" abc@yahoo.com But, when I click enter after typing this command, its not exiting and after a while when I give ctrl+c it creates a dead.letter file in my $HOME dir. Can anyone please tell me, if I have to... (7 Replies)
Discussion started by: rajesh8s
7 Replies

7. Shell Programming and Scripting

Error while sending email from solaris

Dears, I have tried to send email, but i have following error. 051 mydomain.net: Name server timeout i have add following line to /etc/resolv.conf domain mydomain.net But didn't work, i didn't configure anything else .. Do i need to configure anything else ???? root#xxx@mydomain.net...... (0 Replies)
Discussion started by: Danish Shakil
0 Replies

8. UNIX for Dummies Questions & Answers

sending email

hi, is there any possiblity to send email from the command prompt, for eg i want to send alert to any mail id like /data/logs is 80% to my hotmail account , xxx@hotmail.com is this really possible,, if not, then what are the prerequistes need to do this (1 Reply)
Discussion started by: vasikaran
1 Replies

9. UNIX for Dummies Questions & Answers

Sending email

I have an Solaris 8 machine running a managment application. One of the features of this application is to configure alarm forwarding to an email undress. When i configured the application to do that, it asked me only about the recipient email address. Quesiton: how to configure my Solaris 8... (7 Replies)
Discussion started by: bcheaib
7 Replies

10. UNIX for Dummies Questions & Answers

sending email from mailx

hi can i know how to use mailx to send email to my lotus email account? i wan to send a file in a directory as an attachment and then email to lotus. can show me the command line to do it? thanks a lot (1 Reply)
Discussion started by: legato
1 Replies
Login or Register to Ask a Question