--- mimex 2001/07/16 09:57:03 1.1 +++ mimex 2001/07/16 10:07:31 1.2 @@ -8,11 +8,14 @@ use MIME::Parser; -my $outdir = "/tmp/store"; -my $msgdir = "/tmp/mime$$"; # temp -my $to = "dpavlin@pliva.hr"; +my $outdir = "/data/store"; +my $msgdir = "/data/store/tmp/mime$$"; # temp +my $from = 'clipping-info@pliva.hr'; +my $to = 'clipdir@pliva.hr'; -print "From: Press Clipping \nSubject: Press Clipping update\n\n"; +open(MAIL,"| /usr/sbin/sendmail $to") || die "sendmail: $!"; + +print MAIL "From: Press Clipping <$from>\nSubject: Press Clipping update\n\n"; #------------------------------------------------------------ # dump_entity - dump an entity's file info @@ -28,7 +31,7 @@ # " (", scalar($ent->head->mime_type), ")\n"; if ($ent->head->mime_type =~ m,text/plain,i) { open(I,$ent->bodyhandle->path) || die "$ent->bodyhandle->path: $!"; - while() { print $_; } + while() { print MAIL $_; } close(I); unlink $ent->bodyhandle->path; } else { @@ -40,7 +43,7 @@ my $md5=md5_hex($new.time()); mkdir "$outdir/$md5",0755 || die "mkdir $outdir/$md5: $!"; rename $file,"$outdir/$md5/$new" || die "$file -> $md5 $new: $!"; - print "\nhttp://store.pliva.hr/$md5/$new\n"; + print MAIL "\n","-" x 76,"\nhttp://store.pliva.hr/$md5/$new\n"; } } } @@ -76,8 +79,3 @@ #------------------------------------------------------------ 1; - - - - -