

                     ##############################

                                PlutScan


                                 v 3.0


                             (c) 21-Nov-94


                             By Peter Deane


                          Written in GFA-BASIC


                     ##############################



------------
Description:
------------

PlutScan is a multi-purpose application program for anyone using a *.MSG
message  base.   And  yes!   It  can also be used on the Paragon/StarNet
message base, but not to delete messages - only to Scan and do the Stats
on them.

For  Plutonic  and  TransAmiga  BBS systems it can be used to update the
message pointers (a replacement for TrUMP).

It  will  generate  a  summary  file of the current state of the message
areas each time it's run (as a textfile in ram:)

It  will  also  generate a weekly statistics file.  (The nice bit!) This
can  be  automatically  posted as a message, if you are using a standard
*.MSG  base,  or  you can use a program like robo-writer to add the text
into your message base.

It  can  be  used on any BBS system that numbers its messages as XXX.YYY
(where  XXX  is  an integer from 1-32,767).  It does not actually matter
that  the  message  format  is a 190-byte *.MSG base.  I was amazed that
PlutScan  would  actually  keep  stats  for  Para/Star systems too!  Any
problems, let me know.

Plutscan  can also be used for maintaining the message areas by deleting
old  messages  for you.  Rather than just deleting the messages outright
it  can  also  create a textfile, in the message directory with an ascii
interepretation  of  the messages it would have normally deleted, useful
for keeping archives of the messages in important areas.

This  means  you  can  keep  your  messages  in textfile form (for later
reference)  in  a much more efficent form than *.MSG.  You can choose to
do this for ANY or all areas.

(Deletion/Textfile generation only applies to a *.MSG base)

You will be impressed with PlutScan's speed.  Even TransAmiga users will
want  to  replace  Trump  with it, not only for the increased speed, but
also because of the extra power in the stats department.


----------
Libraries:
----------

Plutscan  works  a lot better when it has access to both the arp.library
and the traplist.library.  Any version of either is fine.

PlutScan will still generate message pointers without the libraries, but
not the stats.


---------------
Plutonic.areas:
---------------

This  program  accesses  the MAIL:Plutonic.areas file to determine which
message bases are setup.

If  any  TransAmiga  sysop  wants  to use this program, I have written a
program   to  convert  the  TransAmiga  BBS:Configs/message.cfg  into  a
Plutonic.areas  file.   Contact me if you'd like a copy of this program,
it will save you a lot of work.

More  extensive information on the format of the Plutonic.areas file can
be found in the Plutonic documentation (which you should see if you have
any more questions) however to recap, it follows this format:

(note, the numbers do not form part of the config)

   1) Directory Name
   2) Name of area on the BBS/Local Screen
   3) Read security
   4) Write security
   5) Origin line. 53 Characters maximum.
   6) Node number for this area
   7) FLAGS
7n+1) Directory Name
7n+2) Name of area on the BBS/Local Screen
7n+3) Read security
7n+4) Write security
7n+5) Origin line. 53 Characters maximum.
7n+6) Node number for this area
7n+7) FLAGS

None of the following fields are used by Plutscan...

Read security
Write security
Origin line
Node number for this area

In  addition  to  the directory name and local name of the area (1st and
2nd  lines)  PlutScan  looks for two flags found on each seventh line of
the Plutonic.areas file.  The flags it uses are:

        KEEP <integer>
        LEAVE <integer>

LEAVE  will leave only that number of messages behind after Plutscanning
a message base.

KEEP  will cause a textfile called All_Msgs.txt in the message directory
to  be  created or appended to.  The file will contain the messages that
WOULD  have  been  deleted, in ASCII format.  Very efficient for keeping
the texts of some messages in your favourite areas.

You  should  add  KEEP  or  LEAVE instructions on the flags line of your
Plutonic.areas file, like in this example:


--cut--
MAIL:Matrix/
FidoNet NETmail
1
2
Doesn't matter, won't be used.
3:622/401.0
INTL KEEP 100
MAIL:InqLoc
Private Local Mail
1
1
Inquestor. GFA-BASIC is better than C.
9:200/104.5
LOCALASKYES ALIASASKNO LEAVE 30
MAIL:Inquestor/
Inquestor (Local)
1
1
Inquestor. Whaddya mean can you change it so... 
3:622/491
LEAVE 200 PRIVASKNO
--cut--


-------------
PlutScan.cfg:
-------------

PlutScan also has its own small config file, used mainly for determining
how the statistics are posted.  If you are just using PlutScan to create
mesage  pointers  for  Plutonic or Transamiga, you may not even need the
config.   However,  if  you DO wish to use the stats generator, then you
must have this file.

Note, to comment out a line, please include the ; as the FIRST character
of the line.  In any case, if a line of the config is not understood, it
will be ignored.

