home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / dsptcha1.zip / readme.dis < prev    next >
Text File  |  1997-05-30  |  12KB  |  303 lines

  1. Dispatch started as an exercise in socket programming with Object REXX.
  2. There is virtually no socket documentation comprehensible to a
  3. non-programmer -- especially someone who cannot even read C. So I used a
  4. freeware REXX pop client I found on Hobbes as a model.  It did not work --
  5. OREXX is more intolerant of extra 'END' statements than TREXX.  But at
  6. least I understood the general structure.  There is little of that program
  7. left in mine now.
  8.  
  9. As for protocols, I found that RFC's are easier to understand that I had
  10. expected.  So I wrote a bunch of little utilities:  One to receive mail via
  11. POP -- into a unique folder for each message with all attachments detached.
  12. One to send mail via SMTP with files appended.  One to post news.  One to
  13. download an entire newsgroup.  Etc.
  14.  
  15. The other day, I decided to combine three of these into one.  The result is
  16. Dispatch.
  17.  
  18. Dispatch is a compiled OREXX program.  It will only run under Warp 4.0 or
  19. on a system with Object REXX installed and active.  It uses REXXLIB
  20. utilities and two shareware packages for mime and uuencoding.  I will
  21. eventually write both into my program.  I have the Base64 model I need, but
  22. does anyone have a REXX UUencoding model?  It also uses the excellent
  23. SofTouch TCPIP functions.
  24.  
  25. There are three parts to the command line:
  26. DISPATCH[space]FUNCTION[space]PARAM1[space]PARAM2....
  27.  
  28. DISPATCH is, of course, the name of the command file:  dispatch.cmd
  29.  
  30. FUNCTION is one of the following:
  31.  
  32. M[AIL] for SMTP mail out N[EWS] for newsgroup posting F[ILE] for file
  33. transfer using FTP V[ERSION] for version info Anything else for function
  34. help
  35.  
  36. PARAMS are different for each function.  They always take the form of a
  37. space, a dash and a single letter followed, in most cases by some
  38. information.  Avoid using any other space dash combinations within the
  39. command line!  No space between the latter param identifier and the
  40. following information.  For example:  -Ac:\test.tst adds an attachment
  41. named test.txt located on the c drive to outgoing mail.
  42.  
  43. The -?  param will list out a list of parameters for the function
  44. specified:
  45.  
  46. dispatch M -?
  47.  
  48. MAIL PARAMETERS
  49.  
  50. -T To Address Dispatch M -Tsomeone@somewhere.com -S Subject Dispatch M
  51. -SWhat is this about?  -C Config File Dispatch M -Cdispatch.mle -A Text
  52. File Dispatch M -Ac:\textfile.txt -A* Binary File Dispatch M
  53. -A*c:\binary.tif -F From Addr Dispatch M -Fsomeone@somewhere.com -Z Time
  54. Zone Dispatch M -Z-0500 -H Host Machine Dispatch M -HMyHost.domain.com -M
  55. Mail Server Dispatch M -Mmailhost.domain.com -Y Reply-To Dispatch M
  56. -Ysomeone@somewhere.com
  57.  
  58. I do not think you can use a '<' or '>' on the command line.  So, if you
  59. want any address to be in the format:  Chris Barr<cbarr@ibm.net> you must
  60. enter it as
  61.  
  62. cbarr@ibm.net(Chris Barr) and the program will redo it.
  63.  
  64. The Reply-To address defaults to the same address as the From address
  65. unless overridden.
  66.  
  67. The Config file is an optional file that loads in certain invariable
  68. values.  More later.
  69.  
  70. -A designates files to be attached.  The first file attached is the 'note'
  71. itself.  Subsequent files are all attachments.
  72.  
  73. -A by itself designates a plain text file to be appended without encoding.
  74. The first file must be of this type and is treated as the 'note.'
  75. Subsequent text files are attached without base64 encoding and their file
  76. names indicated.
  77.  
  78. -A* designates a binary file that requires encoding in base64.
  79.  
  80. You may attach as many files as you can fit on the command line.
  81.  
  82. The time zone defaults to GMT if not entered.
  83.  
  84. The mail server must be entered by name and not by IP address.
  85.  
  86. Values for parameters are set in the order entered.  So, you can set the
  87. zone in your config file to -0500 and override it in one case by putting
  88. -Z-0400 (Note:  no space before the second dash) AFTER the -Cconfig.file.
  89.  
  90. Also set the Reply-To address after the From address.
  91.  
  92. The config file sets the following parameters:
  93.  
  94. FromAddr ReplyToAddr YourHost MailServer Zone
  95.        
  96. All info must be included.  One entry to a line.  No blank lines.  In this
  97. exact order.  Addresses are not converted, so use the format Chris
  98. Barr<cbarr@ibm.net> if that is what you want.  Do not prepend the param
  99. designator.  Here is mine:
  100.  
  101. Chris Barr<cbarr@ibm.net> Chris Barr<cbarr@ibm.net> thinkpad.fsrl.com
  102. mailhost.myisp.net -0500
  103.  
  104. NEWS PARAMETERS
  105.  
  106. -C Config File Dispatch M -Cdispatch.nws -X ControlFile Dispatch M
  107. -Xdispatch.ctl -N NewsServer Dispatch M -Snetnews.isp.net -F FromAddr
  108. Dispatch M -Fsomeone.domain.com -G News Groups Dispatch M
  109. -Gcomp.os.os2.mail-news -R F/U Groups Dispatch M -Rcomp.os.os2.mail-news -A
  110. Text File Dispatch M -Ac:\newspost.txt -E BinaryFile Dispatch M
  111. -Ec:\picture.jpg -H HostName Dispatch M -Hmachinename -D Domain Dispatch M
  112. -Ddomain.com -S Subject Dispatch M -SThis is a posting
  113.  
  114. The same general rules apply as for mail, with these exceptions and
  115. additions:
  116.  
  117. The config file is a different file for news.  More later.
  118.  
  119. The control file is a special file that can take the place of some of the
  120. command line parameters.  You might, for example, keep a template for each
  121. group of newsgroups to which you cross post.  More later.
  122.  
  123. The newsserver is the name and not the IP address of the newsserver.
  124.  
  125. The Newsgroups are entered in one continuous stream separated by commas.
  126. The Follow/Up group(s) default to the same as the post to groups, but can
  127. be overridden by the -R parameter.
  128.  
  129. One text file and one uuencoded file are allowed.
  130.  
  131. The hostname is the machine name with no domain.
  132.  
  133. The config file format is as follows:
  134.  
  135. newsserver domain zone host FromAddr Organization
  136.  
  137. The same rules apply to this config file as to the mail config file.
  138.  
  139. The option Xternal Control file format is as follows:
  140.  
  141. SUBJECT Dispatch for OS/2 POSTGROUPS
  142. alt.test,comp.os.os2.mail-news,comp.os.os2.advocacy FOLLOWUP alt.test FILE
  143. c:\readme.dis UUENCODE NONE
  144.  
  145. It must be exactly as stated, with your entries, of course.  No blank
  146. lines.  If you do not include a type of file, you must type 'NONE'.
  147.  
  148. FTP PARAMETERS
  149.  
  150. -U Logon User Dispatch M -Uyourname -P Password Dispatch M -Ppassword -Q
  151. PutUnique?  Dispatch M -Q -A Account Dispatch M -Aaccountname (usually not
  152. required) -D RemoteDir Dispatch M -Dpub/incoming -R RemoteName Dispatch M
  153. -Rdispatch.zip -F LocalFile Dispatch M -Fc:\upload\dispatch.zip -H FTPHost
  154. Dispatch H -Hhobbes.mnsu.com
  155.        
  156. The same rules apply as for mail, with these changes and additions:  If you
  157. do not specify a remote file name, the local name (without path) will be
  158. used.
  159.  
  160. WARNING
  161.  
  162. All three of these functions have been somewhat tested as free standing
  163. modules.  FTP, however, was an afterthought and has not been tested since
  164. it was added.
  165.  
  166. There is only primitive error detection and handling.  This program crashes
  167. easily and cryptically.  But since it is a simple command line utility, it
  168. usually does no harm -- and tells you that it has died.
  169.  
  170. BUT -- I will not be responsible for any damage of any kind that results
  171. directly or indirectly from your use of this program.  You are warned that
  172. I am a novice programmer and that this is an experiment.
  173.  
  174. FUTURE PLANS
  175.  
  176. Add fax dispatch support.  (I already posted a utility to do this, FxShell.
  177. I will integrate it.)
  178.  
  179. Add optional, simple GUI for the functions.
  180.  
  181. Add an xternal control file feature and file lists for both mail and ftp.
  182.  
  183. THE INTELLIGENT QUEUE
  184.  
  185. I am rather proud of this feature -- although I have no idea if it actually
  186. adds to performance.  At least I got it to work.
  187.  
  188. The original model I had to work with used LINEIN and LINEOUT methods.  The
  189. pop client went like this:
  190.  
  191. Grab a handful of data from the socket Parse out the first line (by looking
  192. for a CRLF) Save it using LINEOUT Parse out the second line Save it Etc.
  193. Etc.  Retain the last bit of data in the buffer if it is a partial line
  194. Grab another handful of data from the socket.
  195.  
  196. The program forgot to strip off any dot ('.') which begins a line.  This
  197. would add more overhead.
  198.  
  199. It seemed to me that, even at disk access speeds, this method must add
  200. overhead.  So I tried to create an Object REXX Queue object with built in
  201. logic.
  202.  
  203. My intelligent Queue is a subclass of the standard queue object.  My pop
  204. client, for example, does the following in place of what I described above:
  205.  
  206. Gets a bunch of data off the socket.  Checks to see if it has the EOF
  207. marker at the end.  Queues it on the intelligent queue Gets another bunch
  208. of data off the socket Etc.
  209.  
  210. Meanwhile, the queue process has been started as a concurrent process.  It
  211. pulls data off itself, looks for dots that need stripping (without parsing
  212. the data into lines) and saves the data using CHAROUT.
  213.  
  214. The program you are about to use uses the same idea.  The intelligent queue
  215. reads in data in 10,000 character chunks.  It pads any beginning of line
  216. dots with dots.  It queues the data on itself and goes back to the file for
  217. more.  Meanwhile, the main process which created the queue starts pulling
  218. data off the queue and sending it out.
  219.  
  220. It is fast.  With text files I have peaked at 115200 -- my port speed.
  221.  
  222. The most recent version of this program uses similar queues for moving
  223. temporary data around.  For example, I use mpack to make base64 files, but
  224. strip off the headers and boundaries.  To do this, I used to make a
  225. temporary file and then copy it line by line onto the target file,
  226. stripping out unwanted data.  Now, I let an intelligent queue do the
  227. processing and use CHARIN and CHAROUT.  It is certainly faster than it was,
  228. but I have no idea if the queue adds anything at all.
  229.  
  230. DOSFILE
  231.  
  232. There is one other aspect to this program I should mention.  I use a
  233. version of a class I am working on called DOSFile.  It is an enhanced
  234. subclass of the Stream class.  Instances of the DOSFile class have all the
  235. methods of the stream class plus:  they can copy or move or delete or
  236. create themselves, parse their paths, etc.  When it moves itself (or,
  237. optionally, when it copies itself) it allows one to move its focus to the
  238. new physical file.  Let me explain:
  239.  
  240. MyFile = .DOSFile~new('c:\example1.txt')
  241.  
  242. Yields a REXX instance of the .DOSFile class.  It is manipulated by
  243. reference to the MyFile variable.  You get data out, for example, by using:
  244.  
  245. line = MyFile~linein
  246.  
  247. (I guess if it were REALLY object oriented they would have used LINEOUT,
  248. but that would have created too much confusion.)
  249.  
  250. Let's say I need to move the underlying disk file into a directory.  I
  251. might write:
  252.  
  253. MyFile~move('c:\temp\example2.txt','R','V')
  254.  
  255. MyFile now refers to c:\temp\example2.txt
  256.  
  257. So MyFile~delete, deletes the new file.
  258.  
  259. Or, let us say I want to copy data from example1.txt onto example2.txt and
  260. start dealing with the target file instead of the source file.
  261.  
  262. MyFile~copy('example2.txt','A','V','COPY')
  263.  
  264. appends the data from MyFile onto example2.txt and then switches the focus
  265. of MyFile to example2.txt.
  266.  
  267. The free standing version of DOSFile also includes methods for the file to
  268. zip itself, email itself, fax itself, base64 encode itself, etc.  In light
  269. of what I have learned from writing Dispatch I will have to rewrite DOSFile
  270. completely.  It was intended to make programming easier.  I am not
  271. completely satisfied with it from having used it, but the idea works and I
  272. will continue work on it.
  273.  
  274. LICENSE
  275.  
  276. This grants you a license to experiment with this program at your own risk
  277. until it is withdrawn.  The license will be deemed withdrawn upon release
  278. of any shareware or commercial version of the product.
  279.  
  280. FEEDBACK
  281.  
  282. Feedback is solicited.  But be gentle.  I wrote my first OREXX program only
  283. three months ago and my first real REXX program only a year ago.  And it is
  284. hard to teach old -- 50 yo -- dogs new tricks.
  285.  
  286. INSTALLATION
  287.  
  288. Almost forgot this part.  Put Dispatch anywhere you want.  Activate OREXX
  289. -- See the Warp 4 README Copy the GRXTCPIP.DLL to a directory in your
  290. LIBPATH.  Install the REXXLIB DLL contained in the Demo package enclosed.
  291. Install MPACK and UUENVIEW to directories in your PATH.
  292.  
  293. Chris Barr
  294. cbarr@ibm.net
  295.  
  296. PS
  297.  
  298. I forgot the following --
  299.  
  300. FTP -- the default mode is text. For binary, prepend the name
  301. of the file to send with an * just as a mime file is in mail:
  302.  
  303. -F*dsptcha1.zip