Mail command confusion


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Mail command confusion
# 1  
Old 03-18-2008
Mail command confusion

When i run this command on my linux machine:

mail -s "CVS ALERT-CRITCAL" sandy@xyz.com

The system hangs up producing a dead letter. What should i do to resolve this.

I am using :

mailx -s "CVS ALERT-CRITCAL" sandy@xyz.com

This cammnd works fine on another Linux machine but says" mailxcommand not found " in the first machine

Can someone guide me here please

Thanks,
Sandeep
# 2  
Old 03-18-2008
It waits for you to type in the mail body, and when you press ctrl-C to break out, it produces the dead.letter because you didn't finish the message.

mailx </dev/null if you don't want the message to have a body.

"command not found" typically means that the package which contains this command was not installed. Talk to the admin, or if the admin is you, talk to yourself.
era
# 3  
Old 03-18-2008
can you please let me know what this dev/null means.....(</dev/null)....also can you send the complete code?

Thanks again
Sandeep
# 4  
Old 03-18-2008
What is this doing in the "UNIX for Advanced & Expert Users" forum if you are unfamiliar with even the most basic features of the Unix shell??

Code:
mailx -s "I am a newbie" sandy@xyz.com </dev/null

era
# 5  
Old 03-18-2008
era,

I am not new to unix but i am only new to this command. I have written lot of shell scripts but never used something like </dev/null in my previous scripts. Most of the time my isssues have been complicated and hence i go this forum. Mistakingly this time ,since this being new thing i just went ahead and asked this in this forum.Thanks for the help anyways.

regards,
Sandeep
# 6  
Old 03-18-2008
Hi,

i used your command and it did not hang and it came to prompt
-----------------------------------------------------
mail -s "I am a newbie" sandy@xyz.com </dev/null
Null message body; hope that's ok
You have new mail in /var/spool/mail/root
-------------------------------------------------------

But i have not recieved any mail yet. when i checked in /var/spool/mail/root i found this in the root file:


From root@blr.xyz.com Tue Mar 18 23:40:00 2008
Return-Path: <root@blr.xyz.com >
Received: from root@blr.xyz.com (localhost.localdomain [127.0.0.1])
by root@blr.xyz.com
(8.12.8/8.12.8) with ESMTP id m2IIA0Jb007195
for <root@blr.xyz.com>; Tue, 18 Mar 2008 23:40:00 +0530
Received: (from root@localhost)
by root@blr.xyz.com (8.12.8/8.12.8/Submit) id m2IIA0xi007193
for root; Tue, 18 Mar 2008 23:40:00 +0530
Date: Tue, 18 Mar 2008 23:40:00 +0530
Message-Id: <200803181810.m2IIA0xi007193@root@blr.xyz.com >
From: root@blr.xyz.com (Cron Daemon)
To: root@blr.xyz.com
Subject: Cron <root@blr> /usr/lib/sa/sa1 1 1
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

Cannot open /var/log/sa/sa18: No such file or directory




please help
# 7  
Old 03-18-2008
As far as I can tell you have a cron job /usr/lib/sa/sa1 1 1 which produced this output. It seems unrelated to your question.
era
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. UNIX for Advanced & Expert Users

Unable to send mail with 'mail' command

I am unable to cause the 'mail' command to send mail from my linux ubuntu 15.10 computer. File 'mail.log' typically reports Connection timed out. I issue the command: mail -s "my subject" recipient@domain.com < filenamewhere filename is a file containing my message. Specifically, the... (3 Replies)
Discussion started by: tcnm
3 Replies

3. Homework & Coursework Questions

Creating a function that sends a mail using mail command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Discussion started by: Drucian
1 Replies

4. UNIX for Dummies Questions & Answers

Confusion with echo command under csh shell

HI, guys, I am having some problem with the echo command, so I want to echo some text to a file name loginFile, the result inside the loginFile should looks like: expect ">" so what I did is: echo "expect "">""" >> $loginFile but it just gave out: expect > The thing is I still need... (2 Replies)
Discussion started by: warmboy610
2 Replies

5. Shell Programming and Scripting

Not able to send the mail using mail and mailx command

Hi All, I am trying to send a mail from linux server but could'nt able to send the mail. I tried the below syntax's so far but no luck. mail -s “Hello world” abc@xyz.com < /usr/g/txt.log cat "txt.log" | mailx -s "Hello world" abc@xyz.com mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies

6. Fedora

Need to send mail using mail command

Hi Guys, Am tried with the mail & mailx command to send mail to other localhost machine, Which are all connected in a LAN. I can not able to send, Either it wont display any error message at that time and later am receiving a failure mail.. But i can send and receive (from-to) in my machine..... (28 Replies)
Discussion started by: Adhi
28 Replies

7. UNIX for Dummies Questions & Answers

[Query] Confusion of the Swap when using 'free -m' command

Hi All, I have just installed my first Linux server ( Ubuntu 11.10 ). I am sure I didn't allocate /swap , and double check by 'df -h', yes really no /swap but when I use 'free -m' , returned a "Swap" line as below. total used free shared buffers cached Mem: ... (3 Replies)
Discussion started by: joaming
3 Replies

8. Shell Programming and Scripting

Not able to receive mail using mail command

Hi all, I have written a script which supposed send a mail. For testing I am just sending mails to my ID. script I have written to send mail is- #!/usr/bin/ksh MAIL_FILE="$HOME/MAIL_FILE" MAILOUT_LIST="milindb@example.com" mail -s "Subject" $MAILOUT_LIST < $MAIL_FILE if then echo... (6 Replies)
Discussion started by: milindb
6 Replies

9. Solaris

identify the mail server for mail command

Hi , I am new to unix , i am using the mail and mailx command to send the mail .How come i will know the my mail command using which server as mail box.. Please help me .. Thanks in advance (1 Reply)
Discussion started by: julirani
1 Replies

10. UNIX for Dummies Questions & Answers

wc command confusion

Can somebody explain it to me that why wc gives more chars suppose Ab.txt have two lines qwer qasd then wc -c ab.txt will give 10.why not 8.okay may be it is taking count one for each line just in case but why echo "qwer"|wc -C gives 5. Ok with \c it is returning 4. :) (6 Replies)
Discussion started by: Dhruva
6 Replies
Login or Register to Ask a Question