MAIL2DIR - Move mail to spool directory // Absolute Solutions ------------------------------------------------------------- Copyright 1995, 1996 Mats Wallin; All rights reserved Introduction ------------ MAIL2DIR is a utility that moves all mail and files that are addressed to listed systems to a specified directory. It can for instance be used to move mail to a point over a network, or to move mail to systems that wish to pick it up via FTP. MAIL2DIR scans FrontDoor's netmail directory to find the mail and files that are waiting to be sent to the specified systems. When doing this, it honors all the flags and attributes that FrontDoor uses. MAIL2DIR is fully integrated with FrontDoor, and reads FrontDoor's configuration files to get the needed information. It does also use FrontDoor's semaphore files to prevent any problems. How to use it ------------- When using MAIL2DIR with the commercial version of FrontDoor, MAIL2DIR requires that you have a task number defined it for, that isn't used by a running FrontDoor line. If you are using MAIL2DIR in your normal .BAT file, this shouldn't be a problem, but if you do use MAIL2DIR by itself, please make sure that you either don't have TASK set, or that it is set to a unused TASK number. When running MAIL2DIR, you can specify a number of parameters. The only required parameters are the destination directory to which MAIL2DIR should move the mail and files, and a list of systems for which it should do this. Message requirements -------------------- MAIL2DIR will process all netmail messages addressed to the specified systems, except those that are Sent, Received or Locked. It will also ignore all messages with File Request status, since it wouldn't be possible to perform a file request this way. By default, MAIL2DIR will also ignore all messages that have the Crash or Immediate flag (if the message is created locally, i.e. have the Local flag). This can however be changed with a command line parameter. Command line format ------------------- The command line format for MAIL2DIR is: MAIL2DIR [switches] [ [...]] switches can be any of the following (all switches can be abbreviated to the shortest unique name, which is the uppercase part of the name in the list below). /CRashok - If you want MAIL2DIR to process messages that have Crash or Immediate status, use this switch. /IFExist=mask - MAIL2DIR will only process mail for the specified systems if a file that matches the specified mask exists, otherwise mail for these systems are skipped. /IFNotexist=mask - MAIL2DIR will only process mail for the specified systems if there is no file that matches the specified mask, if there is a matching file, mail for the specified systems are skipped. /CMdfile=file - If you want MAIL2DIR to process mail for many systems at once, you can use a text file with commands. See the section 'Command file' for more information. /Logfile=file - By default, MAIL2DIR writes information to the MAIL2DIR.LOG file in the same directory as FrontDoor's logfile. Use this switch if you want MAIL2DIR to write the loginformation to another file. /Nologfile - If you don't want any logfile at all, use this switch. /Usefdlog - If you want MAIL2DIR to use the same logfile as FrontDoor, use this switch. MAIL2DIR will then read the name of the file from FrontDoor's configuration. is the directory to which MAIL2DIR should move all mail and files for the systems specified on the command line. , , ... is a list of up to 10 addresses. MAIL2DIR will move all mail and files addressed to one of these addresses to the directory. Command file ------------ Instead of specifying all information on the command line everytime you run MAIL2DIR, it is possible to use a text file that contains all the commands. The command file also has the advantage that you can specify that MAIL2DIR should process messages for more than one system at once, and therefor reduce the number of times you have to run MAIL2DIR. The command file is a standard text file, that can contain empty lines and comments. Comments can occur anywhere in the file, and should start with a semicolon (;). Each line in the file should contain a complete definition for which systems mail that should be moved, and to where it should be moved. The lines should have exactly the same format as the command line, with the exception that they should not begin with MAIL2DIR (i.e. the program name). If you specified any switches on the command line together with the /CmdFile switch, these switches are default for all lines in the command file. You can however not specify a or any parameters on the command line, together with the /CmdFile switch. You can not use the /LogFile, /NoLogFile, /UseFDLog or /CmdFile switches in the command file. If you do, they will just be ignored. If you use the /IfExist or the /IfNotExist switch in the command file, they do only apply to the systems specified on the same line. If you use the /IfExist or the /IfNotExist switch on the command line together with the /CmdFile switch, the specified filemasks are checked for all systems in the command file. Examples of a command file -------------------------- To clarify how the command file works, here is an example of one: C:\OUT\MYPOINT 2:270/19.1 255:3352/3 /CrashOk X:\FILE\FTP\MATS 2:201/329 /IfNotExist=X:\FILE\FTP\MATS\*.BSY X:\FILE\FTP\BRUCE 1:170/400 /IfExist=Y:\SEMAPHOR\GETMAIL.NOW The three lines above will tell MAIL2DIR to do the following: 1) Copy all mail and files that are addressed to 2:270/19.1 and 255:3352/3 to the C:\OUT\MYPOINT\ directory, including messages and files that have Crash or Immediate status. 2) Copy all mail to 2:201/329 to the X:\FILE\FTP\MATS\ directory, but only if there are no file with the extension .BSY in the X:\FILE\FTP\MATS\ directory. 3) Copy all mail to 1:170/400 to the X:\FILE\FTP\BRUCE\ directory, but only if there is a file with the name GETMAIL.NOW in the Y:\SEMAPHOR\ directory. Assuming that the command file above is named MAIL2DIR.CMD, it can be used with the following command: MAIL2DIR /CMDFILE=MAIL2DIR.CMD The KFS, TFS status ------------------- MAIL2DIR does support the KFS (Kill file after it has been sent) and TFS (Truncate file after it has been sent) attributes. MAIL2DIR processes these attributers after it has copied all the files. If there is no remaining file attaches for a file that has been copied, the file is deleted or truncated, depending on the KFS and TFS flag. Errorlevels ----------- MAIL2DIR exists with errorlevel 0 if there was nothing to do, and with errorlevel 1 if it has moved any mail or files. Any other errorlevel indicates an error. Legal notice ------------ MAIL2DIR is provided to you as is, without warranty of any kind. In no event shall Mats Wallin be liable to you or anyone else for any damages or costs arising from the use or inability to use this program. MAIL2DIR is protected by copyright laws, and may not be modified, reverse engineered, sold or distributed in any way that would involve some sort of trade, without written permission from Mats Wallin. MAIL2DIR may be used without charge by anyone that is running FrontDoor 2.02, a registered copy of the shareware version of FrontDoor, or the commercial version of FrontDoor. The program may also be used during the 30 day trial period of the shareware version of FrontDoor. After this period, FrontDoor has to be registered if you would like to continue to use this program (or FrontDoor). FrontDoor and Absolute Solutions are registered trademarks of Joaquim Homrighausen. All other brand or product names are trademarks or registered trademarks of their respective holder. Comments and suggestions ------------------------ If you have any comments or suggestions on the way MAIL2DIR works or if you find any bugs in the software, please contact me at one of the addresses below: FidoNet: 2:201/329@fidonet FDNet: 255:3352/3@fdnet InterNet: mw@abs.finlink.lu Mats Wallin Absolute Solutions F”rskottsv„gen 11 S-129 32 H„gersten Sweden