home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Extra 1997 #5 / AmigaPlus_Extra-CD_5-97.iso / online-tools / mail / mailserver / sys / usr / put < prev   
Encoding:
Text File  |  1995-04-06  |  941 b   |  33 lines

  1. /* A simple script script to PUT an e-mail file into a directory     */
  2. /* Copies incoming mail file to the directory shown below.           */
  3. /* No post processing is done, but you could easily auto-uudecode    */
  4. /* files if you wanted to. Just watch out that people don't send any */
  5. /* viruses! */
  6.  
  7. dir = 'mailserver:public/incoming/'
  8. parse arg line
  9.  
  10. msg = word(line,1)
  11. filename = word(line,2)
  12.  
  13. writeln(stdout,'Your request: PUT 'filename)
  14. writeln(stdout,'')
  15.  
  16. if filename = '' then
  17.   writeln(stdout,'File not accepted. You must specify a filename.')
  18.  else
  19.   do
  20.    if exists(dir || filename) then
  21.     writeln(stdout,'The file 'filename' already exists - cannot overwrite it.')
  22.    else
  23.    do
  24.     writeln(stdout,'Transfer successful.')
  25.     writeln(stdout,'Your file can be found in the 'dir' directory.')
  26.     address command 'copy 'msg' 'dir || filename
  27.   end
  28.  end
  29.  
  30. writeln(stdout,'')
  31. writeln(stdout,'--')
  32. writeln(stdout,'The Mailserver')
  33.