[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Sheflug] Unique temporary filename
> Ah.
>
> I've just noticed why you want the filename.
>
> MIME parsers have already been done.
>
> Use MIME::Parser - it parses emails and can store attachments to
> a temporary
> file, or file with a specified name, or handle the whole lot in memory.
Fair point, but in this instance, it's a mail filter (sort of) that's run
out of the .courier (or .qmail) file where the incoming message is provided
on STDIN. I'm using reformime to get the mime data from the message, but
need to capture the message as I make several reformime calls (yeah - I
*know* it's inefficient :-) to get all the data. I'm not really interested
in extracting the file itself at the moment (although virus scanning may be
added on later :-), I only really need the disposition file names and the
mime types.
The trick was to get the incoming message in to a file in the first place so
I *could* use a package or tool to do the processing on it.
I'll have a look at MIME::Parser though. It may be more efficient than
multiple calls to reformime if it can return all I need on one pass.
Thanks, Baz.
--
David Morris
IT Manager, ALLVAC Ltd, Sheffield, UK
work: david [at] allvac.co.uk
home: david [at] brassedoff.net http://www.davidm.demon.co.uk
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.