PlutScan.cfg  is just a general ASCII keyword type config.  The order of
the  keywords  does  not  matter,  and  as  of  V3.0  they  are not case
sensitive.   If  you use a keyword twice, the last one specified will be
the one PlutScan uses.


Firstly,  you  may  specify the four command line switches that PlutScan
understands  in the config.  These all default to off, so if you DO wish
to  activate this option, it must be in EITHER the config or the command
line!   (Both is fine if they correspond, if they don't the command line
will take precedence over the config file).


(NO)SUMMARY
-----------
Will  activate  the Summary mode of PlutScan, and thus it will leave two
files behind in Ram:  Same as specifying this switch on the command line
(see  that  section,  following).   The command line will override this,
however if they clash.

This makes it easier to run Plutscan if you always use the same options.
No more command line to enter - just type Plutscan.


(NO)TRANSAMIGA
--------------
Will generate Message.BBS files for TransAmiga.  Same as specifying this
switch  on  the command line (see that section, following).  The command
line will override this, however if they clash.


(NO)KILLOFF
------------
Determines whether PlutScan will kill messages or not.  The command line
would  override  what the config says - but you can enter your preferred
default in the config (to kill or not to kill?)


Then there are the general keywords:


(NO)4DMSGHEADER
---------------

When  creating  ASCII  files of messages that have rolled over and would
otherise  have  been  deleted (except for the KEEP x flag), this defines
whether to print the destination and origin node numbers in the textfile
in 4d or 2d format.  If your tosser is 4d header capable, please use it.

If  your  tosser  isn't 4d header capable, the Zone and Point fields for
these  addresses  is a Unix timestamp instead, so you'd get REALLY LARGE
zone  and  point  numbers shown in the texts using this method.  If this
bothers  you, turn the 4DMSGHEADER option off, and only the Net and Node
numbers will be put into the textfile.

This  option  is  only for cosmetic reasons.  If in doubt, start with it
turned  on,  and if the large zone and point numbers bother you, turn it
off.   TrapToss DOES support 4D message headers (if you have enabled the
option, of course).

Eg:

  NO4DMSGHEADER

Default:

  4DMSGHEADER


MAXAREAS
--------
Amount  of  areas  to  allow  room  for.  Always slightly OVER estimate.
Plutscan  will  only  specify  the  number of areas you specify.  If you
actually HAVE more, they will be ignored.

Eg:

  MAXAREAS 300

Default:

  500


MAXMSGS
-------
The  DEFAULT  number  of  messages  to keep in an area - IF NO NUMBER OF
MESSAGES IS SPECIFIED IN PLUTONIC.AREAS.

Note  that if you use a KEEP or LEAVE value in Plutonic.areas, then THAT
NUMBER  WILL  BE  USED.   This number is for new areas or areas that you
forget  about.   Plutscan  will  NEVER  allow  more  than this number of
messages to remain in a message directory unless told otherwise.

Eg:

  MAXMSGS 100

Default:

  250


MINMSGS
-------
The  ABSOLUTE MINIMUM number of messages to ever leave in an area.  This
overrides  EVERYTHING.   (Just  a safety fuse to prevent an area getting
completely wiped out).

Eg:

  MINMSGS 10

Default:

  50


Then are all the keywords to do with the statistics:


RUNDAY
------
The  day  of  the  week  you  want  the  Stats  generated on.  (Not case
sensitive,  BTW).   If  you  want to run the stats breakdown DAILY, then
simply  use  the  text  'DAY'  here  (it  will match any day).  To never
generate  statistics, use text that doesn't have the name of a day in it
(eg FOOBAR).

Eg:

  RUNDAY Tuesday
  RUNDAY DAY

Default:

  FRIDAY 


AREA
----
Name  of  the  directory  where  you want the stats message posted.  The
trailing  slash  is  optional.   If  omitted, one will be added.  If you
don't  want the message posted anywhere (eg you are not using a standard
*.MSG message base, set this to NIL:  or RAM:

Note  that  if you do set this to NIL:, then it will be advisable to run
PlutScan  with  the  SUMMARY command line or config keyword, so that the
text  of  the  stats  message  will  also be created as another file (ie
RAM:PlutScan.stats).

You  can  then  use  this  file  as  you see fit (perhaps for input into
another  message  writer  program  that will generate a message for your
particular BBS system from an ASCII file).


Eg:

  AREA MAIL:Inquestor/
  AREA NIL:

Default:

  RAM:


TONAME
------
Name of the 'person' to send the message to.

Eg:

  TONAME Sysop
  TONAME You lot out there

Default:

  All


SUBJECT
-------
The subject line to put on the message.

Eg:

  SUBJECT Hey, here's the stats
  SUBJECT Mail Statistics

