home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
pcboard
/
ntmgr95p.zip
/
NETMGR.DOC
< prev
next >
Wrap
Text File
|
1993-05-20
|
12KB
|
476 lines
==============================================================
NetMgr - copy, move, delete, change and bounce netmail..
(c) 1992,93 Gerard van Essen (2:281/527)
==============================================================
! NetMgr uses the Squish MSGAPI by Scott Dudley.
! Squish is a trademark of Scott J. Dudley
┌──────────────┬─────────────────────────────────────────────────
│ Introduction │
└──────────────┘
NetMgr is a program that will scan the messages in one area (usually the
netmail area), and analyse the headers of those messages.
NetMgr will check if any of the headers meet the criteria specified in the
configuration file (a 'mask'), created by the user. If any of those
headers are found, NetMgr can perform several actions on that message,
like moving or copying it to another message area, deleting it, changing
it etc.
┌────────────────────────────────────┬─────────────────────────────
│ A 'MASK', NetMgr's driving force.. │
└────────────────────────────────────┘
A MASK consists of five parts:
fromname, fromaddress, toname, toaddress, attributes
(1) (2) (3) (4) (5)
So 5 parts, seperated by a comma. In the config file you use the keyword
MASK to specify a mask:
MASK fromname, fromaddress, toname, toaddress, attributes
-=-
NAME : fromname, toname.
A 'name' is just a string, leading and trailing spaces found in the config
file are stripped, spaces *within* a string are allowed.
So writing " Gerard van Essen " will be the same as "Gerard van Essen".
(Note that leading and trailing spaces are stripped, while the space
between "Gerard" and "van" is still there...
-=-
ADDRESS: fromaddress, toaddress.
An address is *always* full 4D, write a '*' for any part you don't care
about:
60:*/*.* - all messages coming from zone 60
2:281/527.* - msg from any point from 281/527, or .0
*:500/*.* - all msgs from nodes/points in a net 500, any zone
2:281/527.0 - only messages from 2:281/527.0
Just one exception (to the "always 4D rule): specifying just a '*' only
for the address, is allowed (strictly speaking, it is not full 4D :-), and
is the same as *:*/*.*.
-=-
ATTRIBUTES.
Attributes can be one or more of the following:
p = private
c = crash
r = received
s = sent
a = attach
i = forward/intransit
o = orphan
k = kill
l = local
h = hold
f = file request
n = scaNned
Every attribute must have a '+' or a '-' in front of it.
A '+' means: must be present.
A '-' means: must *not* be present.
An example:
+l+p
A message only matches this, if the L)ocal bit, and the P)rivate bits are
set. The other (possible) attributes are not important.
-f+l
A message matches this, if it is *not* a F)ile request, and the L)ocal bit
is present.
+c+l+p-s
A message matches this, if the C)rash bit is set, the L)ocal bit is set
and the P)rivate bit is set. Apart the that, the message must *not* be
S)ent already..
-=-
Some examples of a complete 'MASK'.
-----------------------------------
Mask Gerard van Essen, *, *, *, +s
All messages, coming from "Gerard van Essen" on any address (*), written
TO: anyone (*) on any address (*), that are already flagged as S)ent.
IE: all messages written by me that have already been packed/sent.
--
Mask *, 2:281/527.*, uucp, 2:281/527.0, +l-h-p-k
Message written by anyone (any name: '*'), on node 2:281/527 (.* so it can
be the NODE 2:281/527 or any of its points, like 2:281/527.40).
Written TO: a guy named "UUCP" on node 2:281/527.
The L)ocal bit must be set, and the H)old, P)rivate and K)ill bits must
*not* be set.
--
Mask *, 2:281/527.*, postmaster, 2:281/527.0, *
Message written by anyone (any name: '*'), on node 2:281/527 (.* so it can
be the NODE 2:281/527 or any of its points, like 2:281/527.40).
Written TO: a guy named "Postmaster" on node 2:281/527.
The message attributes that are (not) present are not important.
--
Mask *, *, raid, 2:281/527.0, *
All messages, coming from anyone on any address, but addressed to RAID on
2:281/527. The message attributes don't matter.
┌────────────────────────┬─────────────────────────────────────────────
│ MASK's partner: ACTION │
└────────────────────────┘
A MASK is never alone, it is always accompanied by an ACTION statement.
This ACTION statement tells NetMgr what should be done with messages that
MATCH a certain MASK.
The following ACTIONs are valid:
COPY <destination area> - Copy msg to area
MOVE <destination area> - Move msg to area
DELETE - Delete message
BOUNCE <bounce text file> - Return msg to sender, add bounce text at
the top.
REWRITE <mask> - Rewrite header
A rewrite mask may contain the wildcard token ('*') as well.
All fields where a '*' is specified will be left unchanged.
ECHOCOPY <area> <seenby> - Copy, add origin, and (optionally)
SEEN-BY: line. Leave SEEN-BY: info out if
you don't want it. The text put here is
just duplicated in the SEEN-BY line, so
you can put more than one address here.
ECHOMOVE <area> <seenby> - Move and add origin, SEEN-BY..
In the config file, you specify an action using the ACTION keyword.
Some examples:
Action Delete
Delete the message
--
Action Move $c:\bink\msgs\net2
Move a message to the Squish style (leading $) area c:\bink\msgs\net2.
--
Action Move c:\msgs\rec_msg
Move a message to the *.MSG style (no leading $) area c:\msgs\rec_msg\.
--
Action Rewrite *, *:*/*.0, *, *, *
Change a message header.
Any field that has a '*' will be left untouched (in this case the
Fromname, the fromaddress zone, net and node parts), the toname, the
toaddress and the attributes.
So, the be more precise: only the pointnumber of the message sender will
be changed. Messages coming from 2:281/527.40, for example, will be
changed to a message coming from 2:281/527.0.
--
Action ReWrite *, *, Pietje Puk, *, *
This will rewrite the 'toname' part of a message, it will put "Pietje Puk"
in the TO: name-field.
--
You can also tell NetMgr to change the attributes of a message. Again, any
attributes must be preceded by a '+' or '-'.
A '+' in this case means: set this bit.
A '-' in this case means: turn this bit off.
so..
+p+l+k-c-f
.. will turn ON the P)rivate, L)ocal and K)ill bits, and turn OFF the
C)rash and F)ile request bits. Other attributes are left untouched.
Example:
Action *, *, *, *, -c+p
Turn off the crash bit for that message. Turn ON the P)rivate bit.
--
Action Bounce nojoe.txt
This will write a bounce-message (a message that is addressed to the
sender of that message), the message body will be the same as the original
message.
However, NetMgr will add the contents of a textfile at the top of the
body. In this case the contents of the file 'nojoe.txt' will be added.
The contents could be:
-=- <begin> -=-
Sorry, but Joe's modem had a heart attack, so he is currently not
available. The message you wrote will remain 'on hold' until he has a new
modem.
The original text of your message:
::::
-=- <end> -=-
And that will be added at the top.
The original message will NOT be deleted. If that is what you want, you
must add the same MASK again, but with a DELETE action. NetMgr will keep
on searching for matching MASKs, so if you specify a certain MASK twice,
you could first specify a bounce action for it, and later a delete action.
You can also, for example, first rewrite a message, and then move it, etc.
--
Action EchoCopy $c:\local\contrast 281/527 528
This will copy a message to the Squish style area C:\local\contrast, and
add 281/527 528 to the SEEN-BY. The text listed will be copied leterally,
so be VERY CAREFUL what you specify here! Test it thoroughly (together
with any downlinks) before using it!!
┌───────────────────────────────┬────────────────────────────────────
│ MASK and ACTION in NetMgr.cfg │
└───────────────────────────────┘
A MASK must *always* have one (and only one) corresponding ACTION in
netmgr.cfg. NetMgr will NOT run if anything is wrong in the config.
So there are always 'pairs':
Mask *, *, Harry Twit, *, *
Action Delete
Any message that matches the MASK will be deleted.
--
Mask *, *, *, 60:*/*.*, *
Action Move $c:\bink\msgs\net2
Any message addressed to a zone 60 address will be moved.
--
Mask *, *, *, *, +r
Mask Move $c:\msgs\received
All received messages will be moved.
etc.
Please see the sample configuration file for more (complete) examples.
┌──────────────────────────────┬────────────────────────────────────
│ Other keywords in netmgr.cfg │
└──────────────────────────────┘
HOME
====
Example:
Home 2:281/527.0
Your address, used as orig-address for bounce messages. The zone is also
used as a default value for 'zoneless' messages (only *.MSG style
areas)...
This address is also used for EchoCopy and EchoMove, as the address to be
used in the origin, and to generate the MSGID with.
This *must* be a full 4D address (as all addresses in netmgr.cfg should
be..). This is a bit 'strict checking', but with actions like 'delete' I
want to take no risks.
NetMgr will exit as soon as an error is detected in the configuration (for
the same reason: safety first). So if you change anything in the config,
you should first give it a 'test run'.
SCANDIR.
========
Example:
ScanDir c:\fd\netmsgs
The directories to scan, at least your primary netmail dir, I guess..
A '$' in front of an area indicates a Squish style area.
You can have as many of these as you like, NetMgr will scan each and every
one of them..
ORIGIN.
=======
Origin NetMgr, (c) 1992,93 Gerard van Essen
An originline, will be used for EchoCopy and EchoMove.
LOG.
====
Log c:\tc\netmgr\netmgr.log
The location and name of your logfile. Leave this keyword out if you don't
want a logfile.
┌─────────────────────────┬─────────────────────────────────────────
│ Command line parameters │
└─────────────────────────┘
There are only two:
-D
For 'debugging' purposes you can start netmgr with the -d command line
switch. This will send NetMgr's interpretation of your config file to
stdout.
While scanning your netmail area, it will also send some info about the
headers of the messages to stdout.
You can easily redirect it to a file (netmgr -d > debug.txt) for
inspection.
--
-C
Here you can specify the name of an alternative Config file. For example:
NetMgr -Cc:\netmgr\mycfg.txt
┌─────────────┬─────────────────────────────────────────────────────────
│ Errorlevels │
└─────────────┘
Three possibilities:
0 : No errors, no work done.
1 : No errors, something done (move, copy, bounce or whatever. Anything.)
254 : Error occurred (outa mem, config error etc).
┌───────────────┬───────────────────────────────────────────────────────
│ What's left.. │
└───────────────┘
Several things, I guess. But right now I don't have any time to make
decent docs. This will have to do for now. Just experiment, it's not that
difficult.
As soon as you have problems, use the -D command line switch.
Don't get confused by all the '*' tokens in the Mask and Action lines :-)
Some bits and pieces..:
* NetMgr was compiled using Borland C++, v3.1 (DOS version) and Borland
C++ for OS/2, v1.00 (OS/2 version).
* NetMgr is Freeware, anyone can use it without paying me.
* Noboby may SELL NetMgr, or otherwise make money out of it.
* NetMgr source code is not and will not be available.
The author can be reached...
Gerard van Essen
FidoNet: 2:281/527
Contrast BBS, 31-70-3234903 (V32bis max.)
I'm always available for bugs, comments and suggestions. Right now I
hardly have any time, so don't expect too much (apart from a short reply).
But there's always the future with lots of time (I hope!), and because I
save all suggestions/comments, they will probably be very useful to me in
the future!
Have fun.