Extracting ALL of the attachments from a mailing list

Kelsay, Brian - Kansas City, MO brian.kelsay at kcc.usda.gov
Fri Apr 29 07:27:23 CDT 2005



>-----Original Message-----
>From: kclug-bounces at kclug.org [mailto:kclug-bounces at kclug.org] 
>On Behalf Of Jeremy Turner

>
>
>On Thu, 2005-04-28 at 17:44 -0500, Gerald Combs wrote:
>> Before I start rolling my own solution, does anyone know of 
>a utility or
>> collection of utilities that will
>> 
>>   1) Extract all of the MIME attachments from a mailing list archive,
>
>You might check out uudeview or mpack
>http://www.fpx.de/fp/Software/UUDeview/
>No URL for mpack.  In the Debian package, the author says of mpack says
>to use uudeview.
>
>>   2) Extract the files from any archived (tar|zip|rar|...) 
>attachments,
>
>I assume once you extract the files from your mail archives and remove
>any duplicates, it would be trivial to run a loop on all files you
>extracted:
>
><pseudo-code>
>if $extension eq ".tar.gz" or $extension eq ".tgz"
>then
>	tar xvfz $filename
>else if $extension eq ".tar.bz2" or $extension eq ".tbz2"
>then
>	tar xvfj $filename
>else if $extension eq ".zip"
>then
>	unzip $filename
>end if
></pseudo-code>
>
>>   3) Move each extracted file to a specific directory, renaming it if
>>      there's a naming collision, and
>
>uudeview does this.
>
>>   4) Remove any duplicate files.
>
>Maybe an MD5sum hash table to check for duplicates?
>
>Jeremy
>

Wouldn't you want to check for dups. before you extract and mv to a dir?
Or extract to dir., compare to final destination dir. And then mv file.
You may want to compare filenames and dates to keep the newest or oldest
file based on preference.


More information about the Kclug mailing list