home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / mailers / im140g.zip / IM_STRUC.H < prev    next >
C/C++ Source or Header  |  1993-05-29  |  34KB  |  971 lines

  1.  
  2. /* *
  3.  * *
  4.  * *   I M A I L   D E F I N I T I O N S   A N D   S T R U C T U R E S
  5.  * *
  6.  * */
  7.  
  8. /*
  9.  *  Definitions and structures for IMAIL 1.40 Gamma
  10.  *
  11.  *  Copyright (C) 1992/1993 by IMAIL INC. All rights reserved.
  12.  *
  13.  *  The contents of this file are subject to change without notice!
  14.  *  Fields marked reserved may NOT be used.
  15.  *
  16.  *  It is an ERROR to write to any of the configuration files
  17.  *  while IMAIL (or any of its companion programs) is running.
  18.  * 
  19.  */
  20.  
  21. #include <dir.h>
  22. #include <io.h>
  23. #include <time.h>
  24.  
  25. #define IMAIL_MAJ_VERSION     1
  26. #define IMAIL_MIN_VERSION     40
  27. #define STRUCT_MAJ_VERSION    1
  28. #define STRUCT_MIN_VERSION    00
  29. #define IM_PRD_CODE           0x4B
  30.  
  31. /*
  32.  *
  33.  *  Data type definitions
  34.  *
  35.  */
  36.  
  37. #define byte                 unsigned char
  38. #define word                 unsigned
  39. #define boolean              int
  40. #define integer              int
  41.  
  42. typedef unsigned int         bit;
  43.  
  44. /*
  45.  *
  46.  *  Internal limits
  47.  *
  48.  */
  49.  
  50. #define MAXAKAS              16      // Max # of addresses
  51. #define MAXPACKERS           11      // Max # of packer def
  52. #define MAXEXPORT            60      // Max export defs
  53. #define MAXVIA               40      // max nodes packed via
  54. #define MAXGROUPS            26      // max nodes packed via
  55. #define MAXEXCEPT            10      // max EXCEPT nodes
  56. #define MAXPACK              32      // max default pack cmd
  57. #define MAXFWDLINK           10      // max fwd link structs
  58. #define MAXNOIMPT            20      // max # names for IMPORT
  59. #define ZONESDOM             10      // zones per domain entry
  60. #define MAXTAG               51      // max areatag length
  61. #define MAXNAME              37      // max namefield lenght
  62. #define MAXPACKNAME          50      // max packer length
  63. #define MAXORIGIN            64      // max origin length
  64.  
  65. /*
  66.  *
  67.  *  Log Style Definitions
  68.  *
  69.  */
  70.  
  71. #define LOG_NORMAL           0                        // normal log level
  72. #define LOG_VERBOSE          1                        // verbose log level
  73.  
  74. #define LOG_LOG              252                      // Always, but to file
  75. #define LOG_SCREEN           253                      // Always, but to scrn
  76. #define LOG_ALL              254                      // Always log this
  77. #define LOG_ERROR            255                      // Force error logging
  78.  
  79. /*
  80.  *
  81.  *  Environment Type  (FroDo or Bink)
  82.  *
  83.  */
  84.  
  85. #define ENV_FRODO            0                        // FrontDoor/D'Bridge
  86. #define ENV_BINK             1                        // Binkley
  87.  
  88. /*
  89.  *
  90.  *  File Attach Message Status (used in IMAIL.ND)
  91.  *
  92.  */
  93.  
  94. #define S_NORMAL             0
  95. #define S_HOLD               1
  96. #define S_CRASH              2
  97. #define S_IMMEDIATE          3
  98. #define S_DIRECT             4
  99. #define S_NORMAL_DIR         4
  100. #define S_HOLD_DIR           5
  101. #define S_CRASH_DIR          6
  102. #define S_IMMEDIATE_DIR      7
  103.  
  104. /*
  105.  *
  106.  *  Message Base Types
  107.  *
  108.  */
  109.  
  110. #ifndef MSGTYPE_SDM
  111.   #define MSGTYPE_SDM     0x01
  112. #endif
  113. #ifndef MSGTYPE_SQUISH
  114.   #define MSGTYPE_SQUISH  0x02
  115. #endif
  116. #ifndef MSGTYPE_HUDSON
  117.   #define MSGTYPE_HUDSON  0x03
  118. #endif
  119. #ifndef MSGTYPE_QBBS
  120.   #define MSGTYPE_QBBS    0x03
  121. #endif
  122. #ifndef MSGTYPE_PASSTH
  123.   #define MSGTYPE_PASSTH  0x0F
  124. #endif
  125. #ifndef MSGTYPE_ECHO
  126.   #define MSGTYPE_ECHO    0x80
  127. #endif
  128. #ifndef MSGTYPE_LOCAL
  129.   #define MSGTYPE_LOCAL   0x90
  130. #endif
  131. #ifndef MSGTYPE_NET
  132.   #define MSGTYPE_NET     0xA0
  133. #endif
  134.  
  135. /*
  136.  *
  137.  *  Via Line Switches
  138.  *
  139.  */
  140.  
  141. #ifndef VIA_NONE
  142.   #define VIA_NONE        0x01
  143. #endif
  144. #ifndef VIA_EXP
  145.   #define VIA_EXP         0x02
  146. #endif
  147. #ifndef VIA_IMP
  148.   #define VIA_IMP         0x03
  149. #endif
  150. #ifndef VIA_BOTH
  151.   #define VIA_BOTH        0x04
  152. #endif
  153.  
  154. /*
  155.  *
  156.  *  Dupe ring check switches
  157.  *
  158.  */
  159.  
  160. #ifndef DUPE_NONE
  161.   #define DUPE_NONE        0x00
  162. #endif
  163. #ifndef DUPE_WARN
  164.   #define DUPE_WARN        0x01
  165. #endif
  166. #ifndef DUPE_ZONE
  167.   #define DUPE_ZONE        0x02
  168. #endif
  169. #ifndef DUPE_KILL
  170.   #define DUPE_KILL        0x03
  171. #endif
  172.  
  173. /*
  174.  *
  175.  *  Circular path detection switches
  176.  *
  177.  */
  178.  
  179. #ifndef CPD_NONE
  180.   #define CPD_NONE        0x00
  181. #endif
  182. #ifndef CPD_WARN
  183.   #define CPD_WARN        0x01
  184. #endif
  185. #ifndef CPD_KILL
  186.   #define CPD_KILL        0x02
  187. #endif
  188.  
  189. /*
  190.  *
  191.  *  Unlink handling
  192.  *
  193.  */
  194.  
  195. #ifndef ULNK_NONE
  196.   #define ULNK_NONE        0x00
  197. #endif
  198. #ifndef ULNK_PASSTH
  199.   #define ULNK_PASSTH      0x01
  200. #endif
  201. #ifndef ULNK_ALL
  202.   #define ULNK_ALL         0x02
  203. #endif
  204.  
  205. /*
  206.  *
  207.  *  Personal Mail handling
  208.  *
  209.  */
  210.  
  211. #ifndef PERSM_NONE
  212.   #define PERSM_NONE       0x00
  213. #endif
  214. #ifndef PERSM_LOG
  215.   #define PERSM_LOG        0x01
  216. #endif
  217. #ifndef PERSM_MSG
  218.   #define PERSM_MSG        0x02
  219. #endif
  220. #ifndef PERSM_COPY
  221.   #define PERSM_COPY       0x03
  222. #endif
  223.  
  224. /*
  225.  *
  226.  *  AreaLink Request Handling
  227.  *
  228.  */
  229.  
  230. #ifndef KEEP_NONE
  231.   #define KEEP_NONE        0x00
  232. #endif
  233. #ifndef KEEP_MSG
  234.   #define KEEP_MSG         0x01
  235. #endif
  236. #ifndef KEEP_ALL
  237.   #define KEEP_ALL         0x02
  238. #endif
  239.  
  240. /*
  241.  *
  242.  *  Macros to make life easier
  243.  *
  244.  */
  245.  
  246. #define BASEMASK          0x0F
  247. #define TYPEMASK          0xF0
  248.  
  249. #define IsSdm(Type)       ((Type & BASEMASK) == MSGTYPE_SDM)
  250. #define IsMsg(Type)       ((Type & BASEMASK) == MSGTYPE_SDM)
  251. #define IsSquish(Type)    ((Type & BASEMASK) == MSGTYPE_SQUISH)
  252. #define IsHudson(Type)    ((Type & BASEMASK) == MSGTYPE_HUDSON)
  253. #define IsQbbs(Type)      ((Type & BASEMASK) == MSGTYPE_QBBS)
  254. #define IsPassth(Type)    ((Type & BASEMASK) == MSGTYPE_PASSTH)
  255. #define IsEcho(Type)      ((Type & TYPEMASK) == MSGTYPE_ECHO)
  256. #define IsLocal(Type)     ((Type & TYPEMASK) == MSGTYPE_LOCAL)
  257. #define IsNet(Type)       ((Type & TYPEMASK) == MSGTYPE_NET)
  258.  
  259.  
  260. /*
  261.  *
  262.  *  Exit Errorlevels & Error Messages
  263.  *
  264.  */
  265.  
  266. #define E_NOERR              0            // no error
  267. #define E_CRDIR              238          // Error creating directory
  268. #define E_ELOCK              239          // File locking error
  269. #define E_AOPEN              240          // Error opening IMAIL.AX
  270. #define E_BOPEN              241          // Error opening IMAIL.BX
  271. #define E_NOIDX              242          // Index file missing/corrupt
  272. #define E_NOCFG              243          // IMAIL.CF not found
  273. #define E_NOARE              244          // IMAIL.AR not found
  274. #define E_NONOD              245          // IMAIL.ND not found
  275. #define E_BADCF              246          // Error in IMAIL.CF
  276. #define E_BADVR              247          // Bad version of IMAIL.CF
  277. #define E_EOPEN              248          // Error opening file
  278. #define E_EREAD              249          // Error reading file
  279. #define E_EWRIT              250          // Error writing file
  280. #define E_CMDPR              251          // Command Line Parameter error
  281. #define E_FILNF              252          // File not found
  282. #define E_MEMRY              253          // Memory Allocation error
  283. #define E_DISKF              254          // Insufficient disk space
  284. #define E_UNKWN              255          // Unknown error
  285.  
  286. /* === ERRORLEVELs returned by TOSS and/or SCAN === */
  287.  
  288. #define T_NOMAIL             0x00         // no mail processed
  289. #define T_NET                0x01         // Net mail
  290. #define T_ECHO               0x02         // Echo mail
  291. #define T_BAD                0x04         // Bad and/or dupe mail
  292. #define T_QBBS               0x08         // Qbbs message base changed
  293. #define T_MSG                0x10         // *.MSG message base changed
  294. #define T_SQUISH             0x20         // Squish message base changed
  295. #define T_PERS               0x40         // Mail to Sysop received
  296.  
  297. /*
  298.  *
  299.  *  Special values for 'ALL'
  300.  *
  301.  */
  302.  
  303. #define ZONE_ALL             56685u
  304. #define NET_ALL              56685u
  305. #define NODE_ALL             56685u
  306. #define POINT_ALL            56685u
  307.  
  308. /*
  309.  *
  310.  *  Misc other definitions required
  311.  *
  312.  */
  313.  
  314. #define FA_ANYFILE FA_RDONLY+FA_HIDDEN+FA_SYSTEM+FA_ARCH
  315.  
  316. #define TRUE                1
  317. #define FALSE                0
  318. #define BLANK              ' '
  319.  
  320. typedef char str255[256];
  321. typedef char str35[36];
  322. typedef char str16[16];
  323.  
  324. typedef char pktdate[20];
  325.  
  326. typedef struct array512 {
  327.   word         len;
  328.   char         longstring[512];
  329. } array512;
  330.  
  331. /* define some simple keyword replacements */
  332.  
  333. #define strdelete(s,p,num) strcpy(s+p-1,s+p+num)
  334.  
  335. #define STRSIZ               255                  // default string length
  336.  
  337. /*
  338.  *
  339.  *  In case your compiler doesn't have these ...
  340.  *
  341.  */
  342.  
  343. #ifndef MAXPATH
  344.   #define MAXPATH            80
  345. #endif
  346. #ifndef MAXDRIVE
  347.   #define MAXDRIVE           3
  348. #endif
  349. #ifndef MAXDIR
  350.   #define MAXDIR             66
  351. #endif
  352. #ifndef MAXFILE
  353.   #define MAXFILE            9
  354. #endif
  355. #ifndef MAXEXT
  356.   #define MAXEXT             5
  357. #endif
  358.  
  359.  
  360. /*
  361.  *
  362.  *                 QuickBBS Structures
  363.  *
  364.  */
  365.  
  366. typedef byte flagtype[4];
  367.  
  368. typedef struct userrecord {   /*  Used in the USERS.BBS File  */
  369.   char         name[36];
  370.   char         city[26];
  371.   char         pwd[16];
  372.   char         dataphone[13];
  373.   char         homephone[13];
  374.   char         lasttime[6];
  375.   char         lastdate[9];
  376.   byte         attrib;
  377.   flagtype     flags;
  378.   integer      credit;
  379.   integer      pending;
  380.   integer      timesposted;
  381.   integer      highmsgread;
  382.   integer      seclvl;
  383.   integer      times;
  384.   integer      ups;
  385.   integer      downs;
  386.   integer      upk;
  387.   integer      downk;
  388.   integer      todayk;
  389.   integer      elapsed;
  390.   integer      len;
  391.   byte         extraspace[8];
  392. } userrecord;
  393.  
  394. /* --- Attrib: -----------------------------------------------------
  395.  
  396.     Bit 0: Deleted
  397.     Bit 1: Screen Clear Codes
  398.     Bit 2: More Prompt
  399.     Bit 3: ANSI
  400.     Bit 4: No-Kill
  401.     Bit 5: Ignore Download Hours
  402.     Bit 6: ANSI Full Screen Editor
  403.     Bit 7: [ Reserved ]
  404.  
  405.     ------------------------------------------------------------- */
  406.  
  407. /*
  408.  *
  409.  *  Message Records
  410.  *
  411.  */
  412.  
  413. typedef struct inforecord {                   //  Used in the MSGINFO.BBS file
  414.   word         lowmsg;                        //  Lowest Message in File
  415.   word         highmsg;                       //  Highest Message in File
  416.   word         totalactive;                   //  Total Active Messages
  417.   word         activemsgs[200];
  418. } inforecord;
  419.  
  420. typedef struct idxrecord {                    //  Used in the MSGIDX.BBS file
  421.   word         msgnum;
  422.   byte         board;
  423. } idxrecord;
  424.  
  425. typedef struct hdrrecord {                    //  Used in the MSGHDR.BBS file
  426.   word         msgnum, replyto, seealsonum, tread;
  427.   word         startrec;
  428.   word         numrecs, destnet, destnode, orignet, orignode;
  429.   byte         destzone, origzone;
  430.   word         cost;
  431.   byte         msgattr, netattr, board;
  432.   char         posttime[6];
  433.   char         postdate[9];
  434.   char         whoto[36], whofrom[36];
  435.   char         subj[73];
  436. } hdrrecord;
  437.  
  438.  
  439. /* --- Msg Attributes: --------------------------------------------- */
  440.  
  441. #define QMSGDELTD   0x01         // deleted message,          0000 0001
  442. #define QMSGOUTN    0x02         // outgoing net message      0000 0010
  443. #define QMSGISNET   0x04         // Is a net message          0000 0100
  444. #define QMSGPRIVATE 0x08         // Private                   0000 1000
  445. #define QMSGREAD    0x10         // Received                  0001 0000
  446. #define QMSGOUTE    0x20         // Outgoing echo message     0010 0000
  447. #define QMSGLOCAL   0x40         // Local                     0100 0000
  448. #define QMSGXX1     0x80         // [reserved]                1000 0000
  449.  
  450. /* --- Net Attributes: --------------------------------------------- */
  451.  
  452. #define QNETKILL    0x01         // Kill when sent            0000 0001
  453. #define QNETSENT    0x02         // Sent                      0000 0010
  454. #define QNETFILE    0x04         // File attach               0000 0100
  455. #define QNETCRASH   0x08         // Crash Priority            0000 1000
  456. #define QNETRRQ     0x10         // Request Receipt           0001 0000
  457. #define QNETARQ     0x20         // Audit request             0010 0000
  458. #define QNETCPT     0x40         // Is a return receipt       0100 0000
  459. #define QNETXX1     0x80         // [reserved]                1000 0000
  460.  
  461. /* --------------------------------------------------------------------
  462.  
  463.     Each record in the MSGTOIDX.BBS file is of type String[35], each
  464.     entry is simply the name of the person the corresponding message
  465.     in MSGHDR.BBS is addressed to.
  466.  
  467.     Each record in the MSGTXT.BBS file is of type String[255], each
  468.     entry is used to store blocks of message text.  The variable
  469.     "StartRec" in the MSGHDR.BBS file contains the starting record
  470.     position for the text, the variable "NumRecs" indicates how many
  471.     consecutive blocks of text there are in the MSGTXT.BBS file.
  472.  
  473.    ----------------------------------------------------------------- */
  474.  
  475.  
  476. /* *
  477.  * *
  478.  * *               Fido Packet Structures
  479.  * *
  480.  * */
  481.  
  482.  
  483. /*
  484.  *
  485.  *  Normal Message Header  (*.MSG)
  486.  *
  487.  */
  488.  
  489. typedef struct f2normsghdr {
  490.   char         fromwho[36];                           //  From username
  491.   char         towho[36];                             //  To username
  492.   char         subj[72];                              //  Subject
  493.   char         date[20];                              //  date string
  494.   word         times;                                 //  times read
  495.   word         destnode;                              //  destination node
  496.   word         orignode;                              //  origin node
  497.   word         cost;                                  //  cost
  498.   word         orignet;                               //  origin net
  499.   word         destnet;                               //  destination net
  500.   word         destzone;                              //  destination zone
  501.   word         origzone;                              //  origin zone
  502.   word         destpoint;                             //  destination point
  503.   word         origpoint;                             //  origin point
  504.   word         reply;                                 //  this is a reply to?
  505.   word         attr;                                  //  Attribute
  506.   word         nextreply;                             //  reply to this msg...
  507. } f2normsghdr;
  508.  
  509.  
  510.  
  511. /*
  512.  *
  513.  * Message attributes
  514.  *
  515.  */
  516.  
  517. #define FMSGPRIVATE 0x0001   // private message,          0000 0000 0000 0001
  518. #define FMSGCRASH   0x0002   // accept for forwarding     0000 0000 0000 0010
  519. #define FMSGREAD    0x0004   // read by addressee         0000 0000 0000 0100
  520. #define FMSGSENT    0x0008   // sent OK (remote)          0000 0000 0000 1000
  521. #define FMSGFILE    0x0010   // file attached to msg      0000 0000 0001 0000
  522. #define FMSGFWD     0x0020   // being forwarded           0000 0000 0010 0000
  523. #define FMSGORPHAN  0x0040   // unknown dest node         0000 0000 0100 0000
  524. #define FMSGKILL    0x0080   // kill after mailing        0000 0000 1000 0000
  525. #define FMSGLOCAL   0x0100   // FidoNet vs. local         0000 0001 0000 0000
  526. #define FMSGHOLD    0x0200   //                           0000 0010 0000 0000
  527. #define FMSGXX1     0x0400   // STRIPPED by FidoNet<tm>   0000 0100 0000 0000
  528. #define FMSGFRQ     0x0800   // file request              0000 1000 0000 0000
  529. #define FMSGRRQ     0x1000   // receipt requested         0001 0000 0000 0000
  530. #define FMSGCPT     0x2000   // is a return receipt       0010 0000 0000 0000
  531. #define FMSGARQ     0x4000   // audit trail requested     0100 0000 0000 0000
  532. #define FMSGURQ     0x8000   // update request            1000 0000 0000 0000
  533.  
  534. #define BUNDLE_VER 2         // IFNA Bundle Version
  535. #define CAP_TYPE2   0x0001   // Can make Type 2 bundles
  536. #define CAP_STONAGE 0x0000   // No particular capabailties, Type 2 assumed
  537.  
  538. /*
  539.  *
  540.  *  Header for Message Bundles (Bundle Type 2+)
  541.  *
  542.  */
  543.  
  544. typedef struct f2pktmsghdr {
  545.    word orignode,              // originating node
  546.         destnode,              // destination node
  547.         year,                  // 1990 - nnnnn
  548.         month,
  549.         day,
  550.         hour,
  551.         minute,
  552.         second,
  553.         rate,                  // unused
  554.         ver,                   // 2
  555.         orignet,               // originating net
  556.         destnet;               // destination net
  557.     byte
  558.         prod_lo,               // product code
  559.         rev_major,             // revision level, major
  560.         password[8];           // packet level password
  561.     word
  562.         qm_origzone,           // QMail wants orig.zone here
  563.         qm_destzone;           // QMail wants dest.zone here
  564.     byte
  565.         trash[2];              // junk[8]
  566.     word
  567.         cap_valid;             // Cap. validity, byte swapped
  568.     byte
  569.         prod_hi,               // product code, hi byte
  570.         rev_minor;             // revision level, minor
  571.     word
  572.         capability,            // bundling capability
  573.         origzone,              // originating zone
  574.         destzone,              // destination zone
  575.         origpoint,             // originating point
  576.         destpoint;             // destination point
  577.     long
  578.         junk;                  // junk
  579. } f2pktmsghdr;
  580.  
  581.     /* --- Note ----------------------------------------------------
  582.  
  583.     (*) In the original FSC-0001 specification, these fields
  584.     were part of the Filler, and so may not be recognized
  585.     by all software.
  586.  
  587.     ------------------------------------------------------------- */
  588.  
  589.  
  590. /*
  591.  *
  592.  *  Packeted Message Header (Bundle Type 2+)
  593.  *
  594.  */
  595.  
  596. typedef struct f2msghdr {
  597.   word         ver;                //  Version (=2)
  598.   word         orignode;           //  Originate Node
  599.   word         destnode;           //  Destination Node
  600.   word         orignet;            //  Originate Net
  601.   word         destnet;            //  Destination Net
  602.   word         attr;               //  Attribute
  603.   word         cost;               //  Cost
  604.   pktdate      date;               //  Date String
  605. /*
  606.   char         towho[36];             To username
  607.   char         fromwho[36];           From username
  608.   char         subject[72];           Subject
  609. */
  610. } f2msghdr;
  611.  
  612.     /* --- Note ----------------------------------------------------
  613.  
  614.     The last three fields are variable length; they are
  615.     shown above for reference, but are not part of the
  616.     structure.
  617.  
  618.     ------------------------------------------------------------- */
  619.  
  620.  
  621. /*
  622.  *
  623.  *  Structs used in IMAIL Configuration files
  624.  *
  625.  */
  626.  
  627. typedef struct naddress {        // std node number ...
  628.   word         zone;             //  Zone Number
  629.   word         net;              //  Net Number
  630.   word         node;             //  Node Number
  631.   word         point;            //  Point Number
  632. } naddress;
  633.  
  634. typedef struct expt {
  635.   naddress     dest;
  636.   boolean      doexpt;
  637. } expt;
  638.  
  639. typedef struct eaddress {                   // used in Area Manager ...
  640.   struct naddress dstn;                     // node number
  641.   bit             exp_only:1;               // export only flag
  642.   bit             imp_only:1;               // import only flag
  643.   bit             paused:1;                 // echo mail paused
  644.   bit             rsvd1:5;                  // reserved
  645. } eaddress;
  646.  
  647. typedef struct fwd_link {                   // used for forward request nodes ...
  648.   char         areasfile[MAXFILE+MAXEXT];   // name of areas file
  649.   char         toprogram[10];               // name of area manager
  650.   char         password[21];                // area manager password
  651.   struct naddress uplink;                   // address of uplink
  652. } fwd_link;
  653.  
  654. typedef struct dom {
  655.   char         domain[21];                  // name of domain
  656.   char         outbound[MAXPATH];           // root outbound path
  657.   word         zones[ZONESDOM];             // Zones in this domain
  658.   byte         akas[MAXAKAS];               // =my= AKAs in this domain
  659. } dom;
  660.  
  661. typedef struct im_stats {                   // Used mainly by IUTIL
  662.   word         th_day;                      // this day
  663.   word         la_day;                      // last day
  664.   word         th_week;                     // this week
  665.   word         la_week;                     // last week
  666.   word         th_month;                    // this month
  667.   word         la_month;                    // last month
  668.   word         th_year;                     // this year
  669.   word         la_year;                     // last year
  670. } im_stats;
  671.  
  672.  
  673. /*
  674.  *
  675.  *  IMAIL.CF Structure
  676.  *
  677.  */
  678.  
  679. typedef struct im_config_type {
  680.   byte         im_ver_maj;                    // Major Version
  681.   byte         im_ver_min;                    // Minor Version
  682.   byte         struct_maj;                    // reserved
  683.   byte         struct_min;                    // reserved
  684.   char         sysop[MAXNAME];                // name of sysop
  685.   struct naddress aka[MAXAKAS];               // the AKAs
  686.   struct dom   domains[MAXAKAS];              // domain names & zones
  687.   byte         prod[10];                      // Type2+ product codes
  688.   char         netmail[MAXPATH];              // net mail subdirectory
  689.   char         netfile[MAXPATH];              // inbound files directory
  690.   char         in_pkt[MAXPATH];               // Directory for inbound PKTs
  691.   char         out_pkt[MAXPATH];              // Directory for outbound PKTs
  692.   char         outbound[MAXPATH];             // outbound directory
  693.   char         quickbbs[MAXPATH];             // QuickBBS system directory
  694.   char         rsvd1[MAXPATH];                // reserved
  695.   char         rsvd2[MAXPATH];                // reserved
  696.   char         rsvd3[MAXPATH];                // reserved
  697.   char         semaphor[MAXPATH];             // Semaphor directory
  698.   char         logfilename[MAXPATH];          // Log file name
  699.   char         before_toss[MAXPATH];          // call before proc. PKTs
  700.   char         semaphor_net[MAXFILE+MAXEXT];  // Netmail rescan semaphor file
  701.   char         alnk_help[MAXFILE+MAXEXT];     // AreaLink help text
  702.   char         maint_help[MAXFILE+MAXEXT];    // Alnk Remote Maint. Helptext
  703.   char         new_areas[MAXFILE+MAXEXT];     // name of file for new areas
  704.   char         dflt_origin[MAXORIGIN];        // default origin line
  705.   bit          rtnrecpt:1;                    // True if to send rtn recpt
  706.   bit          del_empty_msg:1;               // delete empty netmails (TOSS)
  707.   bit          ARCmail06:1;                   // ARCmail 0.6 compatibility
  708.   bit          environment:1;                 // FroDo or Binkley
  709.   bit          auto_add:1;                    // Auto-add unknown areas
  710.   bit          multi_tasking:1;               // TRUE if multi-tasking
  711.   bit          forward_for:1;                 // forward PKTs not for us
  712.   bit          singleextract:1;               // extract 1 bundle at a time
  713.   bit          trunc_sent:1;                  // 1 = Trunc 0 = Delete
  714.   bit          keep_alnk_answ:1;              // keep arealink answer
  715.   bit          prod_names:1;                  // use the FTSC product list
  716.   bit          swap_ems:1;                    // swap to EMS
  717.   bit          swap_ext:1;                    // swap to extended memory
  718.   bit          forward_everything:1;          // forward req. not in fwd-lists
  719.   bit          direct_video:1;                // use direct screen writing
  720.   bit          forward_req:1;                 // Execute forward link req.
  721.   bit          rsvd4:8;                       // reserved
  722.   long         last_run;                      // last run of IUTIL STAT
  723.   byte         rsvd5;                         // reserved
  724.   byte         rsvd6;                         // reserved
  725.   word         rsvd7;                         // reserved
  726.   word         max_arcmail_size;              // max size of arcmail bundles
  727.   word         pwd_expire_days;               // days before pwd expr'd
  728.   word         max_pkt_size;                  // max size of pkt to create
  729.   word         rsvd8;                         // reserved
  730.   byte         kill_dead;                     // kill echos without traffic
  731.   byte         max_msg_size;                  // max size of netmail (split)
  732.   byte         via_line;                      // add Via Line to netmails
  733.   byte         dupe_ring;                     // Check for possible d-rings
  734.   byte         cpd_check;                     // circular path detection
  735.   byte         pers_mail;                     // use personal mail feature
  736.   byte         unlink_req;                    // Unlink areas without dlink
  737.   byte         keep_alnk_req;                 // keep arealink request
  738.   byte         log_level;                     // logging level
  739.   char         no_import[MAXNOIMPT][38];      // ignore when importing
  740.   struct fwd_link fwd[MAXFWDLINK];            // forward link requests
  741.   long         max_dupes;                     // max dupes kept in database
  742.   long         false_dupes;                   // false dupes found
  743.   char         filler[242];                   // reserved
  744. } im_config_type;
  745.  
  746.     /* --- Note ----------------------------------------------------
  747.  
  748.     The information about the badmail-area, the dupe-area
  749.     and the personalmail-area has been moved to IMAIL.AR,
  750.     see there for detailed information.
  751.  
  752.     ------------------------------------------------------------- */
  753.  
  754. /*
  755.  *
  756.  *  IMAIL.AR Structure
  757.  *
  758.  */
  759.  
  760. typedef struct areas_record_type {
  761.   char         aname[MAXTAG];              // area name
  762.   char         comment[61];                // area comment
  763.   char         origin[MAXORIGIN];          // origin line to use
  764.   char         group;                      // area group
  765.   char         o_addr;                     // address for origin
  766.   char         use_akas[MAXAKAS];          // addresses for seen-bys
  767.   byte         msg_base_type;              // message base type
  768.   byte         brd;                        // board number
  769.   char         msg_path[MAXPATH];          // MSG/Squish path
  770.   bit          active:1;                   // flag area active
  771.   bit          zone_gate:1;                // Zone-gate stripping
  772.   bit          tiny_seen:1;                // tiny seen-by flag
  773.   bit          secure:1;                   // secure flag
  774.   bit          keep_seen:1;                // keep seen-by flag
  775.   bit          deleted:1;                  // flag deleted area
  776.   bit          auto_added:1;               // flag auto-added record
  777.   bit          mandatory:1;                // area is mandatory
  778.   bit          read_only:1;                // area is read only
  779.   bit          unlinked:1;                 // area has been unlinked
  780.   bit          ulnk_req:1;                 // perform unlinked requests?
  781.   bit          hidden:1;                   // area is hidden
  782.   bit          to_link:1;                  // should by processed by LINK
  783.   bit          rsvd:3;                     // reserved
  784.   byte         iutil_bits;                 // bits for IUTIL
  785.   byte         user_bits;                  // 8 user-available bits
  786.   byte         days;                       // days to keep messages
  787.   word         msgs;                       // num messages to keep
  788.   struct im_stats t_stats;                 // TOSS stats
  789.   struct im_stats s_stats;                 // SCAN stats
  790.   struct im_stats d_stats;                 // dupe statistics
  791.   time_t       creation;                   // date/time of creation
  792.   time_t       update;                     // last update by STAT
  793.   time_t       marked;                     // used by IUTIL
  794.   char         filler[10];
  795.   struct eaddress export[MAXEXPORT];       // export list
  796. } areas_record_type;
  797.  
  798.     /* --- Notes --------------------------------------------------
  799.  
  800.     1) The entries in 'o_addr' and 'use_akas' are indexes into
  801.        the list of AKAs in IMAIL.CF, minus 1. eg:
  802.           im_config.aka[o_addr-1]
  803.        A value of 0 means 'no address'
  804.     2) the 'user_bits' entry allows third-part software to store
  805.        extra information in IMAIL.AR. Their meaning is program-
  806.        specific, so be careful when making use of them!
  807.  
  808.     3) IMAIL.AR knows three predefined areatags:
  809.  
  810.         BADMAIL       for the IMAIL badmail area,
  811.         DUPES         for the IMAIL dupe area and
  812.         PERSMAIL      for the IMAIL personal mail area.
  813.  
  814.        All three boards are treated as local areas and
  815.        the BADMAIL area must be present and non-passthru
  816.        otherwise IMAIL will not run.
  817.  
  818.     ------------------------------------------------------------- */
  819.  
  820.  
  821. /*
  822.  *
  823.  *  IMAIL.AX & IMAIL.BX Structures
  824.  *
  825.  */
  826.  
  827.     /* --- Notes ---------------------------------------------------
  828.  
  829.     1) These are "true" index files, created by BTree routines;
  830.        they cannot be used unless you have the BTree source
  831.        code as implemented in IMAIL.
  832.  
  833.     ------------------------------------------------------------- */
  834.  
  835. /*
  836.  *
  837.  *  IMAIL.ND Structure
  838.  *
  839.  */
  840.  
  841. typedef struct node_record_type {
  842.   struct naddress dstn;               // Node to pack for
  843.   char         sysop[MAXNAME];        // name of sysop
  844.   char         domain;                // index to domain
  845.   char         pwd[21];               // AreaLink password
  846.   char         att_status;            // Status of file attach msg
  847.   char         program;               // packer to use ("packers")
  848.   char         groups[MAXGROUPS+1];   // groups node can request
  849.   word         capability;            // capability word for node
  850.   bit          allow_remote:1;        // allow remote maint.
  851.   bit          rsvd1:1;               // reserved
  852.   bit          auto_cap:1;            // TRUE = auto-detect capability
  853.   bit          auto_added:1;          // record added by IMAIL
  854.   bit          newarea_add:1;         // auto add to new areas?
  855.   bit          newarea_create:1;      // create new areas?
  856.   bit          rescan_ok:1;           // allow node to rescan
  857.   bit          notify:1;              // Send notify messages?
  858.   bit          rsvd1:2;               // Define security handling
  859.   bit          forward_req:1;         // Forward ALNK requests?
  860.   bit          uplink:1;              // Is this system an uplink?
  861.   bit          fsc_comp:1;            // Is a FSC-0057 arealink used?
  862.   bit          change_packer:1;       // system may change packer
  863.   bit          rsvd2:2;               // reserved bits
  864.   word         user_bits;             // 16 user-available bits
  865.   char         newarea_group;         // new areas default group
  866.   char         pkt_pwd[9];            // PKT password
  867.   long         last_pwd_change;       // time ALNK pwd last changed
  868.   char         toprogram[11];         // name of area manager
  869.   char         msg_status;            // Status of Alnk messages
  870.   char         filler[8];
  871.   struct node_record_type *next_node;
  872.   struct node_record_type *prev_node;
  873. } node_record_type;
  874.  
  875.  
  876.     /* --- Notes ---------------------------------------------------
  877.  
  878.     1) The last 2 fields are not saved to IMAIL.ND
  879.  
  880.     2) the 'user_bits' entry allows third-part software to store
  881.        extra information in IMAIL.ND. Their meaning is program-
  882.        specific, so be careful when making use of them!
  883.  
  884.     ------------------------------------------------------------- */
  885.  
  886.  
  887. /*
  888.  *
  889.  *  IMAIL.GR Structure
  890.  *
  891.  */
  892.  
  893. typedef struct group_record_type {
  894.   char         grp_desc[27];             // Group description
  895.   byte         msg_base_type;            // message base type
  896.   char         msg_path[MAXPATH];        // MSG/Squish path
  897.   bit          active:1;                 // flag area active
  898.   bit          zone_gate:1;              // Zone-gate stripping
  899.   bit          tiny_seen:1;              // tiny seen-by flag
  900.   bit          secure:1;                 // secure flag
  901.   bit          keep_seen:1;              // keep seen-by flag
  902.   bit          mandatory:1;              // area is mandatory
  903.   bit          read_only:1;              // area is read only
  904.   bit          ulnk_req:1;               // perform unlinked requests?
  905.   bit          hidden:1;                 // area is hidden
  906.   bit          rsvd:7;                   // reserved
  907.   byte         days;                     // days to keep messages
  908.   word         msgs;                     // num messages to keep
  909.   char         filler[20];               // reserved
  910. } group_record_type;
  911.  
  912.  
  913. /*
  914.  *
  915.  *  IMAIL.PR Structure
  916.  *
  917.  */
  918.  
  919. typedef struct pack_routing_type {          // used in pack routing
  920.   struct naddress dst;                      // pack via this node
  921.   struct naddress nodes[MAXVIA];            // nodes to pack
  922.   struct naddress except[MAXEXCEPT];        // exceptions
  923. } pack_routing_type;
  924.  
  925.   // Note: In the current implementation, the pack routing has
  926.   //       as much records as defined in MAXPACK.
  927.  
  928. /*
  929.  *
  930.  *  IMAIL.PP Structure
  931.  *
  932.  */
  933.  
  934. typedef struct packers {
  935.   char         packname[5];
  936.   char         packer[MAXPACKNAME];
  937. } packers;
  938.  
  939. typedef struct compression_type {
  940.   packers      prg[MAXPACKERS];               // Packer defintions
  941.   char         arcunpak[MAXPACKNAME];         // cmd to de-arc .ARC files
  942.   char         arjunpak[MAXPACKNAME];         // cmd to de-arc .ARJ files
  943.   char         pkpakunpak[MAXPACKNAME];       // cmd to de-arc .PKA files
  944.   char         pkzipunpak[MAXPACKNAME];       // cmd to de-arc .ZIP files
  945.   char         lharcunpak[MAXPACKNAME];       // cmd to de-arc .LZH files
  946.   char         zoounpak[MAXPACKNAME];         // cmd to de-arc .ZOO files
  947.   char         pakunpak[MAXPACKNAME];         // cmd to de-arc .PAK files
  948.   char         sqzunpak[MAXPACKNAME];         // cmd to de-arc .SQZ files
  949.   char         unkunpak[MAXPACKNAME];         // cmd to de-arc unknown files
  950. } compression_type;
  951.  
  952.  
  953. /*
  954.  *
  955.  *  IMAIL.DP/IMAIL.DP1/IMAIL.DP2 Structure
  956.  *
  957.  */
  958.  
  959.     /* --- Notes ---------------------------------------------------------
  960.  
  961.     1) The dupe database consists simply of a series of word-sized values,
  962.        which are a 32-bit CRC of (in order) the following data:
  963.           Addressee's name
  964.           Sender's name
  965.           Date
  966.           Subject
  967.           Address and MSGID (if any)
  968.  
  969.     -------------------------------------------------------------------- */
  970.  
  971.