


                                  L   L  L   L
                                  LL LL  LL LL
                                  L L L  L L L
                                  L   L  L   L
                                  L   L  L   L


    LLLL   L   L  L   L  LLLL   L     LLLLL  LLLLL  LLL  L     LLLLL   LLL
    L   L  L   L  LL  L  L   L  L     L      L       L   L     L      L
    LLLL   L   L  L L L  L   L  L     LLLL   LLLL    L   L     LLLL    LLL
    L   L  L   L  L  LL  L   L  L     L      L       L   L     L          L
    LLLL    LLL   L   L  LLLL   LLLL  LLLLL  L      LLL  LLLL  LLLLL   LLL


                             L   L  LL    LLL   LL
                             L   L L  L      L L  L
                             L   L L  L    LL    L
                              L L  L  L      L  L
                               L    LL  L LLL  LLLL




                           (C)  1996  Robert Hofmann





 1. Introduction
 ===============

  1.1 Legal stuff
  ---------------

   MM_BundleFiles is a utility for Mail Manager by Pino Aliberti to bundle small
   files like ticks to one archive  and extract incoming file-bundles. Most DOS-
   tickers do already have such  a feature, maybe you know  those *.LIC or *.ZIC
   files where small files are stored in. Here we have it for the Amiga! :-)


   The programs and files in this distribution are freely distributable, but are
   also Copyright (c) Robert Hofmann.  They may be freely distributed as long as
   no more than a nominal fee is charged to cover time and copying costs.

   No commercial usage is  permitted without  written permission from the author
   Everything in this distribution must be kept together, in original unmodified
   form.


   MM_BundleFiles is mailware :-). This  means if  you use it, please write me a
   short mail. You know,  it is frustrating  to write programs  and there are no
   responses from the users if they like it or not...


   Accepting these few points is the only condition for using MM_BundleFiles...



   =============================================================================
   The author is not responsible for any  problems caused by using this program!
   =============================================================================



  1.2 General stuff
  -----------------

   I am not the best in  writing doc, but quiet good  in coding I think :-) This
   docs are a bit  short I have to  appolognize, but I hope you'll understand it
   anyway... Especially my English and the typo's ;-)


   If there is  anybody out there  who is able to &  wants translate the docs to
   his own language, please do so and send them to me! I'll add them to the next
   release. Also translators always will get the newest betas! ;-)

   Unfortunatly I don't have the will & time to translate my docs even to German
   - my time is better used for coding :-)





  1.3 Author
  ----------

   If  you  have  suggestions  or remarks about this program, or if you find any
   bugs, please let me know.


   Contacting the author:

     Internet .. :  robert@next.amistep.osn.de (soon!)
     FidoNet ... :  2:2490/1015.0   (may change soon!)
     AmigaNet .. :  39:171/101.0

     Snail-mail  :  Robert Hofmann
                    Volkmannstr. 35
                    D-90443 Nürnberg
                    Tel. +49-(0)-911-9941680 (18-20h German time only!!!)
                    Germany

     Bank-Account:  Account-holder:  Robert Hofmann
                    Account-number:  67920
                    Bank-ID ..... :  76090000
                    S.W.I.F.T.code:  GENO DE MV 760
                    Bank-name ... :  Volksbank Nuernberg e.G.





 2. Features
 ===========

  MM_BundleFiles...

     ... is able to archive various small files related to a flow of a node into
         an archive
     ... is able to extract such file-bundles of course :-)
     ... is able to rescue ticks
     ... has an advanced cfg-reading mechanism (<< 1sec)!





 3. Installation
 ===============

  1. Copy the files to the related MM:-directories.

  2. Adjust its cfg to your own needs.

  3. Add  "rx MM:Rexx/MM_BundleFiles UNARC"  somewhere  before   the  import.  I
     suggest to use MM_ImportPlus: "#BEFORECMD ...".

  4. Add  "rx MM:Rexx/MM_BundleFiles ARC" somewhere after  the import. I suggest
     to use MM_ImportPlus: "#BOTHCMD ...".





 4. Usage
 ========

  [RX] MM_BundleFiles[.rexx] ARC/S,UNARC/S,RESCUE/S,CPLCFG/S,TEST/S

    ARC     Analyse flows and add small files to a filebundle (see also 6.1)

    UNARC   Check for incoming filebundles and extract them   (see also 6.2)

    RESCUE  Try to rescue ticks where the  associated file was missing (see also
            6.3)

    CPLCFG  Force the compilation of the cfg again

    TEST    Just test  it, do NOTHING - even if  msgs  are printed!  Filebundles
            will  be created, but  neither flow-files  will be change  nor files
            will be deleted. Just look for *.test-files in your outbound...


  Asy you may have seen, there  is a second  script called  "MM_BundleFiles.rexx
  .cmp" included. This  is a exacltly  the same script  as "MM_BundleFiles.rexx"
  itself, except that it was compressed with "CompressRexx v2.1".

  On slow machines, it  might be useful to  replace the uncompressed script with
  the  compressed one because it is slightly faster... But  please test it first
  with the uncompressed  version, because if an error occurs,  finding the error
  due to error-reports of the compressed script is nearly impossible!

  If you really want to use  the compressed script, you  have to REPLACE the un-
  compressed script with the compressed  one! The used script MUST exactly named
  "MM:Rexx/MM_BundleFiles.rexx", otherwise it will not work!





 5. Configuration
 ================

  MM_BundleFiles has an advanced config-reading-mechanism, which implements your
  config directly to the  script itself. This means once the config is compiled,
  it will need less than one second (A3000 50/50MHz) to read its config!

  Only if you change the  config, it will need a while until all checks are done
  and the config is compiled.


  Please take a close look on the example-cfg!



  5.1 #ARCHIVER EXTENSION/A,OFFS/A,ID/A,ARCCMD/A,UNARCCMD/A,EXTENSION/A,PATTERN
  -----------------------------------------------------------------------------

   Define your archivers.  You have to do that,  because I have no chance to get
   these info from MM.cfg  8^(.

   It is the same syntax as in MM.cfg, so you just can cut it from there.

   The only thing you have to add is  the EXTENSION. This is the ending of a the
   filebundle. Normally you should use something like

     JIC  ->  Arj
     LIC  ->  Lha
     XIC  ->  Lzx
     ZIC  ->  Zip

   If some of your links  does send you filebundles  with other names  than your
   used EXTENSION, you  have to set  these PATTERN's, so that  MM_BundleFiles is
   able to detect also those bundles. You can use any AmigaDOS-wildcard for this
   but I suggest to use  only simple patterns. If you  want to add more than one
   pattern, you have to encose them into quotation-marks like "#?.L?C #?.U??".

   OFFS & ID are not used but added for compatibility reasons...


   Example:
   --------

    #ARCHIVER LZH 2 "-lh5" "lha a"	"lha e" LIC "#?.L?C TO__1015.L??"



  5.2 #BACKUP DIR
  ---------------

   Backup incoming filebundles to DIR or MM's #BACKUPDIR if no dir is given.


   Example:
   --------

    #BACKUP Tmp:



  5.3 #BUNDLEDIR DIR/A
  --------------------

   Override MM's bundledir. This may be  usefull if you set a very high maxfile-
   size (see 5.5)...


   Example:
   --------
    #BUNDLEDIR Tmp:



  5.4 #TMPDIR DIR/A
  -----------------

   Override MM's #WORKDIR. Normally it is ok to use MM's workdir also for this.


   Example:
   --------

    #TMPDIR Out:Tmp/



  5.5 #MAXFILESIZE KB_SIZE/A/N
  ----------------------------

   Add all files up to KB_SIZE. This means all  files of a flow, except  bundles
   & pkts will be  added to the  filebundle if they  are  smaller than the cfged
   value.


   Example:
   --------

    #MAXFILESIZE 10



  5.6 #FORCEARC PATTERN/A,DELETE/S
  --------------------------------

   Add these files in any case,  disregarding #MAXFILESIZE.  PATTERN is a  valid
   AmigaDOS-wildcard.

   If you set DELETE, the file will be deleted after adding to the archive. This
   has normally to be done only with tick-files.


   Examples:
   ---------

    #FORCEARC *.(ADS|RDM|readme|RUL|TXT)
    #FORCEARC *.TIC                      DELETE



  5.7 #ARCNODE NODE/A,ARCER/K,NAME/K
  ----------------------------------

   Nodes to archive  small files for...  If no  ARCER is set,  the one  cfged in
   MM.cfg for that node is used.

   If no NAME is set, the 4D flow-basename will be used, e.g. 39.171.101.0.


   Example:
   --------

    #ARCNODE 2:2490/1090.0@FidoNet



  5.8 #(NO)SORTFLOWS
  ------------------

   If you set #SORTFLOWS, MM_BundleFiles will sort all files in a flow, begining
   with "-", "^", or "#" before  files that will  not be deleted. This means all
   mailbundles etc. will be sent first and then the files.


   Example:
   --------

    #SORTFLOWS





 6. Theory of operation
 ======================


  6.1 ARCing - generating filebundles
  -----------------------------------

   Normally, you do this immediatly after an import. MM_BundleFiles will analyse
   the flows (tickflavour) of the cfged nodes. For a fast processing, MM_Bundle-
   Files  uses an  index, called  MM:Config/MM_BundleFiles.idx, where  the name,
   size, date & time of the flow are stored. If all is the same than at the last
   scan, the flow will not be checked. Otherwise the flow will be checked.
   Therefore the currently  processed flow will  be checked if it is  locked and
   renamed to  <flow>.tmp to  prevent  that your  mailer will  start transfering
   files belonging to this flow while a filebundle is created.

   Now it will check if there are files that have to be added to a bundle in any
   case  or if they are  below  maxfilesize. If  so, the file will  be copied to
   <tmpdir>/MM_BundleFiles/ (automatically created and deleted).

   After all files were checked they will be archived to the cfged bundledir. If
   this was successfull, all files to be deleted will be removed and the new
   flow will be written and renamed back to its original name.


   IMPORTANT: No other prgs  (except your  mailer(s)) have  to process flowfiles
              while MM_BundleFiles is working!!!



  6.2 UNARCing - extracting filebundles
  -------------------------------------

   MM_BundleFiles will just  look for files ending with  one of the cfged exten-
   sions, extract them to  <tmpdir>/MM_BundleFiles/ and move all to your inbound
   after all was successful.

   This has of  course  to be done before MM's  import. So MM will  import these
   files just like usual.



  6.3 RESCUE - try to rescue ticks where the associated file was missing
  ----------------------------------------------------------------------

   If you  receive a  filebundle  before all files  arrived and  there happens a
   CARRIER LOST  before all  files were  received, MM tosses  all received ticks
   without a file  to bad as  "Associated File Missing". If  you now  resume the
   call, the files are left in the inbound because the ticks are in bad. 8^(

   For exact this situation  RESCUE is the solution! It  will check MM's #BADDIR
   for ticks with filenote  "Associated File Missing", look if the corresponding
   file  is in the  inbound, and if so, move  the tick from  bad to your inbound
   again. So that at the next tickimport, the files can be tossed as usual. :-)





 7. MM_BundleFile_SetCfg
 =======================

  This is just a small tool to get/set/delete a node from/to MM_BundleFiles.cfg.
  It is  thought to be  implemented in a  FileFix/Raid, like  MM_AreaManager, so
  that your links can switch filebundling via FileFix.


  It is very simple to use:

   [RX] MM_BundleFile_SetCfg[.rexx] GET/S,NODE/K/A
   or                               SET/S,NODE/K/A,DELETE/S
   or                               SET/S,NODE/K/A,ARCHIVER/K,NAME/K


    GET       Get the cfg-entry. The matching cfg-line will be printed to STDOUT
              and the clip "MM_BundleFiles_Cfg" will be set with this line.

    SET       Add/change a cfg-entry. The new  line will also be set to the clip
              "MM_BundleFiles_Cfg".

    NODE      The nodenumber to to be configured.

    DELETE    Delete a #ARCNODE-entry from the cfg.

    ARCHIVER  Set this archiver for NODE. Use "*" to delete the archiver. Other-
              wise the cfged archiver will not be changed.

    NAME      Set the bundlefile-NAME. Use "*" to delete the name. Otherwise the
              cfged name will not be changed.





 8. Acknowledgements
 ===================

  Pino Aliberti     For his EXCELLENT Mail Manager! For  implementing nearly all
                    I wanted (this was much work I think and delayed the release
                    of MM for  some month ;-)) For our  hard but fair  fights in
                    MMBETA and at least  for the nice note  about me in the docs
                    8^))))


  Ulrich Lammers    For some bugreports


  Kent Hansen       For some bugreports


  Ingo Jürgensmann  For some bugreports











  _  o         Robert Hofmann         2:2490/1015@FidoNet   37:108/220@TrekNet
 |<)_/#                              39:171/101@AmigaNet   107:1805/230@TrekNet
 TT  <T  robert@next.amistep.osn.de  56:63/201@XNet        213:314/9127@XCessNet

