home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / ONLINE / IMPRO / INETMAIL.ZIP / reg2vd.cmd < prev    next >
OS/2 REXX Batch file  |  1996-12-31  |  1KB  |  41 lines

  1. /* rexx */
  2. /* This rexx script will convert the files in the queue
  3.    directory from regular que files to virtual domain
  4.    que files */
  5.  
  6. call RxFuncAdd 'SysTempFileName', 'RexxUtil', 'SysTempFileName'
  7. call RxFuncAdd 'SysFileDelete', 'RexxUtil', 'SysFileDelete'
  8. call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree'
  9.  
  10. rc = SysFileTree('*.que', s., 'FO')
  11.  
  12. if rc = 0 then do i = 1 to s.0
  13.   Tmp = SysTempFileName('????.tmp', '?')
  14.   rc = stream(Tmp, 'c', 'open write')
  15.   rc = stream(s.i, 'c', 'open read')
  16.  
  17.   Line = linein(s.i)        /* last tried */
  18.   rc = lineout(Tmp, Line, )
  19.  
  20.   Line = linein(s.i)        /* entry time */
  21.   rc = lineout(Tmp, Line, )
  22.  
  23.   Line = linein(s.i)        /* from address */
  24.   parse var Line user '@' hostname
  25.   rc = lineout(Tmp, hostname, )  /* add virtual domain name */
  26.   rc = lineout(Tmp, Line)        /* the regular from address */
  27.  
  28.   do while lines(s.i) <> 0       /* Now the rest of the lines */
  29.     Line = linein(s.i)
  30.     rc = lineout(Tmp, Line, )
  31.     end
  32.   rc = stream(Tmp, 'c', 'close')
  33.   rc = stream(s.i, 'c', 'close')
  34.  
  35.   copy Tmp s.i
  36.   rc = SysFileDelete(Tmp)
  37.   end
  38.  
  39. exit
  40.  
  41.