Not exactly, but you could probably cycle through the text file pushing each line into an array until you get a whole email and then send the array to your filter, or write it to a separate file, something along those lines. I wouldn't recommend split()ing it because you would end up having to cram the whole file into memory.
-----Original Message----- From: Joan Chyun To: '[EMAIL PROTECTED] ' Sent: 5/7/02 9:29 AM Subject: RE: Piping mail spool through a Perl script? At 11:18 PM 5/6/2002, you wrote: > >Is there a particular line or lines of text that delimits each email? Well, each email starts with the normal email header then the email body starts with the word "------------Identification-------------" but there are 15000 emails. So, splitting into an array? >-----Original Message----- >From: jc >To: [EMAIL PROTECTED] >Sent: 5/6/02 11:03 PM >Subject: Piping mail spool through a Perl script? > >Hello, > >I inherited a project where we use a procmail filter to filter emails as > >they come to our web server and pipe them through a perl script. The >script called "filterme" goes through the email line by line and grabs >information on the email, puts it into an array, and when it is >finished, >it appends the data collected to a file, (a log file of sorts). > >I have to redo this script to grab a different set of information, but I > >need to filter existing emails already in the mail spool. It was >suggested >to me that I could go to the mail folder (var/users/mail) and grab the >folder and then pipe all the files in the mail folder through the >"filterme" script. However, when I look at the mailspool folder, I only > >see one file that contains all the emails. I was wondering if there was >a >way to somehow parse this file and pipe the results through the >"filterme" >script. > >I realize I need more education in how email works and I am slowly >picking >through the sendmail book by O'Reilly. But if anyone knows a simple >answer >to this, I would be much obliged. > >Thanks in advance, > >Joan Chyun -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]