SENDFILE version 1.00.09, 16th March 1997. Sendfile is a program primarily designed to work with Pegasus mail to take requests sent by email for files from a directory structure held on the hard disc or a network drive and return them to the sender. It can be set to log all requests as they are sent for audit purposes and you can set an upper limit on the number of files that can be returned per email to reduce system abuse, if you wish. This program is freeware but the copyright remains with the author. You may distribute this file in it's original archive however if you wish to include it on any publicly accessible server all I ask is that you let me know so that I can inform you of updates to the system. You may not make a charge for this program. For the latest version of this program please contact the author at the addresses below or send SEND SENDFILE.ZIP in the body of an email to files@sol.ftp.com . (C) 1997 by Stephen Knight. mailto:pegasus@dragon-it.co.uk http://www.dragon-it.co.uk/ The following files are included with the system. SENDFILE.ZIP Archive file containing this file and a further ZIP file containing the rest. SENDFILE.DOC This file in Word 6 format. SENDFILE.TXT This file in ASCII format. PROGRAMS.ZIP Archive file containing the files below : SENDFILE.EXE The actual program file, to be called from a Pegasus Run a Program filter. SENDFILE.PIF A Windows PIF file set to run sendfile with the DOS program settings it needs. SENDFILE.INI File containing parameters that need to be customised before using this program. HELPILE.TXT The file returned to the sender by the HELP command. Can be customised. FILELIST.TXT The file returned to the sender by the FILELIST command. Should be customised. INFO.TXT The file attached to the top of every returned message. Can be customised. SENDFILE.LOG Default log filename if logging is turned on in SENDFILE.INI. ** INSTALLATION ** Please read the following instructions before installing the program on your system. Having got this far you have unZIPped the archive file SENDFILE.ZIP to find this file, SENDFILE.TXT, presumably into a temporary directory. What you know need to do is create another directory, C:\sendfile will mean you don't need to change the SENDFILE.INI file so much but you can choose any directory that you like on a local hard drive or network drive. Unzip PROGRAMS.ZIP into the directory you create using PKUNZIP or other ZIP utility such as WinZip. If you decide to move the program file, sendfile.exe, please ensure that you also move sendfile.pif which tells Windows how to run this DOS program in a Background window etc which is important to it's correct operation. Without this PIF file simaltaneous requests in Windows 3.1x may not work and in Windows 95 Sendfile will stay open until you manually close each window. In any case using Windows 3.1x SENDFILE can only cope with a limited number of requests at one time due to apparent problems with running so many simultaneous programs crashing Program Manager -- about 25 is the most you can get away with. Windows 95 and NT do not suffer from this problem. Now you need to move the SENDFILE.INI into the directory from where Pegasus Mail is run, i.e. the directory that contains WINPMAIL.EXE or WINPM-32.EXE so that it can be picked up by the program and edit the parameters to suit your system. For now you need to amend the following parameters, more details on each can be found in the SENDFILE.INI file itself. All entries requiring a file or path name may use either the / or \ characters to separate directories. ROOT=C:\ This entry sets the top level, or root, directory that will be seen by email. You can set this to be a path on a local hard drive or network drive as appropriate and by email you will only be able to see from this point down in the directory tree. It will respect network rights where these are set so you could restrict the files available by denying READ and FILESCAN rights (on NetWare for example) to those directories. The default of C:\ should be changed unless you want everyone to have Read access to the whole of your hard disc! NEWMAIL=C:\PMAIL\MAIL This entry needs to be the directory where the system should put the .PMW files which it queues ready to be sent by Pegasus. On a standalone system it would normally by C:\pmail\mail, on a multi-user standalone system it would be something like c:\pmail\mail\stephen and on a NetWare network maybe something like F:\MAIL\1C000001. In any case you should not include a trailing backslash character. Within Pegasus you can use the Info button found on the Help | About screen to check where this directory path should point to -- hint look for "New Mail Path". HELPFILE=c:\sendfile\helpfile.txt INFOFILE=c:\sendfile\info.txt FILELIST=c:\sendfile\filelist.txt You should change these three entries to point to the directory where you installed these files if not the defualt c:\sendfile. You may also want to have a look at these file (especially filelist.txt) and amend them to be appropriate for your system. LOGFILE=c:\sendfile\sendfile.log If you are intending to log file requests you should point this to where you would like the log file and set the LOG entry to Y, otherwise set the LOG entry to N. The Log file is a Comma Seperated file that can be read into databases or a spreadsheet program such as Excel and contains details of the requests made with the date, time, and the requestors's email address. ** INSTALLING PEGASUS MAIL FILTER RULE ** This program is most easily used when called by a New Mail Filtering rule by Pegasus Mail (written by David Harris). It takes one parameter and that is the filename of a file containing a normally formatted mail message containing file requests in the message body. This filename is automatically supplied by Pegasus when it is run by this rule. You should set-up a filtering rule as follows : Tools | Mail Filtering Rules | Edit New Mail Filtering Rules | Rules applied when New Mail folder is opened. then Add a Rule. (If you don't have a Tools menu then you probably have an old version of Pegasus, take a look in Help About -- at the time of writing the current version is 2.53 available from : ftp://risc.ua.edu/pub/network/pegasus ) SendFile will work just as well with earlier versions but, heh, why not take the oppurtunity to upgrade! You now need to decide what will trigger the fact that this is a request for a file which you will have to inform your users to use. I suggest one of these: If you have multiple aliases for this address you could assign one of these to the sendfile program and search in the To field, e.g. "To" field contains "autofile@sol.ftp.com" or maybe "Subject" contains "^SEND FILE" or "Subject" contains "^GET FILE" etc. then set the Action for this rule to "Run a Program" and type in the path to where the sendfile.exe program can be found, e.g. C:\sendfile\sendfile.exe. You may want to set another similar rule just after this one which deletes this mail or moves it to a folder for archive purposes otherwise they will remain in the New Mail folder as per normal messages. Your system will now respond to a mail sent to this address or with subject line or whichever trigger you used and pass the mail message to SENDFILE. Sendfile will parse the body of the message for commands it understands and send back an email to the From: email address of the person sending the request. ** USING THE PROGRAM ** Once you have set-up the program on your system you can send any of the following commands, in any order, to the system in the body of an email message and it will respond with the files or information requested. GET filename or RETR filename or SEND filename Any of these three commands will send back the file requested, which can include a path if necessary as an attachment encoded using the default encoding type set in SENDFILE.INI (normally Base64 MIME) or other type if chosen, see below. DIR path or LS path or FILES path Any of these will send back a directory listing of the directory specified (or the root if none is specified). HELP Sends back a help file explaining the commands available. INFO Sends the file included at the top of each message. LIST or FILELIST Sends a file that has been set-up to include information on all the files available for download, perhaps with more information on the files contents than that supplied by the DIR command. TREE Shows a Directory tree of all directories and sub-directories available, as produced by the DOS TREE command. The program TREE.EXE, normally supplied with DOS, needs to be available on the path for this command to work. END or EXIT or QUIT or DONE Finishes execution of requests. Any further lines will be ignored. Intended to stop trying to interpret signatures as commands. UUENCODE or BINHEX or MIME Change the encoding method used for sending all files sent with this request to that specified. If more than one is specified the last one is taken for ALL files sent.