in reply to Detachments II: The Sequel

  1. Hints for a name are in Content-Disposition and sometimes Content-Type fields under various attribute names. However, there are many security risks with using these names. However, if you want to unpack HTML messages with images automatically, you will need to use these names.
  2. ...
  3. Don't know for sure, but probably the content of the preamble and epilogue are written to a separate file as well.
  4. You can do this with Mail::Box
    use Mail::Message; use File::Temp; my $dir = tempdir; mkdir $dir or die; foreach my $p ($message->parts) { my $fn = $part->dispositionFilename($dir); $part->decoded->write(filename => $fn) or die "Couldn't write to $fn: $!\n"; }
  5. Yes

20031110 Edit by Corion: Changed PRE to CODE tags, closed list

Replies are listed 'Best First'.
Re: Detachments II: The Sequel
by Anonymous Monk on Nov 10, 2003 at 09:47 UTC
    Script in (4) lacks one line:
    my $message = Mail::Message->read(\*STDIN);
    
    See Mail::Box-Index for additional features.
    Mark Overmeer (who is waiting for an entrance password for the Monastry)