peterr has asked for the wisdom of the Perl Monks concerning the following question:
1. Open the distribution list file (D:\Pmail\mail\list25B6.pml), and read it into an array. The file looks like this and has CR/LF's.
\TITLE Email Distribution \SENDER Peter Rabbitt <peterr@example.com> \NOSIG Y John & Jenny Arnold <johnarnold@somedomain.com> David & Jan Barker <jbarker@someotherdomain.org> etc,etc
There are about 300 records in the file.
2. Open the list of all the email folders, this is stored in a file called hierarch.pm, format as follows:
2,1,"70937460:My mailbox","","My mailbox" 0,0,"750EE41A:1A94:FOL07093","70937460:My mailbox","Main" 0,0,"6670FCDB:1A95:FOL04816","70937460:My mailbox","Sent" 1,1,"0E457462:Developer","70937460:My mailbox","Developer" 0,0,"46FBE5F3:1A97:FOL024EB","0E457462:Developer","Microsoft"
This file also has CR/LF's. Any record starting with a value "0,0" is an email folder record, all the other are just logical representations of the email hierarchy (trays,etc). It is the email folder records that tell me the filename, for example, the second record shown above, is the "Main" folder, but at DOS is FOL07093.PMM
3. I then need to parse through every email folder, and look for any email headers with "From:" or "To:" , extract the email address, and if it isn't in the array from step 1, then put the details out to a file (or an array would be wiser, to check for dups as I parse through, then at the end, write out a file).
Some "To:" records could have multiple email addresses I guess, so I need to cater for that.
I have looked through examples and documentation on MIME::Parser, MIME::Tools and Mail::Address , but don't know which modules would be best suited for this type of work. I'm running it on a Win32 box, with Active state Perl, version 5.61
I'm a newbie to Perl, so please be nice to me. :)
Thanks,
Peter
|
---|