;
; adnroute.cfg for ADN v1.00
;
;
; This is an example adnroute.cfg of FidoNet 2:203/620.
;
;
; Lines beginning with ';', '%' or '#' are comment lines and are ignored.
; Comments cannot be put at the same line as statements or commands.
;
;
; All messages are processed one at a time, from top to bottom until
; a match is found. When a match is found, its commands is executed,
; optionally modifying the message (in memory), packing it into PKT-
; files, copy, reply or forward it. The message will then be kept or
; deleted, and then the next message will be processed (which might
; be a newly created message due to the commands executed).
;
;
; NODE <target nodes ...>
;   Messages destinated to nodes that are not sent and not received.
;
; SEND <target node> [<routed nodes ...>]
;   Messages destinated to nodes that are not sent and not received.
;   Normal messages will be routed, Crash/Direct/Hold are not
;   routed, but processed as if they where the target node.
;
; MASK <mask commands ...>
;   Flags=<+ or - followed by flag key ...>
;   MinNode=<node>
;   MaxNode=<node>
;   Orig=<zone:net/node.point> or A for any of our AKAs
;                              or P for any of our Points
;   Dest=<zone:net/node.point> or A for any of our AKAs
;                              or P for any of our Points
;   Old=<days>
;   From=<string>
;   To=<string>
;   Subj=<string>
;   Kludge=<string>
;   Body=<string>
;
; For best performance, the Mask Commands should be ordered as above.
;
; Strings are compared ignoring the upper and lower case.
;
; Strings are (by default) compared for a match of the entire field in
; question.
;
; If the string starts with a ~, the string is search for within the field
; (SubString). If the strings ends with a ~, the string must match the
; beginning of the field to search, but extra characters in the field are
; ignored. A ~ at both the beginning and ending of a string is illegal.
;
; For Klude= each kludge line is one field, for Body= each line ending with
; a hard carrige return is one field. Soft returns are converted to spaces.
;
; Leading and trailing spaces are removed from the fields From, To and Subj.
;
; Using the Kludge= and Body= is more time consuming, not only because they
; search more text, but also because the entire message must be read.
; The other mask commands only requires the header and the leading kludge
; lines to be read into memory.
;
; Kludge= doesn't search in the standard kludges rewritten by ADN, these are
; TOPT, FMPT, INTL, FLAGS, MSGID:, REPLY:, REPLYTO and REPLYADDR.
;
;
; Flags in message attribute word:
;
;  P   PVT, Private
;  C   CRA, Crash
;  R   RCV, Received
;  S   SNT, Sent
;  A   FIL, FileAttached
;  I   FWD, InTransit
;  O   ORP, Orphan
;  K   K/S, KillSent
;  L   LOC, Local
;  H   HLD, HoldForPickup
;  2   UNK, Unknown/Reserved
;  F   FRQ, FileRequest
;  Q   RRQ, ReturnReceiptRequest
;  B   CFM, IsReturnReceipt
;  &   AUR, AuditRequest
;  U   FUR, FileUpdateReq
;
; Squish uses Crash and Hold together to indicate the flag Direct. This
; is supported by ADN.
;
;
; Extended flags in the FLAGS kludge:
;
;  Z   A/S, Archive/Sent
;  D   DIR, Direct
;  G   ZON, Zonegate
;  J   HUB, Hub/Host-route
;  M   IMM, Immediate
;  W   XMA, Xmail
;  E   KFS, Kill file
;  T   TFS, Truncate file
;  $   LOK, Lock
;  3   HIR, HiRes
;  4   COV, CoverLetter
;  5   SIG, Signature
;  6   LET, LetterHead
;  X   FAX, Fax image
;  V   FPU, Force pickup
;
; These extended flags are not recognized by Squish, and ADN does only use
; them for matching purposes. Direct is converted to Crash+Hold.
;
;
; NODE <node1> is equal to:
;
; MASK Flags=-S-R Dest=<node1>
;   ... commands ...
;
;
; SEND <node1> <node2> is equal to:
;
; MASK Flags=-S-R Dest=<node1>
;   ... commands ...
; MASK Flags=-S-R Dest=<node2>
;   PKTNorm <Node1>
;   ... commands ...
;
;
; Everywhere (except for SEND and NODE, see below) strict addressing is
; used, that is a full "zone:net/node.point" notation must be used.
;
; A * instead of a zone, net, node or point number means that any number
; qualifies. * is internally represented by 65535, specifing 65535 will
; therefore be treated as *.
;
; On SEND and on NODE the first address must be strict (see above) but the
; second and later addresses can be entered in the form "net/node.point",
; "node.point" or only ".point", where the missing parts are taken from the
; previous address.
;
; On SEND the first address must not have any *.
;
; Before processing, the message flags Forward/InTransit (I) and Local (L)
; are set by ADN depending on the message origin and destiniation. Any message
; to an AKA will get -I-L. Any other message from an AKA will get -I+L. All
; other messages will get +I-L. No message will have +I+L.
;
; This means that Dest=A is equal to Flags=-I-L and Orig=A is equal to
; Flags=-I+L. Message from an AKA to an AKA (both Dest=A and Orig=A matches)
; will get -I-L (same as Dest=A).
;
; All messages with the InTransit (I) flag set (maybe by ADN as above) will
; have the flags Crash, Hold and Direct cleared by ADN, -C-H-D.
;
; Any changes of flags will show in the log, with the new flags within
; parenthesis. The changes will only be saved to disk if the message is
; written/updated.
;
;
; Commands:
;
; NewMsg [<mailpath>]           Writes the MSG as a new message to the
;                               specified area. If no area is specified the
;                               current area is used.
; CopyMsg [<mailpath>]          Writes the MSG to the specified area, keeping
;                               message date, MSGID, etc. If no area is
;                               specified the current area is used.
; File <file>                   Append MSG to a file, suitable for processing
;                               by other programs.
; Semaphore <file>              Create a file of zero length. Useful for
;                               signaling excution of other programs such
;                               as AreaFix.
; Shell <command>               Execute command as it should have been
;                               entered on the command line.
; NoteTop <file>                Add text from file at the top of MSG.
; NoteBottom <file>             Add text from file at the bottom of MSG.
; Reply <orig>                  Replies to the MSG. * in <orig> is taken
;                               from the dest of MSG. The destination of
;                               the reply is taken from the message header
;                               or the kludges REPLYTO and REPLYADDR. A
;                               header is added to the top of the message
;                               body, and all old kludges are commented out.
;                               Reply marks the message for reply, and all
;                               following CopyMsg and NewMsg will set the
;                               destination and kludges accordingly.
; Forward <orig> <dest>         Change MSG addresses, * in <orig> is taken
;                               from the orig of MSG, * in <dest> is taken
;                               from the dest of MSG. The "To" and "From"
;                               fields are not changed.
; PackSquish <orig>             If MSG is normal then pack MSG into PKT
;                               named hhhhhhhh.OUT in the Squish OUTBOUND.SQ
;                               directory, where hhhhhhhh is a unique hex
;                               number as for PKT files. If MSG is not normal
;                               a PackBink will be executed. * in <orig> is
;                               taken from the orig of MSG. Marks MSG for sent
;                               set and deletion dependning on MSG flags.
;                               PackSquish is usually only needed if you want
;                               to compress netmails. If PackSquish is used,
;                               Squish SQUASH need to be executed after ADN.
; PackBink <orig> <flavor>      Pack MSG into PKT in Binkley Outbound
;                               directories using the flavor Normal, Crash
;                               Hold or Direct. * in <orig> is taken from the
;                               orig of MSG. Marks MSG for sent set and
;                               deletion depending on MSG flags.
; PKTAddr <dest>                Sets the PKT destination address to use for
;                               PackSquish and PackBink. If PKTAddr is not
;                               used then the dest of the MSG will be used.
;                               * in <dest> is taken from the dest of MSG.
; PKTNorm <dest>                Same as PKTAddr for normal MSGs. For MSGs with
;                               Crash, Hold or Direct, the PKT dest is set to
;                               the dest of MSG.
; Flags <keys ...>              Change flags of MSG.
; Keep                          Marks the MSG for no delete.
; Delete                        Marks the MSG for delete.
;
;
; 'mailpath' is either a path to a standard FidoNet *.MSG directory,
; or if beginning with a $ character, a path and filename without
; extension to a Squish format message area.
;
; Squish format message areas are not supported yet!
;
; Note, some unnatural combinations of commands may give strange results.
; For example using Reply followed by Forward. Please study the examples
; below.
;
; The following AKAs are used by this system and illustrates the usage of
; ADN for different types of systems (Host, HUB, Node, etc):
;
; 2:203/600.0   HUB 
; 2:203/620.0   Node with points
; 9:463/600.0   HUB
;

