!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/share/doc/perl-Mail-Box/examples/   drwxr-xr-x
Free 6181.76 GB of 6262.96 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     unpack.pl (2.03 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl
#
# Read a message from stdin, for instance from a '.forward' file
#       | unpack.pl
# The files get unpacked.

# This code can be used and modified without restriction.
# Mark Overmeer, <mailbox@overmeer.net>, 29 jan 2010

use warnings;
use strict;

use Errno  'EEXIST';
use POSIX  'strftime';

use Mail::Message  ();
use MIME::Types    ();

### configure this:
my $workdir = '/tmp/incoming';

# create the common work directory
-d $workdir
    or mkdir $workdir
    or die "cannot create unpack directory $workdir: $!\n";

# Create a unique unpack directory for this message
# More than one message can arrive in a second, even in parallel
my $unpackdir;
my $now = strftime "%Y%m%d-%T", localtime;

UNIQUE:
for(my $unique = 1; ; $unique++ )
{   $unpackdir = "$workdir/$now-$unique";
    mkdir $unpackdir and last;
    $!==EEXIST
        or die "cannot create unpack directory $unpackdir: $!";
}

# Read the message from STDIN
my $from_line = <>;    # usually added by the local MTA
my $msg = Mail::Message->read(\*STDIN);

# Shows message structure
# $msg->printStructure;

my $mime_types = MIME::Types->new;
my $partnr     = '00';

foreach my $part ($msg->parts('RECURSE'))
{   my $body     = $part->decoded;
    my $type     = $mime_types->type($body->mimeType);

    # some message parts will contain a filename
    my $dispfn   = $body->dispositionFilename || '';
    my $partname = $partnr++ . (length $dispfn ? ".$dispfn" : '');

    # try to find a nice filename extension if not yet known
    unless($partname =~ /\.\w{3,5}$/)
    {   my $ext    = $type ? ($type->extensions)[0] : undef;
        $partname .= ".$ext" if $ext;
    }

    my $filename  = "$unpackdir/$partname";
#print "$filename\n";

    if($type->isBinary)
    {   open OUT, '>:raw', $filename
           or die "cannot create binary part file $filename: $!";
    }
    else
    {   open OUT, '>:encoding(utf-8)', $filename
           or die "cannot create text part file $filename: $!";
    }

    $body->print(\*OUT);
    close OUT
        or warn "write errors to $filename: $!";
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.021 ]--