Default:

  Periodical Breakdown of Message Areas


ORIGIN
------
The origin line to use on the message.

Eg:

  ORIGIN This origin can be up to 55 characters long.

Default:

  Weekly stats by Plutscan Vx.xx by Peter Deane

(& the correct version number will be inserted by the program)


HERE
----
The  address the message was written from.  Will be added to your origin
line.  Only available if traplist.library is kicking around so I can use
nlparseaddr(...)  from  it....  This address is fully 4 dimensional.  No
need  to  include  a  trailing  .0  or leading 3:  if that applies.  For
instance 622/401 is equivalent to 3:622/401.0.

If you have a different zone or are a point, please specify IN FULL.

Eg:

  HERE 3:622/401
  HERE 1:111/123.4

Default:

  3:0/0.0

(Default  will  be used if traplist.library isn't around, or there is an
error in typing the node number, or some other problem occurs.)


-------------
Command Line:
-------------

Plutscan understands several command line switches, which will be useful
depending on your application.

Firstly,  including  a  '?'  ANYWHERE  in the command line will give the
usage details.

There are currently four other switches:


(NO)SUMMARY      Generate a summary file in RAM:Areas.Summary

(NO)TRANSAMIGA   Generate message.BBS files as well (for TransAmiga)

(NO)KILL         Perform message pruning

STATS            Forces the program to make the stats files regardless
                 of the day it actually is.

Include  the  word  anywhere in the command line to activate the option.
(NOT  case-sensitive).  You can type the whole word if you like, or just
the first 4-5 letters

By  default,  PlutScan will generate whats.here files for Plutonic, will
not do a summary in ram, not produce TransAmiga's Message.BBS files, and
may or may not do Stats depending on what date and the RUNDAY is.

However by simply adding the keyword to the command line, you can change
the behaviour of PlutScan.

EG if you don't wish to delete any messages - just scan, then

PLUTSCAN NOKILL

will do fine.

As  you  may  have  guessed,  the  SUMMARY command is quite harmless, it
simply generates ascii files in ram.

Also,  generating the other BBS's message pointers is quite harmless, it
just uses a little more diskspace (2 blocks per message area).


--------------
General notes:
--------------