;
; Old message that has been sent or received:
;
; Flags=-I+L is equal to Orig=A (when not Dest=A)
; Flags=-I-L is equal to Dest=A
;
MASK Flags=+S-I+L Old=7
  CopyMsg c:\msgold
  Delete

MASK Flags=+R-I-L Old=7
  CopyMsg c:\msgold
  Delete

;
; Not received messages to various robots of our system:
;
; Flags=-I-L is equal to Dest=A
;
MASK Flags=-R-I-L To=NEF
MASK Flags=-R-I-L To=Raid
MASK Flags=-R-I-L To=Ticfix
MASK Flags=-R-I-L To=Allfix
MASK Flags=-R-I-L To=Filemgr
MASK Flags=-R-I-L To=Filefix
  Semaphore h:\sem\filefix.do

MASK Flags=-R-I-L To=Areafix
MASK Flags=-R-I-L To=Areamgr
MASK Flags=-R-I-L To=Sqaverw
MASK Flags=-R-I-L To=Areaverwaltung
  Semaphore h:\sem\areafix.do

MASK Flags=-R-I-L To=Reg
  Semaphore h:\sem\msgreg.do

;
; Messages from various robots to us, to put in text files, to be processed
; by another program:
;
MASK Orig=2:20/10.0 Dest=2:203/600.0 From="IMAIL Arealink" To="Anders Danielsson" Subj="AreaLink: Short list of available echos"
  File c:\max\e20_10.msg
  CopyMsg c:\msgrobot
  Delete
