On Fri, 29 May 2009 23:40:52 -0400 Vince Sabio <vi...@vjs.org> wrote:

 > I have a need (well, I have lots of needs, but I'll try to stay 
 > focused here) to be able to take a Windows zip file that is stored as 
 > a MIME attachment to an e-mail message in an Mbox-format spool file, 
 > and unzip the attachment. I actually need to script the process. In 
 > case it helps, I can dedicate a mailbox to the task. If necessary, I 
 > can write my own parser to strip out the attachment, in which case 
 > I'd need only a widget that can take in a MIME (base64) encoded zip 
 > file, convert it to binary, and unzip it.
 > 
 > Anyone know of any FreeBSD utility(ies) that do(es) this?

/usr/ports/converters/mpack
/usr/ports/archivers/unzip

You could first export/save each such message to a separate file and run 
munpack(1) on it to extract any base64 attachment/s, then unzip(1) any 
identifiable zipfiles.  You can most likely rely on the return code from 
'unzip -t $file' to check any files are valid zipfiles, if munpack can't 
recover the original filename from the MIME headers.

cheers, Ian
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to