473,568 Members | 2,898 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Breaking apart MBOX

I'm new to perl. I need to read in the mailbox (mbox) and break it apart
into seperate emails. Of course each email may be different lengths. Each
email starts with From, but there are other lines in the email starting with
From: (notice the colon). So, an email starts at From and ends at the
character prior to the next From.

I then need to store each email off into it's own file, numbered such as
00001, 00002, etc. there will be very many of these.

Any ideas.

Any help greatly appreciated.
Michael
Jul 19 '05 #1
1 2282
MJackson wrote:
I'm new to perl. I need to read in the mailbox (mbox) and break it
apart into seperate emails. Of course each email may be different
lengths. Each email starts with From, but there are other lines in
the email starting with From: (notice the colon). So, an email
starts at From and ends at the character prior to the next From.

I then need to store each email off into it's own file, numbered
such as 00001, 00002, etc. there will be very many of these.


Check out the read_mbox() function in the CPAN module Mail::Util.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1860
by: Paul Rubin | last post by:
I was surprised there was no obvious way with spamassassin (maybe I shoulda looked at spambayes) to split an existing mbox file into its spam and non-spam messages. So I wrote one. It's pretty slow, taking around 1.5 seconds per message on a 2 ghz Athlon, making me wonder how serious ISP's getting thousands of incoming messages per hour can...
2
3136
by: Brad Tilley | last post by:
Can Python parse a mbox file and forward each individual message within that file to someone else? For example, let's say I have a 10MB mbox file that has 678 messages. I'd like to send each of the messages to santa.claus@northpole.com... how might I do that? Also, how might I handle messages that have an attachment associated with them...
1
1802
by: John | last post by:
Hi I need to break a memo field apart by the individual lines of text it has. I only need the last two lines. How do I do this in a query? Thanks Regards
150
6438
by: tony | last post by:
If you have any PHP scripts which will not work in the current releases due to breaks in backwards compatibility then take a look at http://www.tonymarston.net/php-mysql/bc-is-everything.html and see if you agree with my opinion or not. Tony Marston http://www.tonymarston.net
1
1767
by: Michael March | last post by:
I am been playing with the 'email' and 'mailbox' modules trying to read in an email at a time from an mbox file, add something to the body of a message and then write that change back out in 'mbox' format again. Is there any code floating around out there that allows you to take a message from 'mailbox', modify it with 'email' and then write...
11
4547
by: Jonathan Pritchard | last post by:
Does anyone know of a library to read/write mbox format (used to store emails e.g. in Thunderbird) in ANSI C (cross platform is key)? Is there a more appropriate place to ask this? -- Reclaim Your Inbox! http://www.mozilla.org/products/thunderbird
0
1629
by: matej | last post by:
Hi, I am writing a script to convert couple of thousand emails (in couple of hundred folders) and before I will get to the hard part -- maintaing structure folders and subfolders, and maintaing record of the status of the message, I would like to be sure that I have at least maildir->mbox conversion right. Could anybody comment on the below...
4
2327
by: lstrudeman | last post by:
Hello; A friend gave me this syntax and they are unavailable at the moment and I need this asap. I am trying to figure out how SQL figures this out. Below the syntax takes a field in a file and breaks apart the pieces of the key for other uses. The field looks like this 1234567*AWD*07FA (or 1234567*FPER*07FA). I just need to understand how...
7
4784
by: Fabian Braennstroem | last post by:
Hi, I am wondering, if anyone tried to convert lotus nsf mails to a mbox format using python!? It would be nice, if anyone has an idea, how to do it on a linux machine. Regards! Fabian
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.