To  abort  a running Plutscan, send a Ctrl-C to the process.  (Generally
this means press Ctrl-C in the window you're running it from).

If  PlutScan  is generating its stats files, it will advise you of this,
and  warn  you  against  quitting.  Please DO NOT quit unless absolutely
necessary  in  this  case.   If,  however, it's not generating the stats
(most  of  the  time),  it  will  simply  complete the message area it's
working on and exit (freeing all resources of course).

PlutScan  will  only  generate  the stats if it is run ON THE ACTUAL DAY
specified  in  MAIL:PlutScan.cfg.  Generally, this will be arranged by a
script  or  cron.   If  for  some  reason  it  misses its day, it may be
necessary  to  edit  the  config  file  and change the RUNDAY parameter.
Alternatively  you  can  use  the STATS command from the command line to
force the stats to be generated for that run.

When you first set the program up, I suggest you run it firstly with the
SUMMARY command line.  Then get some mail into the system (or wait until
this  happens  naturally),  and toss away.  If the day is the same, edit
the  MAIL:Plutonic.Stats file so that the date on the first line is that
of  yesterday.   Then, run PlutScan again, and you'll get a breakdown of
the  mail  you  just  imported.  (Maybe you'll have the patience to just
wait a day or so and then run it).

You may change the RUNDAY parameter at any time.  It doesn't matter.

You  may  add,  subtract and rearrange your message areas at will.  That
doesn't matter.

If  you  ever change the NAME of the _directory_ the messages are stored
in  (I  personally  always use the official tagname anyway), then you'll
find  that  the  stats  for that area will be restarted.  To avoid this,
manually edit the Plutonic.stats file so the DIRECTORY name matches what
you're now going to use.

If  you  ever  renumber  an area (I don't do this very often at all) you
will  have  to  edit your Plutonic.stats file to reflect the new message
numbers.   You  only  ever have to renumber areas if the message numbers
hit  the 32,767 mark.  It takes many many months (if at all) for an echo
area  to  get 32,767 messages in it, you'll see :-) So don't worry about
renumbering  areas,  I've  only  ever had to do it four times so far and
I've been in FidoNet since the nodelist was only 1 meg in size.


--------
Contact:
--------

The author can be reached at Inquestor BBS, Newcastle, NSW, Australia.

        Peter Deane

        FidoNet:   3:622/401        Postal: PO Box 228
        GlobalNet: 54:6101/401              Swansea  NSW  2281
        AmigaNet:  41:200/401               AUSTRALIA


        Or call the BBS:   from O/S   +61-49-72-1647
        (24 hrs)           from Aust  (049) 72-1647



-------------------------
Appendix: Files Generated
-------------------------


Whats.here
----------

Used by Plutonic itself (what PlutScan was originally written for).

the format is:

# messages
lowater
hiwater

Eg:

10
3
12


Message.BBS
-----------

Used by TransAmiga.

the format is very simple:

lowater
hiwater

Since TransAmiga is in Hi-Soft, I even add the leading spaces!

Eg:

 3
 12


MAIL:Plutonic.Stats
-------------------

Safeguard  this  file!  It is the record of the messages passing through
your  system  (well,  the  area  and the hiwater mark anyway).  PlutScan
'snapshots'  the  state  of  the message areas once a week, and needs to
know how things were last time the stats section was run.

the file looks like:

19-May-92
MAIL:Matrix/
1148
MAIL:Coast_Matrix/
23456
MAIL:IntlMatrix/
456
MAIL:InqLoc/
3221
...

The  first  line  is the date the stats were last run on - Plutscan will
never  run  the stats more than once a day - and the rest of the file is
relatively  easy  to  work out.  Directory, hiwater, directory, hiwater,
etc, etc.

If you've already run PlutScan once in the day and really do want to run
it again, change the first line of this file to (say) yesterday's date.


Sample Stats Message
--------------------
This  is  a *.MSG posted in the directory you specify.  If the 'SUMMARY'
command line switch has been invoked, the text of this message will ALSO
be found in a file in ram:  called PlutScan.stats.

Anyway, the message would look a little like:


---------------------------------------------------------------------------
From: PlutScan V2.92                      Message # : 5183 of 5248
To  : All                                 Area      : Inquestor General
Date: 07 Nov 94  06:21:44                 Replies   : *
Attr: SENT LOCAL                          Times Read: 2
Subj: This week's mail stats
---------------------------------------------------------------------------
^aMSGID: 3:622/401.0 2EBDC778
^aPID: PlutScan 2.92

------------------------------------------------------------------------
      Mail statistics from 31-Oct-94 to Monday, 07-Nov-94
------------------------------------------------------------------------

     [Generated by PlutScan, written in GFABASIC by Peter Deane]

---------                    -------  ------- ------- --------  ---------
                                      % Msgs          Msg Base  Date of
Area Name                    Traffic  Report  Hiwater Size %ge  Last Msg
---------                    -------  ------- ------- --------  ---------

NET Mail                         90     1.25   15,052    2.79   06 Nov 94
Inquestor Private & Sysop         5     0.07    1,159    0.21   05 Nov 94
Inquestor General                41     0.57    5,182    0.96   06 Nov 94
Inquestor Alias Fun               1     0.01      191    0.04   30 Oct 94
Budgie Gossip                    12     0.17      682    0.13   06 Nov 94
Newcastle 4 Sale                 24     0.33      129    0.02   05 Nov 94
Newcastle Chat                   19     0.26      203    0.04   05 Nov 94
...
Sysop Coast Sysop               122     1.70      455    0.08   06 Nov 94
Sysop N200_Amy                    0     0.00      218    0.04   Wed  5 Oct
Sysop Z41Sysop_Amy              103     1.44    3,503    0.65   06 Nov 94
Sysop Sysop_amy                  30     0.42    2,168    0.40   31 Oct 94
Sysop N622                       60     0.84    2,205    0.41   05 Nov 94
Sysop RG54                        3     0.04    2,569    0.48   05 Nov 94
Sysop Zone3                      67     0.93   17,105    3.17   05 Nov 94
Sysop Globalnet BRE CoOrd         7     0.10      130    0.02   03 Nov 94
Bad_msgs                        112     1.56      162    0.03   Wed  2 Nov
                             -------  ------- -------  -------
Total Messages                 7176     1.33  539,651  100.0 %
                             -------  ------- -------  -------

--- TrapToss 1.75 beta
 * Origin: Mail Stats from Plutscan V2.92 by Peter Deane (3:622/401)


Ram:Areas.summary
-----------------

If  you specify the SUMMARY option, then this file will be found in RAM:
after PlutScan has completed.  It's self-explanatory.  This file will be
generated without the libraries being available, incidentally.


--------------------------------------
     Area: Fido NET Mail
Directory: MAIL:Matrix/
 Messages: 51
 Lo-water: 1098
 Hi-water: 1148

--------------------------------------
     Area: Local Private & Sysop
Directory: MAIL:InqLoc/
 Messages: 152
 Lo-water: 2
 Hi-water: 221

--------------------------------------
     Area: Local General
Directory: MAIL:Inquestor/
 Messages: 64
 Lo-water: 125
 Hi-water: 189


(etc, etc, etc)

You now get totals at the end, too...