MASK Orig=2:20/10.0 Dest=2:203/600.0 From="ALLFIX+" To="Anders Danielsson" Subj="AreaMgr receipt"
  File c:\max\f20_10.msg
  CopyMsg c:\msgrobot
  Delete
MASK Orig=2:203/0.0 Dest=2:203/600.0 From="(Reply from) AreaFix" To="RobotReply" Subj="Query request on 2:203/0"
  File c:\max\e203_0.msg
  CopyMsg c:\msgrobot
  Delete
MASK Orig=2:203/0.0 Dest=2:203/600.0 From="Raid v1.22 *test*" To="RobotReply" Subj="Response to remote request"
  File c:\max\f203_0.msg
  CopyMsg c:\msgrobot
  Delete
MASK Orig=9:46/0.0 Dest=9:463/600.0 From="GEcho" To="RobotReply" Subj="List of available areas for 9:463/600"
  File c:\max\e_vir.msg
  CopyMsg c:\msgrobot
  Delete
MASK Orig=9:46/0.0 Dest=9:463/600.0 From="ALLFIX+" To="Anders Danielsson" Subj="AreaMgr receipt"
  File c:\max\f_vir.msg
  CopyMsg c:\msgrobot
  Delete

;
; CarbonCopy functions
;
MASK Dest=2:203/600.0 To="All"
  File c:\tmp\adn_cc.txt
  CopyMsg c:\msgrobot
  Delete

;
; Messages address to us, all AKAs must have a match, else they
; will be routed or trapped below:
;
; Flags=-I-L is equal to Dest=A
;
MASK Flags=-I-L
  Keep

;
; Trap messages that already has passed our system (using a Pack command):
;
MASK Flags=-R-S Kludge="Via 2:203/600.0 ~"
MASK Flags=-R-S Kludge="Via 9:463/600.0 ~"
  CopyMsg c:\msgloop
  Delete

;
; Send to existing points wanting compressed netmail:
;
SEND 2:203/620.25 .27
NODE 2:203/620.10 .11 .13 .14 .15 .18 .22 .23 .24 .26 .28 .32 .33 .34 .614
  PackSquish 2:203/600.0

