1 # this is the base directory, where the req-files are stored and the
3 $flo_path = "/var/spool/ifmail";
4 $outbound = "/outb"; # don't be confused, it means "/var/spool/ifmail/outb"
6 # end of configuration #############################################
10 if ((@ARGV < 1) || @ARGV > 2 || $ARGV[0] eq "-?") {
12 } elsif ($ARGV[1] ne "") {
17 if (! ($node =~ /\d+:\d+\/\d+/)) {
18 die "Wrong address: $node!!!";
21 ($zone, $netnode) = split (/:/, $node);
22 $reqfile = sprintf("%04x%04x", split(/\//, $netnode));
24 if ($reqfile eq "00000000") {
25 print ("can't resolve the fido address \"$node\"\n");
29 $reqfile = $flo_path . $outbound . "/" . $reqfile . ".req";
30 } elsif ( $zone < 7 ) {
31 $reqfile = $flo_path . $outbound . ".00$zone/" . $reqfile . ".req";
34 open (CONFIG, "< $config") || die "can't open $config";
35 while ($_ = <CONFIG>) {
36 if ( /^address.*$zone:.*\@(\w*)/ ) { $outbound = $1; }
38 if ( $outbound eq "" ) {
39 die "No Zone $zone found in $config";
41 $reqfile = $flo_path . "/$outbound/" . $reqfile . ".req";
44 # seperate the file names of the first argument
45 @files = split (/\s+/, $ARGV[0]);
47 # open the flofile for appending
48 open(FLOFILE, ">>" . $reqfile) || die "can't open $reqfile";
50 print (FLOFILE shift(@files), "\n");
54 print ("--- fido request $ver ---------------------------\n");
55 print ("requesting \"$file\" from fido-node $node\n");
56 print ("--- executing ifstat .. ------------------------\n");
64 printf ("--- fido request %s -------------\n", $ver);
65 printf ("usage: ifreq <file> [<3-d address>]\n");
66 printf ("e.g. : ifreq FILES 2:2410/305\n");