LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-03-2009, 09:57 AM   #1
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Rep: Reputation: 17
Question How to send internal e-mail on Linux, using the mail command?


Hy guys,

I'm studying for the LPI exam, and faced one simple (well, not that simple for me) question:

Quote:
Send an E-mail to your local account. Try two different ways to send and read it. How can you check that it really arrived?
I decided to try using the 'mail' and 'pine' commands. So:

1) Using the root account, intending to send an e-mail to myself (root):

Code:
# mail -s "Hello root!" root
Simple form of sending e-mails internally.
^D (this keystroke is to finish the e-mail)
EOT
2) Using 'pine', another e-mail client:

The mail is composed correctly, with 'To:' field set to:
Quote:
root@slack-VM.patree.com
which is my hostname, as my box runs in a VMWare Slack 12.2 image.

In both cases, nothing was received in my mailbox (by typing #mail)...
Additionally I don't see any new e-mails when I look at the file '/var/spool/mail/root'.

Do I need extra information configuring my mail client/server/service?

Thanks in advance!
sl33p
 
Old 06-03-2009, 03:36 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
Is your MTA running?
 
Old 06-04-2009, 09:52 AM   #3
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Original Poster
Rep: Reputation: 17
Hey, thanks for replying.

Well, I've searched the web for MTA[1] and found out:

Quote:
Internet mail is broken down into three basic parts:

1. MTA or Mail Transfer Agents - sendmail, qmail, etc
2. Mail Retrieval Software - pop3, imap, etc
3. Mail User Agent (MUA): E-Mail client - Netscape, MUTT, etc
This means I have to setup an MTA like sendmail as to send a simple e-mail to myself?


[1]http://www.yolinux.com/TUTORIALS/LinuxTutorialMailMTA.html
 
Old 06-04-2009, 12:03 PM   #4
saagar
Member
 
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 36
1. Just log in as root and type mail, and you should see lot of system-generated mails sent to root.
2.Next, find out how to check the status of the default MTA.
In RHEL5 it is,
service sendmail status
or service postfix status.
It should be running.
3.type netstat -ant | grep 25
it should give you a message something like
127.0.0.1:*

Restart the service.
4.Type
mail root
< type the message >
put a dot (.) to end the message and quit
5.now again type mail
you should see the mail sent to yourself...
thanks.
 
Old 06-04-2009, 12:35 PM   #5
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
backtrack's debian based.
so unless they screwed around a lot there (never know :P )

you can check via

sudo /etc/init.d/yourmta status
 
Old 06-04-2009, 02:05 PM   #6
sl33p
Member
 
Registered: Dec 2008
Location: Tahiti
Distribution: Kali Linux
Posts: 42

Original Poster
Rep: Reputation: 17
saagar,

Thanks man! I am using Slack 12.2 VMWare image, and by default Slack's MTA (sendmail at /etc/rc.d/rc.sendmail) is not started for my runlevel.

That's why I couldn't send any e-mail before. When I started the sendmail daemon, all the 20 messages on the queued appeared. lol

Once again, thanks!
 
Old 06-04-2009, 09:13 PM   #7
saagar
Member
 
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 36
ok. thanks a lot.
 
  


Reply

Tags
command, mail, pine


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian etch - Unable to send mail from command line or from php mail command lqforumuser Linux - Newbie 1 03-01-2009 07:56 AM
can mail command be used to send mail onto global mail servers like yahoo etc dale_chip Linux - Newbie 4 08-12-2008 09:33 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 07:37 AM
with the linux proxi, backend pop3 mail client can not receive mail and send mail rubin823 Linux - Networking 0 12-21-2006 11:06 PM
Cannot send mail with mail() command in PHP 4.3.4, Apache 2.0.48, Mandrake Linux 10 arcanum Linux - General 3 06-27-2004 07:06 PM


All times are GMT -5. The time now is 08:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration