/[sap_import]/mail2sap.pl
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 /mail2sap.pl

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

revision 1.7 by dpavlin, Tue Nov 19 18:20:55 2002 UTC revision 1.8 by dpavlin, Tue Feb 4 13:03:07 2003 UTC
# Line 22  my $outdir = $config->{outdir} || die "c Line 22  my $outdir = $config->{outdir} || die "c
22  # temporary directory (ON SAME FILESYSTEM AS $outdir -- we use rename!)  # temporary directory (ON SAME FILESYSTEM AS $outdir -- we use rename!)
23  # for extraction of *ALL* attachements  # for extraction of *ALL* attachements
24  my $msgdir = $config->{msgdir} || die "config: no <msgdir> defined";  my $msgdir = $config->{msgdir} || die "config: no <msgdir> defined";
25    my $mntdir = $msgdir;
26    $msgdir .="/mime";
27  $msgdir .= "$$";        # append PID to make it unique  $msgdir .= "$$";        # append PID to make it unique
28  my $log = $config->{log} || die "config: no <log> defined";  my $log = $config->{log} || die "config: no <log> defined";
29    
# Line 62  sub dump_entity { Line 64  sub dump_entity {
64                  $new .= $suffix;                  $new .= $suffix;
65    
66                  rename $file,"$outdir/$new" || die "move $file -> $outdir/$new: $!";                  rename $file,"$outdir/$new" || die "move $file -> $outdir/$new: $!";
67                  print LOG scalar localtime," $new\n";                  my $prog = $0;
68                    $prog =~ s/^.*\/([^\/])+$/$1/g;
69                    print LOG scalar localtime," $prog $new\n";
70    
71                  # now, call SAP rfc                  # now, call SAP rfc
72    
# Line 104  sub dump_entity { Line 108  sub dump_entity {
108  sub main {  sub main {
109          my $file;          my $file;
110          my $entity;          my $entity;
111            
112          mkdir $msgdir,0755 || die "can't create $msgdir: $!";          chdir ($mntdir) || die "can't chdir to $mntdir: $!";
113            mkdir ($msgdir,0755) || die `id`."can't create $msgdir: $!";
114          die "problems with creation of directory $msgdir: $!" if (! -w $msgdir);          die "problems with creation of directory $msgdir: $!" if (! -w $msgdir);
115    
116          my $parser = new MIME::Parser;          my $parser = new MIME::Parser;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.26