;
; Bounce mail to not existing points:
;
MASK Flags=-S-R Dest=P
  CopyMsg c:\msgbounc
  Reply *:*/*.0
  NoteTop c:\max\no_point.adn
  NewMsg
  Delete

;
; Send to existing nodes wanting compressed netmail
; Note, route points of node:
;
SEND 2:203/614.0 .*
SEND 2:203/625.0 .*
SEND 2:203/631.0 .* 643.* 644.*
SEND 2:203/633.0 .*
SEND 2:203/638.0 .*
SEND 2:203/640.0 .* 641.*
  PackSquish 2:203/600.0

SEND 9:463/602.0 .* 607.*
SEND 9:463/608.0 .*
SEND 9:463/609.0 .*
SEND 9:463/613.0 .*
SEND 9:463/616.0 .*
  PackSquish 9:463/600.0

;
; Send to existing nodes wanting PKT only:
;
SEND 2:203/617.0 .*
  PackBink 2:203/600.0 Hold

;
; Forward to nodes:
;
NODE 2:203/611.*
  CopyMsg c:\msgbounc
  Forward *:*/*.* 2:203/620.32
  NewMsg
  Reply 2:203/600.0
  NoteTop c:\max\203_611.adn
  NewMsg
  Delete

;
; Bounce newly downed nodes in our HUB segment:
;
NODE 2:203/618.* 619.* 622.* 624.* 634.* 637.* 639.* 642.*
  CopyMsg c:\msgbounc
  Reply 2:203/600.0
  NoteTop c:\max\down.adn
  NewMsg
  Delete

NODE 9:463/614.* 615.* 617.*
  CopyMsg c:\msgbounc
  Reply 9:463/600.0
  NoteTop c:\max\down.adn
  NewMsg
  Delete

;
; Bounce not existing nodes in our HUB/Host segment
;
MASK Flags=-S-R MinNode=600 MaxNode=699 Dest=2:203/*.*
  CopyMsg c:\msgbounc
  Reply 2:203/600.0
  NoteTop c:\max\no_node.adn
  NewMsg
  Delete

MASK Flags=-S-R MinNode=600 MaxNode=699 Dest=9:463/*.*
  CopyMsg c:\msgbounc
  Reply 9:463/600.0
  NoteTop c:\max\no_node.adn
  NewMsg
  Delete

;
; Route nodes to our uplinks:
;
SEND 9:46/0.0 9:*/*.*
  PackSquish 9:463/600.0

SEND 2:203/0.0 2:203/*.*
SEND 2:20/10.0 2:20/*.* 2:200/*.* 2:201/*.* 2:204/*.* 2:205/*.* 2:206/*.*
  PackSquish 2:203/600.0

;
; Long distance message to be routed, and to keep a second copy on hold of:
;
; Flags=-I+L is equal to Orig=A (when not Dest=A)
;
MASK Flags=-S-C-H-D-I+L Dest=1:*/*.* From="Anders Danielsson"
MASK Flags=-S-C-H-D-I+L Dest=2:*/*.* From="Anders Danielsson"
MASK Flags=-S-C-H-D-I+L Dest=3:*/*.* From="Anders Danielsson"
MASK Flags=-S-C-H-D-I+L Dest=4:*/*.* From="Anders Danielsson"
MASK Flags=-S-C-H-D-I+L Dest=5:*/*.* From="Anders Danielsson"
MASK Flags=-S-C-H-D-I+L Dest=6:*/*.* From="Anders Danielsson"
MASK Flags=-S-C-H-D-I+L Dest=1:*/*.* From="Reg"
MASK Flags=-S-C-H-D-I+L Dest=2:*/*.* From="Reg"
MASK Flags=-S-C-H-D-I+L Dest=3:*/*.* From="Reg"
MASK Flags=-S-C-H-D-I+L Dest=4:*/*.* From="Reg"
MASK Flags=-S-C-H-D-I+L Dest=5:*/*.* From="Reg"
MASK Flags=-S-C-H-D-I+L Dest=6:*/*.* From="Reg"
  PKTAddr 2:20/10.0
  PackSquish 2:203/600.0
  Flags +H+K
  NoteTop c:\max\holdcopy.adn
  NewMsg

SEND 2:20/10.0 1:*/*.* 2:*/*.* 3:*/*.* 4:*/*.* 5:*/*.* 6:*/*.*
  PackSquish 2:203/600.0

;
; All left nodes are unknown (not existing):
;
NODE *:*/*.*
  CopyMsg c:\msgbounc
  Reply 2:203/600.0
  NoteTop c:\max\bounce.adn
  NewMsg
  Delete

