EXTPOST V2.0 - Copyright (c) 1991, 1992 Andrew Gaunt - All Rights Reserved ------------------------------------------------------------------------------ BOILER PLATE: This program is provided AS-IS, without warranty of any kind, express or implied. It may NOT be freely shared, it is copyrighted. If you would like to use it, you may contact the author directly for usage rights. There is generally no charge to use it, ie. I give it away to people. I feel it's necessary to restrict it's use because the potential to use this program to abuse WWIVnet is great. Therefore, I wish only to give it to WWIVnet SysOps that can use it responsibly. I must acknowledge Rich $alz, the original author of the regular expression matching code (which is public domain). Andrew Gaunt ____ __ _ | 0|___||. (_)uantum WWIVnet: 1@6300, 1@5804, 2@6301 _| _| : : } ` UUCP: ...att!attsb!awg -(O)-==-o\ KA1YLG Internet: awg@attsb.att.com ==Info=Rail== Internet->WWIV: mv1m1c!quantum@attsb.att.com ------------------------------------------------------------------------------ ** EXTPOST ** External Posting Program ** EXTPOST ** Extpost is a utility to create a file (p1.net) that the WWIVnet programs can use to create packets of preposts or email to be sent to other WWIVnet BBS's. It has been developed for a specific application however it should be flexible enough so that it may be used in many other applications. This document will briefly describe what is its, how to set it up and how to use it. Basically, it is a tool to import messages from other networks to WWIVnet. It does export WWIVnet messages or email to other networks. Usage: extpost [-a] config_file ... -a Append to p1.net file in WWIV data directory. Without this option, extpost will create p1.net if it does not exist. If p1.net does exist, it will create p2.net if p2.net does not exist and so on. One file is used to tell extpost how to perform, the configuration file. This file is specified on the command line and it tells extpost how to act. Several configuration files may exist if you want extpost to perform differently for different tasks. Configuration file: FILE CONTENTS DESCRIPTION /wwiv/ 1) BBS's main directory /wwiv/data/ 2) Data directory extpost.txt 3) Message input file. extpost.len 4) Temp. file to store message lengths. extpost.tit 5) Temp. file to store message titles. extpost.to 6) Temp. file to store message "to" lines extpost.frm 7) Temp. file to store message "from" lines extpost.tmp 8) General purpose temp. file. From * 9) Regular expression for message separator Subject*:* 10) Regular expression for "Subject/Title" line WWIVto:* 11) Regular expression for "To" line. WWIVfrom:* 12) Regular expression for "From" line. 6300 13) Default "to" System Node number 5804 14) Default "from" System node number 1 15) Default "to" User 1 16) Default "from" User 5 17) Major Type 36300 18) Minor Type MESSAGE COPIED OFF THE AIR 19) Default Title QUANTUM #1@6300 (EXTPOST) 20) Alias or name of poster LINE 1: The first item tells extpost where the BBS's main directory is. This is not actually used yet, it's just there for possible future use. LINE 2: The second item item tells extpost where the BBS's data directory is. This is used. If extpost creates a p1...p9.net file, it will be in this directory. LINE 3: Extpost reads in a file extpost.txt and attempts to create a p1...9.net file for the WWIV network executables to use. The file read may contain one or more messages that extpost can segregate. LINE 4 - LINE 8: Extpost creates several temporary files that is uses to store message header related data. The pathnames for these files can be specified in the configuration file. They must be specified, but they can be ignored or deleted when extpost completes it's run. I suppose they could be put onto a ramdisk for maximum performance. In the above example, the temporary files are: extpost.len Temp. file to store message lengths. extpost.tit Temp. file to store message titles. extpost.to Temp. file to store message "to" lines extpost.frm Temp. file to store message "from" lines extpost.tmp General purpose temp. file. LINE 9: How extpost determines where a message begins and ends is configurable. In the configuration file, a "message seperator" must be specified. It is a regular expression (see section about regular expressions) that tells extpost what pattern to look for. If the message separator is found, extpost will begin a new message (this implies the end of any previous message). In the example above, the message separator is: "From *", this is the pattern I use when importing Unix(tm) email files to WWIVnet. Each message starts with a line begining with the word "From", follwed by a space, and some arbitrary text (the senders address). LINE 10: If you'd like to populate the WWIVnet title line, e.g. - 150/254: Here is a Sample WWIV message base title Name: Quantum #3 @6300 Date: Sun Sep 08 03:41:50 1991 From: ==Info=Rail== (New Hampshire) Then you need to tell extpost how to find one in the message. This is what the "subject line expression" is for. In the example, "Subject*:*" is used to find any line in the message that begins with the word "Subject" and has some arbitrary text preceding and following a ":" character. This is what I use when I import Unix(tm) mail files. If it doesn't find one, the default is used. LINE 11 & LINE 12: The "To" line and "From" line patterns tell extpost to look for WWIVnet addresses in a message body. In the example, if a message contains: WWIVto: 1@6300 WWIVfrom: 1@5804 Then extpost will write a WWIVnet header for that message, that directs it to 1@6300 and appears to originate from 1@5804. If it does not find the above, then defaults are used. LINE 14: This item is the default "To" system node number. If extpost cannot find a "To" system as specified in LINE 11, this one will be used. LINE 15: This item is the default "From" system node number. If extpost cannot find a "To" system as specified in LINE 12, this one will be used. LINE 16: This item is the default "To" user number. If extpost cannot find a "To" system as specified in LINE 11, this one will be used. LINE 17: This item is the default "From" user number. If extpost cannot find a "To" system as specified in LINE 12, this one will be used. LINE 18: This is the WWIVnet header Major Type to be used. WWIVnet uses this to determine what type of message it is. Examples: Use: For message type: --- ----------------- 2 Email 5 Message base prepost 6 For External programs 7 Email using names LINE 19: This is the WWIVnet header Minor Type to be used. If you are using extpost to send a prepost, put the SubType here. LINE 20: If extpost can't find a title for a message, as specified in LINE 10, this one will be used. LINE 21: Whatever is put in here will show up as the users name or alias in the WWIV message title. ------------------------------------------------------------------------------ REGULAR EXPRESSIONS: The regular expressions that can be specified are similar to what's available on Unix(tm) systems. ? Matches any single characther \ escapes the special meaning of a character, e.g. \? is a question mark. [] Characters enclosed by brackets can be used to specifiy one of more single characters or a range of characters. e.g. [0-9] for digits from zero to nine. [a-z] for characters a to z. [Tt] for upper or lower case "t" [XYZ] for the letters X,Y, or Z. * Matches any arbitraty string up in a pattern e.g. A*Z will match to AbbbbbbbbZ but not xxxxAbbbbbbbZ A*Z* will match to AbbbbbbbbZ and AbbbbbbbZxxxxxxx but not to xxxAbbbbbbZ *A*Z* will match to AbbbbbbbbZ and xxxxAbbbbbbbZ and xxxxAbbbbbbbbZxxxxx ---------------------------------------------------------------------------- HOW TO USE EXTPOST: 1) Create a directory under your BBS's main directory and call it extpost. 2) Create your configuration file by following the instructions above. For a trial run, use the file provided, extpost.txt as your input file. specify EXTPOST.TXT on LINE 3: of the configuration file. The configuration file must be in the extpost directory. 3) Now you ready for a trial run. The sample message file is provided, when you run extpost it will create a WWIVnet p?.net file with a message in it for me. You may edit this file and change the WWIVfrom: so I'll know it was from you. 4) Assuming you named the configuration file EXTPOST.CFG, type: EXTPOST EXTPOST.CFG and it should create a p?.net file in your BBS's data directory. When you bring the BBS backup, it will see the p?.net file. analyze it, and send the message. 5) I hope that was fun. If you'd like to use EXTPOST to import messages from some other network and you need soem assistance, I'd be glad to help you out. I hope that this doc file offers enough information, but if it doesn't feel free to ask for help. ----------------------------------------------------------------------------- CAVEATS: Extpost reformats the input file by processing it, writing to a temp file and then reads the temp file, writing over the origninal input file. If your input file is valuable. Keep a copy of it somewhere. I know, it's a sloppy programming practice but it works. ----------------------------------------------------------------------------- OTHER PROGRAMS: Two other programs are provided, NLFILT.EXE and EXTSPLT.EXE. NLFILT.EXE replaces newline characters '\012' with Carriage return/Newline sequences. It is useful when importing Unix(tm) messages files. Just type NLFILT.EXE to get it's usage information. EXTSPLT.EXE will read a file and check it for message separators (regular expressions not supported). If more than 32K bytes (the maximimum for a WWIVnet message) is read between message separator, it will "split" the message by inserting a message separator. e.g. EXTSPLT From infile outfile ----------------------------------------------------------------------------- Examples: For my particular application, I use extpost analyze a file with one or messages in it. The file is a Unix(tm) 'mail' file or something similar. To illustrate what one of these files might look like, the following sample is included: ------------------------------------------------------------------------------ From uucp Thu Sep 19 07:38 EDT 1991 To: mv1m1c!quantum Subject: TEST Status: R WWIVto: 1@6300 Here is a a message from another network, the text goes on and on until it ends. From uucp Thu Sep 19 07:38 EDT 1991 To: mv1m1c!quantum Subject: TEST Status: R WWIVto: 1@6300 Here is a another message from another network, the text goes on and on until it ends. ------------------------------------------------------------------------------ The above sample contains two messages. For this example, the expression that separates each message is the word 'From' followed by a space, and any text up to a newline. The subject line is a line beginning with the word "Subject" follwed by a colon and any text up to a newline. The WWIV to address can be extracted from the line beginning with "WWIVto:" with the WWIVnet address following. Note that no WWIV from address is specified, thus the default will be used.