/[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.2 by dpavlin, Tue Nov 19 08:34:40 2002 UTC revision 1.3 by dpavlin, Tue Nov 19 09:03:22 2002 UTC
# Line 11  use vars qw($Msgno); Line 11  use vars qw($Msgno);
11  use SAP::Rfc;  use SAP::Rfc;
12  use Digest::MD5 qw(md5_hex);  use Digest::MD5 qw(md5_hex);
13  use MIME::Parser;  use MIME::Parser;
14    use XML::Simple;
15    use Data::Dumper;
16    
17  # configuration  # read configuration from xml file
18    my $config = XMLin();
19    
20  # directory in which attachemnts will be left  # directory in which attachemnts will be left
21  my $outdir = "/var/autofs/data/export_sigma";  my $outdir = $config->{outdir} || die "config: on <outdir> defined";
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 = "/var/autofs/data/export_sigma/mime$$";    # temp  my $msgdir = $config->{msgdir} || die "config: no <msgdir> defined";
25  my $log = "/data/sap_sigma/orders.log";  $msgdir .= "$$";        # append PID to make it unique
26    my $log = $config->{log} || die "config: no <log> defined";
27    
28  # open log and redirect die to it...  # open log and redirect die to it...
29  open(LOG,">> $log") || warn "open log $log: $!";  open(LOG,">> $log") || warn "open log $log: $!";
# Line 28  local $SIG{__DIE__} = sub { print LOG $_ Line 32  local $SIG{__DIE__} = sub { print LOG $_
32  # init SAP rfc  # init SAP rfc
33  #  #
34  my $rfc = new SAP::Rfc(  my $rfc = new SAP::Rfc(
35          ASHOST   => 'cipkg',          ASHOST  => $config->{sap}->{ashost},
36          USER     => 'rfctest',          USER    => $config->{sap}->{user},
37          PASSWD   => 'dinamo',          PASSWD  => $config->{sap}->{passwd},
38          LANG     => 'HR',          LANG    => $config->{sap}->{lang},
39          CLIENT   => '200',          CLIENT  => $config->{sap}->{client},
40          SYSNR    => '20',          SYSNR   => $config->{sap}->{sysnr},
41          TRACE    => '0'          TRACE   => $config->{sap}->{trace}
42          ) || die "new: $!";          ) || die "new: $!";
43    
44    

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

  ViewVC Help
Powered by ViewVC 1.1.26