/[clipping]/mimex
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /mimex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by dpavlin, Mon Oct 22 18:17:12 2001 UTC revision 1.6 by dpavlin, Wed Apr 17 10:28:41 2002 UTC
# Line 14  my $from = 'clipping-info@pliva.hr'; Line 14  my $from = 'clipping-info@pliva.hr';
14  my $to = 'clipdir@pliva.hr';  my $to = 'clipdir@pliva.hr';
15  my $log = "/data/store/mimex.log";  my $log = "/data/store/mimex.log";
16    
17  open(LOG,">> $log) || warn "log $log: $!";  umask 022;      # world readable
18    
19    open(LOG,">> $log") || warn "log $log: $!";
20    
21  open(MAIL,"| /usr/sbin/sendmail $to") || die "sendmail: $!";  open(MAIL,"| /usr/sbin/sendmail $to") || die "sendmail: $!";
22    
# Line 27  sub dump_entity { Line 29  sub dump_entity {
29      my $ent = shift;      my $ent = shift;
30      my @parts = $ent->parts;      my @parts = $ent->parts;
31    
32        my $md5=md5_hex(time());
33        mkdir "$outdir/$md5",0755 || die "mkdir $outdir/$md5: $!";
34    
35      if (@parts) {       # multipart...      if (@parts) {       # multipart...
36          map { dump_entity($_) } @parts;          map { dump_entity($_) } @parts;
37      } else {            # single part...      } else {            # single part...
# Line 43  sub dump_entity { Line 48  sub dump_entity {
48                  $new=~s/ +/_/g;                  $new=~s/ +/_/g;
49                  $new=~s/^.*\/([^\/]+)$/$1/g;                  $new=~s/^.*\/([^\/]+)$/$1/g;
50                  $new=~s/[^a-zA-Z._0-9]//g;                  $new=~s/[^a-zA-Z._0-9]//g;
                 my $md5=md5_hex($new.time());  
                 mkdir "$outdir/$md5",0755 || die "mkdir $outdir/$md5: $!";  
51                  rename $file,"$outdir/$md5/$new" || die "$file -> $md5 $new: $!";                  rename $file,"$outdir/$md5/$new" || die "$file -> $md5 $new: $!";
52                  print MAIL "\n","-" x 76,"\nhttp://store.pliva.hr/$md5/$new\n";                  print MAIL "\n","-" x 76,"\nhttp://store.pliva.hr/$md5/$new\n";
53                  print LOG "http://store.pliva.hr/$md5/$new\n";                  print LOG "$md5/$new\n";
54          }          }
55      }      }
56  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.26