Msg2Que User Guide Msg2Que Move messages to FrontDoor's static queue User Guide Copyright 1998 Definite Solutions HB; All rights reserved. All Definite Solutions products and trademarks are trademarks or registered trademarks of Definite Solutions HB; with the exception of FrontDoor, which is a registered trademark of Joaquim Homrighausen. Other brands and product names are trademarks or registered trademarks of their respective holders. This publication is protected by international copyright laws and treaty provisions. It may only be distributed and used in accordance with those laws and treaty provisions. DEF-E-MSG2QUE-Z-980100-EP Produced in Sweden. Msg2Que User Guide TABLE OF CONTENTS Table of contents 3 1. Introduction 4 1.1 Legal notice 4 1.2 What is Msg2Que? 4 1.3 Requirements 4 1.4 Operating system versions 5 2. Program usage 6 2.1 Installation 6 2.2 General information 6 2.3 Command line format 7 2.4 Command file 13 Appendix A: Macros 14 Appendix B: Program examples 15 B.1 AllFix example 15 B.2 FileMgr example 15 Appendix C: Version history 16 C.1 Msg2Que 1.00 16 Appendix D: Contact information 17 Index 18 Table of contents Page 3 Msg2Que User Guide 1. INTRODUCTION 1.1 LEGAL NOTICE Msg2Que is provided to you "as is", without warranties of any kind. In no event shall Definite Solutions HB be liable to you or anyone else for any damages or costs arising from the use or inability to use this program. Msg2Que is protected by copyright laws, and may not be modified, reversed engineered, sold or distributed in any way that would involve some sort of trade, without written permission from Definite Solutions HB. Msg2Que may be used without charge by anyone that is running a registered copy of the shareware version of FrontDoor, or the commercial version of FrontDoor. Msg2Que may also be used during the 30-day trial/evaluation period of the shareware version of FrontDoor. After this period, FrontDoor must be registered if you want to continue using this program (or FrontDoor). 1.2 WHAT IS MSG2QUE? Msg2Que is a utility that can be used together with the FrontDoor mailer, "FD" hereafter. It moves messages (and the files attached to them) from FD's netmail folder to the static queue. For instance, it can be used together with programs that create many file attaches in the netmail folder. By moving these file attach messages from the netmail folder to the static queue, the time it takes FD to rescan the netmail folder is decreased. One type of programs that Msg2Que is perfect to use with, is a file echo processor. These often create many file attaches that increase the time it takes for FD to rescan. Msg2Que is fully integrated with FD, and it reads FD's configuration file to get all necessary configuration information. It also uses FD's semaphore files to prevent any problems from occurring. 1.3 REQUIREMENTS Msg2Que requires the following to run: Introduction Page 4 Msg2Que User Guide o FD version 2.25 or later. o The environment variable FD pointing to the directory where SETUP.FD is located, or SETUP.FD in the current directory. o For multiline users, the environment variable TASK containing the task number. 1.3.1 Message requirements Only messages that meet the following requirements will be processed by Msg2Que: o The message must have Local status (unless the /IntransitOk switch is used) o The message must have FileAttach status (unless the /AllMsgs switch is used) o The message must have either Hold or Direct status (unless one of the /CrashOk or /NormalOk switches are used). o The message may not have Rcvd, Sent, Lock, FileRequest or UpdateRequest status o Only messages without text will be processed (unless one of the /AllowText or /PktDir switches are used) o The message must be from the username specified on Msg2Que's command line. Messages that meet all these requirements will be processed by Msg2Que. 1.4 OPERATING SYSTEM VERSIONS Msg2Que comes in three different versions, one version for DOS, another one for OS/2 2.x and Warp, and one for Win32 (Windows 95 and NT) console mode. This document uses the name M2Q.EXE to refer to all of these versions; the actual filenames are: DOS M2Q.EXE OS/2 M2Q2.EXE Win32 M2QW32.EXE If you are using the OS/2 or Win32 version, please replace any references to M2Q.EXE with the correct name above. Introduction Page 5 Msg2Que User Guide 2. PROGRAM USAGE 2.1 INSTALLATION To install Msg2Que, copy the file M2Q.EXE to a directory. Msg2Que requires its own task number when it is run, which should be specified with the TASK environment variable. It may not be set to the same task number as a running copy of FD is using. If you are running Msg2Que in your normal batch file, the TASK environment variable should already be correctly defined. 2.2 GENERAL INFORMATION When running Msg2Que, you can specify a number of parameters. The only required parameter is the parameter, which decides which messages Msg2Que should process. Msg2Que uses the from name in the message for this. 2.2.1 Moving files Some programs that create file attach messages scans the netmail folder the next time it is run, to see if a message has been sent or not. When it sees that a message no longer exists, it assumes that the file has been sent, and removes the file. Since Msg2Que removes the message when it moves the file attach to the static queue, this behavior can create a problem. If nothing is done to prevent this, the program that created the original file attach message would detect that the message has been removed. And because the message has been removed, it would automatically remove the file, although it still is attached in the static queue. To prevent this problem from occurring, Msg2Que can move an attached file to another directory. This make sure that the program that created the original file attach message cannot find the file, and therefor cannot delete it. However, this possibility should only be used when it is needed. One example when this often is needed, is .TIC files created by a file echo processor, another example is pass through files. Msg2Que needs to know which files it should move when it is run, so it allows you to specify up to 10 directories on the command line. Any files that are located in one of these directories will be moved to a subdirectory. If Msg2Que does not process some messages with a certain file attached, while other messages that is processed also have the same file attached, the attached file cannot be moved. (The reason it cannot be moved is that it the message that Msg2Que did not process would have a non-existing file attached). In this situation, Msg2Que copies the file instead of moving it. Program usage Page 6 Msg2Que User Guide 2.2.2 Status of messages and static queue entries An entry that is added to the static queue gets the same status as the message had, if it is possible. The statuses that can be moved like this are Hold, Crash, Immediate, Delete/Sent (KFS hereafter) and Truncate/Sent (TFS hereafter) status. A file that Msg2Que moves to another directory, because it was located in one of the directories specified on the command line, always get KFS status. If you specify one of the /KillNoCheck or /KillTICs switches when running Msg2Que, any files that are moved, (and have the extension .TIC in the case of /KillTICs), will get Delete/Sent/NoCheck (KFS! hereafter) status. The difference between KFS! and KFS status, is that a file with KFS status only is deleted if the file is not attached to another message or queue entry. (FD checks all the other queue entries and messages before deleting the file). A file with KFS! status is always deleted, without doing this check. Using KFS! instead of KFS speeds up processing, and should be safe for certain type of files (such as .TIC files). 2.3 COMMAND LINE FORMAT To use Msg2Que, run the program and specify some command line parameters. If you run the program without any parameters, a help message is displayed. The format of the command line for Msg2Que is: M2Q [switches] [ [ [...]]] You can use macros anywhere on the command line if you wish. See "Macros" below for more information. 2.3.1 Parameters 2.3.1.1 switches This parameter can be one or more of the switches listed below. All switches can be abbreviated to the shortest unique name, which is the uppercase part of the name in the list. You can use either a / (slash) or a - (dash) in front of each switch. Program usage Page 7 Msg2Que User Guide 2.3.1.2 This parameter is the name that should be in the From field of all messages that Msg2Que should process. All messages with other names will be ignored. The should be specified exactly as it is specified in the message; case is not important (i.e. msg2que is the same as Msg2Que). If you need to include a space in the name, surround the name with " characters (i.e. "Program Name"). It is possible to specify that Msg2Que should process messages from names that begin with a certain text. To do this, use a * (asterisk) as the last character of the name (i.e. FrontD*). If you specify only a * (asterisk) as the name, all messages will be processed. This is normally not a good idea, but it might be useful in the combination with the /InclNode switch. 2.3.1.3 , , ... These parameters are used to specify up to 10 directories. Files attached to a message that Msg2Que processes, and is located in one of these directories will be moved to a sub-directory of . The default name of this sub-directory is $MSG2QUE, but can be changed with the /SubDir switch. See "Moving files" above for information when it is necessary to use this parameter. 2.3.2 Switches 2.3.2.1 /KILLTics If you use this switch, Msg2Que will add KFS! status to .TIC files that it moves from one of the directories, instead of KFS status. See "Status of messages and static queue entries" above for more information about this. 2.3.2.2 /KILLNocheck If you use this switch, Msg2Que will add KFS! status to all files that it moves from one of the directories, instead of KFS status. See "Status of messages and static queue entries" above for more information about this. 2.3.2.3 /Crashok If specified, Msg2Que will process messages that have Crash or Immediate status, as well as those that have Hold or Direct status. Program usage Page 8 Msg2Que User Guide 2.3.2.4 /NORMalok If specified, Msg2Que will process messages that do not have Crash, Immediate, Hold or Direct status, as well as those that have Hold or Direct status. 2.3.2.5 /INTransitok If specified, Msg2Que will process messages that do not have Local status. 2.3.2.6 /ALLOwtext By default, Msg2Que will not process a message that contains text. You can change this behavior using this switch. If you use it, files attached to a message containing text will be added to the queue, and the message is processed as if it has been sent (i.e. removed or marked with Sent status). If you also use the /PktDir switch (see below), the message is packed into a .PKT file, which is added to the queue. If the /PktDir switch is not used, the message will not be sent to the receiver. 2.3.2.7 /ALLMsgs If specified, Msg2Que will process messages without FileAttach status, as well as those with FileAttach status. The messages will be packed into .PKT files, which are added to the queue. If this switch is used, the /PktDir switch is required (see below). 2.3.2.8 /Isarcmail If you use this switch, Msg2Que will add the ARCmail status to all queue entries it adds. FD uses this flag to decide if it is an ARCmail file (echomail bundle) or not. Do not use this switch unless Msg2Que is processing ARCmail files. This switch also forces Msg2Que to use KFS! or TFS! status instead of the normal KFS and TFS status, since ARCmail files never are sent to two different systems. See "Status of messages and static queue entries" above for more information. Program usage Page 9 Msg2Que User Guide 2.3.2.9 /NOCopy In certain cases (see "Moving files" above), Msg2Que needs to copy a file from one of the directories to the $MSG2QUE directory, instead of moving it. If you do not want Msg2Que to copy files, use this switch. * If you use this switch, Msg2Que is forced to skip a message with a file attached that it cannot move. 2.3.2.10 /NOREname If a file with the same name already exists in the $MSG2QUE directory when Msg2Que tries to move another file there, Msg2Que renames the second file to a temporary name. It does however tell FD that it should use the original name when it sends the file. If you do not want Msg2Que to rename the file, use this switch. * If you use this switch, Msg2Que is forced to skip a message with a file attached that it cannot move without renaming it. 2.3.2.11 /KEepdays=n The static queue has a feature where it is possible to specify that an entry should only be sent before a certain date. Msg2Que makes it possible for you to use this feature. If you want to use this feature, use this switch to specify the number of days an entry should remain the static queue. If the file has not been sent when the specified number of days has elapsed, FD will remove the entry from the static queue. 2.3.2.12 /SIze=kb Use this switch to prevent Msg2Que from processing messages with a file attached, if the attached file is smaller than the specified size. The size should be specified in kilobytes. This switch is useful when Msg2Que is used to process ARCmail file attaches, since it can prevent the generation of many small outgoing mail archives on systems that process received echomail frequently. 2.3.2.13 /Olderthan=min If you use this switch, Msg2Que will only process messages that are older than the specified number of minutes. Messages that are younger than this value are ignored, and might be processed the next time Msg2Que is run. Program usage Page 10 Msg2Que User Guide To decide the age of a message, the date and time of the *.MSG file is used, not the date and time specified in the message header. 2.3.2.14 /SUbdir=dir When Msg2Que moves files from a directory, it moves them to a sub- directory of the original directory. By default, this sub-directory is named $MSG2QUE. If you want Msg2Que to use another name for the sub-directory, specify it with this switch. Do NOT specify a drive letter or a path that begins with \. 2.3.2.15 /SKIPExt=ext If there are some type of files that you do not want Msg2Que to move to the $MSG2QUE directory, specify the extensions of these files using this switch. If you need to specify more than one extension, surround all extensions with " characters, and separate each extension from the other ones with a space (e.g. "ZIC ARJ"). It is possible to specify up to 40 extensions. The period before the extension should NOT be specified. One situation when this switch might be useful is when you have files that always use the same name when sent to a certain system, and where a new file is created when the previous file has been sent. Since the program that created the file does not know that Msg2Que have moved the file to another directory, it would create a new file, and both files would be sent to the recipient's system. Since the same name would be used for both files, the second one would be renamed when the recipient's system receives it, and in most cases, the file would not be processed correctly. One example of files that have this problem is the .ZIC files created by some file echo processors, containing packed .TIC files. (Some file echo processors use another extension than .ZIC for these files, please check the documentation of the file echo processor). You can use a ? as a wild card character in the extension that you specify, e.g. "?IC". 2.3.2.16 /SKIPNode=aka This switch prevents Msg2Que from processing any messages that are addressed to one of the specified addresses. To specify more than one address, surround the addresses with " characters, and separate each address from the other ones with a space (e.g. "2:201/329 2:201/330 255:3046/2"). It is possible to specify up to 10 addresses. Program usage Page 11 Msg2Que User Guide Wildcards are supported in the address in the same way they are supported in FD's routing; i.e. it is possible to specify 2:201/*. Please note that * is not implied for the point part of the address, it is necessary to specify .* to include all points of a node. 2.3.2.17 /INClnode=aka This switch tells Msg2Que to only process messages that are addressed to one of the specified addresses. To specify more than one address, surround the addresses with " characters, and separate each address from the other ones with a space (e.g. "2:201/329 2:201/330 255:3046/2"). It is possible to specify up to 10 addresses. Wildcards are supported in the address in the same way they are supported in FD's routing; i.e. it is possible to specify 2:201/*. Please note that * is not implied for the point part of the address, it is necessary to specify .* to include all points of a node. 2.3.2.18 /Pktdir=dir This switch tells Msg2Que where it should create a .PKT files that it has to create, if it finds a message that should be packed. This switch automatically implies the /AllowText switch (see above). 2.3.2.19 /CMdfile=file If you want Msg2Que to process messages from many different programs at once, or if the command line is not long enough to specify everything, you can use a text file with commands. See "Command file" below for more information. 2.3.2.20 /Logfile=file By default, Msg2Que writes information to the MSG2QUE.LOG file in the same directory as FD's logfile. Use this switch if you want Msg2Que to write the log information to another file. 2.3.2.21 /NOLOGfile Use this switch if you do not want any logfile at all. 2.3.2.22 /Usefdlog Use this switch if you want Msg2Que to use the same logfile as FD. The name of the logfile will be read from FD's configuration. Program usage Page 12 Msg2Que User Guide 2.4 COMMAND FILE Instead of specifying all information on the command line each time you run Msg2Que, it is possible to use a text file that contains all the commands. The command file has the advantage that you can specify that Msg2Que should process messages from more than one program at once, and therefor reduce the number of times you have to run Msg2Que. The file is a standard text file, which 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 messages from a certain program. The lines should have exactly the same format as the command line (see above), with the exception that they should not begin with Msg2Que (i.e. the program name). You can use macros anywhere on the lines in the command file if you wish. See "Macros" below for more information. A few things to think about when using a command file: o You have to specify the parameter for each definition (line). If there are any directories from which files should be moved for this , specify them on the same line. You can also use any of the switches described above on each line. o Switches specified on the command line together with the /CmdFile switch are default for all lines in the command file. You can however not specify a or any , , etc., parameters on the command line together with the /CmdFile switch. o You can not use the /LogFile, /NoLogFile, /UseFDLog or /CmdFile switches in the command file. If you do, they will just be ignored. Program usage Page 13 Msg2Que User Guide APPENDIX A: MACROS A few macros can be used with Msg2Que, both on the command line, and in the command file. These macros could for instance be useful if you want to have one logfile per day. Another usage might be to use different sub-directories (see the /SubDir switch above) different days in the week, to lower the number of files located in each directory. Some operating systems have a problem when processing a directory with many files. A system that processes a large number of files might have an advantage if the files are placed in different directories different days. Macros are used in the same way as you use macros in FDSETUP, i.e. $[name]. The following macros are supported: Macro Description YYYY The current year, 4 digits YY The current year, 2 digits MM The current month, 2 digits DD The current day, 2 digits WW The number of the current weekday, 1 digit (0 ž Sunday, 1 ž Monday, ..., 6 ž Saturday) WDAY The name of the current weekday, 3 characters (SUN, MON, ..., SAT) If the macro you specified is not one of these, Msg2Que checks if there is an environment variable with this name, and if there is, uses the value of the environment variable. An example of a command line that uses these macros is: M2Q /LogFile=M2Q-$[MM]$[DD].LOG ALLFIX* This command line would tell Msg2Que to use a logfile that contains the month and day number. Macros Page 14 Msg2Que User Guide APPENDIX B: PROGRAM EXAMPLES B.1 ALLFIX EXAMPLE When using Msg2Que to process file attaches created by AllFix, you should use the following command line: M2Q ALLFIX+ /SkipExt=ZIC where and are the directories specified as 'Tic path' and 'Queue path' in ASETUP.System data.Pathnames. If your copy of AllFix does not use 'ALLFIX+' as the from name in the file attaches it creates, you will have to replace 'ALLFIX+' with the name it uses. An alternative might be to specify 'ALLFIX*' (without the quotes), which should match both ALLFIX and ALLFIX+. You can of course use all of the other switches described above. B.2 FILEMGR EXAMPLE When using Msg2Que to process file attaches created by FileMgr, you should use the following command line: M2Q "FileMgr BETA" where is the directory specified as 'Outbound files' in the System Data.Paths & Filenames setup. If your copy of FileMgr does not use 'FileMgr BETA' as the from name in the file attaches it creates, you will have to replace 'FileMgr BETA' use the name it uses. You can of course use all of the other switches described above. Program examples Page 15 Msg2Que User Guide APPENDIX C: VERSION HISTORY C.1 MSG2QUE 1.00 Initial version Version history Page 16 Msg2Que User Guide APPENDIX D: CONTACT INFORMATION Definite Solutions can be reached at: Postal address: Definite Solutions HB F”rskottsv„gen 11 S-129 32 H„gersten SWEDEN Telephone: +46 8 6456495 (0800-1800 CET, Mon-Fri) Fax: +46 8 55630102 BBS: +46 8 55630102 (V.34 8N1, X.75 ISDN) +46 8 55630103 (V.34 8N1, X.75 ISDN) FidoNet: 2:201/329 2:201/330 Internet: sales@defsol.se http://www.defsol.se/ Please refer to our website (above) for additional information such as the FrontDoor Developer's Kit (FDDEV), the FrontDoor Frequently Asked Questions (FDFAQ) document, and more. Contact information Page 17 Msg2Que User Guide INDEX A Acrobat Reader 4 C Command file 13, 14 Command line 7, 14 Contact information 17 D Definite Solutions 17 F Filenames 5 I Installation 6 Introduction 4 L Legal notice 4 M Macros 14 Message status 7 Moving files 6 O Operating system versions 5 P Parameters 7 R Requirements 4 S Status See Message status Switches /AllMsgs 9 /AllowText 9 /CmdFile 12 Index Page 18 Msg2Que User Guide /CrashOk 8 /InclNode 12 /IntransitOk 9 /IsARCmail 9 /KeepDays 10 /KillNoCheck 8 /KillTICs 8 /LogFile 12 /NoCopy 10 /NoLogFile 12 /NoRename 10 /NormalOk 9 /OlderThan 10 /PktDir 12 /Size 10 /SkipExt 11 /SkipNode 11 /SubDir 11 /UseFDLog 12 V Version history 16 Msg2Que 1.00 16 Index Page 19