LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 03-10-2011, 10:25 AM   #1
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
extracting a particular mail


hi all,

I just want to know is it possible to extract a single mail from the mail path i.e. /var/mail/root.

for ex. i am having this mail in /var/mail/root.


From root@localhost.localdomain Thu Mar 10 21:47:47 2011
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id p2AGHlx4004190
for <root@localhost.localdomain>; Thu, 10 Mar 2011 21:47:47 +0530
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id p2AGHlD5004189
for root@localhost.localdomain; Thu, 10 Mar 2011 21:47:47 +0530
Date: Thu, 10 Mar 2011 21:47:47 +0530
From: root <root@localhost.localdomain>
Message-Id: <201103101617.p2AGHlD5004189@localhost.localdomain>
To: root@localhost.localdomain
Subject: new

company test
requirement newinstance

XXXXXXXXXXXXXXXXXXXX

how to extract only this mail from /var/mail/root

can we do that with the help of date and time for that particular email.

if possible whats the code your suggestions please.

Your suggestions please.


Thanks&regards,
Dinesh.

Last edited by dinakumar12; 03-10-2011 at 10:28 AM.
 
Old 03-10-2011, 11:15 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
You could probably use sed and cut for something like that, using date and time like you said.
 
Old 03-10-2011, 11:57 PM   #3
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
hi,

yes,but can i get the exact code for that, i am also searching for this, mean while if any one got the code kindly post it.
 
  


Reply



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
SOLUTION for extracting pdf from e-mail Demerzel Programming 3 08-09-2010 12:31 PM
E-Mail Read Receipt E-Mail Delivery Status E-Mail tracking number. ytd Linux - Software 3 02-14-2009 04:02 AM
can mail command be used to send mail onto global mail servers like yahoo etc dale_chip Linux - Newbie 4 08-12-2008 08:33 AM
with the linux proxi, backend pop3 mail client can not receive mail and send mail rubin823 Linux - Networking 0 12-21-2006 10:06 PM
Extracting mail attachment filename Jinkzer Linux - Software 3 02-28-2004 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration