LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-08-2008, 02:16 PM   #1
oskeewow
LQ Newbie
 
Registered: Apr 2008
Location: Greater Chicago
Distribution: Centos, SuSE, RHEL..etc..
Posts: 9

Rep: Reputation: 0
How to dump emails to files?


Hello! I'm trying to come up with a script to extract data from emails. I have many servers in different cities emailing stats to a server at home office. Now I need a script to sort each mail by cities and dump data to separate files. My initial approach is to run a script to process /var/mail/mystat. "mystat" being the unique account setup just for this purpose. Using bunch of shell commands in a script, I am trying to generate separate files. What I am wondering is...Is there a more elegant way to do this? Or is this the pretty much the only approach one can take? Thanks for yoru time!
 
Old 04-08-2008, 02:22 PM   #2
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
A better approach is probably to set up a mail alias to a script that will parse each email as it arrives and then does what you want with the data that is parsed.

HTH

Forrest
 
Old 04-08-2008, 05:31 PM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You could either use Maildir format in which each message is a separate file, or at lease use a mbox to maildir converter to convert the mbox file into separate files as the first step in your procerssing
 
  


Reply


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
Script to dump and restore rrd files 0.o Programming 2 12-31-2007 12:07 PM
splitting pcap dump files captgoodnight Linux - Security 4 07-27-2004 12:12 AM
Kismet dump files heather213186 Linux - Wireless Networking 1 05-19-2004 08:30 PM
How do I dump sound files from my kernel ic3 Linux - Newbie 1 11-16-2003 07:23 PM
Dump and open files mnauta Linux - General 1 09-17-2003 08:56 PM


All times are GMT -5. The time now is 01:20 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration