Home Consultancy Support Contracts Client History CV Downloads / Info Links Contact Us

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 using commands similar to those used by a FTP server. It can give you some of the functionality of an FTP server on your PC, even if you only have a dial-up connection as people can send you requests when you are off-line which you honour when you dial-up.

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.

It has been tested as working on various versions of Pegasus Mail for Windows, both 16 and 32 bit versions upto version 2.53. It should also work with Pegasus Mail for DOS if that includes Filtering but the author has not tried this! It works well on Windows 95 and NT and for a limited number of simultaneous requests on Windows 3.1x.

(C) 1997 by Stephen Knight. stephenk@globalnet.co.uk or stephenk@sol.ftp.com

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.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 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 but you can choose any directory that you like on a local hard drive or network drive.

PKUNZIP PROGRAMS.ZIP into the directory you create.

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 simultaneous 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.

CONFIGURATION

Now you need to move the SENDFILE.INI into the directory from where Pegasus Mail is run, ie 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. It is unlikely that SENDFILE will work on your system unless you edit this file first.

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 by email!

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. You can check where this needs to be by choosing Help | About within Pegasus, then press the Info button where the directories used on your system will be listed.

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 default 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.

For the other options read the descriptions in the SENDFILE.INI file itself.

For the latest version of this program please contact the author at the addresses below or send GET SENDFILE.ZIP in the body of an email to files@sol.ftp.com

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 within Pegasus Mail :

Tools | Mail Filtering Rules | Edit New Mail Filtering Rules | Rules applied when New Mail folder is opened.

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 opportunity 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 what this trigger is. 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, eg

"To" field contains "autofile@"

or "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, eg 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 BASE64 MIME encoding type (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.

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.

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.

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.

Text links: