home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magic 1995 #1 / CDM_5.ISO / shell / utils / imail / imdev160.arj / IM_STRUC.H next >
Encoding:
C/C++ Source or Header  |  1994-12-15  |  30.8 KB  |  791 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.  *
  10.  * Copyright (C) 1992-1994 by Andreas Klein. All rights reserved.
  11.  *
  12.  * The information in this file may not be passed on to others
  13.  * without prior permission from the author.
  14.  *
  15.  * The contents of this file are subject to change without notice!
  16.  * Fields marked reserved should NOT be used.
  17.  *
  18.  * It is an ERROR to write to any of the configuration files
  19.  * while IMAIL (or any of its companion programs) is running.
  20.  * 
  21.  */
  22.  
  23. #include <direct.h>
  24. #include <io.h>
  25. #include <time.h>
  26.  
  27. #define IMAIL_MAJ_VERSION     1
  28. #define IMAIL_MIN_VERSION     60
  29. #define IMAIL_MAJ_VERSION_STR "1"
  30. #define IMAIL_MIN_VERSION_STR "60"
  31. #define STRUCT_MAJ_VERSION    4
  32. #define STRUCT_MIN_VERSION    01
  33. #define IM_PRD_CODE           0x4B
  34.  
  35. /*
  36.  *
  37.  *  Data type definitions
  38.  *
  39.  */
  40.  
  41. typedef unsigned char        byte;
  42. typedef unsigned short       word;
  43. typedef unsigned char        boolean;
  44. typedef short                integer;
  45. typedef unsigned char        bit;
  46.  
  47. /*
  48.  *
  49.  *  Internal limits
  50.  *
  51.  */
  52.  
  53. #define MAXAKAS              16       /* Max # of addresses */
  54. #define MAXPACKERS           11       /* Max # of packer def */
  55. #define MAXEXPORT           200       /* Max export defs */
  56. #define MAXVIA               40       /* max nodes packed via */
  57. #define MAXGROUPS            26       /* max nodes packed via */
  58. #define MAXEXCEPT            10       /* max EXCEPT nodes */
  59. #define MAXPACK              32       /* max default pack cmd */
  60. #define MAXFWDLINK           15       /* max fwd link structs */
  61. #define MAXNOIMPT            20       /* max # names for IMPORT */
  62. #define MAXSYSNAME           20       /* max # names for PERSMAIL */
  63. #define ZONESDOM             10       /* zones per domain entry */
  64. #define MAXTAG               51       /* max areatag length */
  65. #define MAXNAME              37       /* max namefield lenght */
  66. #define MAXPACKNAME          50       /* max packer length */
  67. #define MAXORIGIN            64       /* max origin length */
  68.  
  69. /*
  70.  *
  71.  *  Log Style Definitions
  72.  *
  73.  */
  74.  
  75. #define LOG_FATAL            0x0001                   /* Fatal errors */
  76. #define LOG_OTHER            0x0002                   /* Other errors */
  77. #define LOG_ACCOUNT          0x0004                   /* Accounting info */
  78. #define LOG_FILES            0x0008                   /* Sent/Rcvd files */
  79. #define LOG_BRIEF            0x0010                   /* Brief messages */
  80. #define LOG_TRIVIAL          0x0020                   /* Trivial messages */
  81. #define LOG_TRANSACT         0x0040                   /* Transaction info */
  82. #define LOG_PASSWORD         0x0080                   /* Unexpected passwords */
  83. #define LOG_SECDUPE          0x0100                   /* Security/Dupe info */
  84. #define LOG_SPAWN            0x0200                   /* Spawning info */
  85. #define LOG_DEBUG            0x8000                   /* DEBUG: All of the above */
  86.  
  87. /*
  88.  *
  89.  *  Mailer Environment Type
  90.  *  (FrontDoor, Binkley, InterMail or Portal of Power)
  91.  *
  92.  */
  93.  
  94. enum {ENV_FRODO, ENV_BINK, ENV_IM, ENV_DB, ENV_POP};
  95.  
  96. /*
  97.  *
  98.  *  BBS Environment Type (for the USERS.BBS format)
  99.  *
  100.  */
  101.  
  102. enum {BBS_RA2,                        /* RA 2.0x/PB 2.0x */
  103.       BBS_OTHER};                     /* Other */
  104.  
  105. /*
  106.  *
  107.  *  File Attach Message Status (used in IMAIL.ND)
  108.  *
  109.  */
  110.  
  111. enum {S_NORMAL, S_HOLD, S_CRASH, S_IMMEDIATE, S_DIRECT,
  112.       S_HOLD_DIR, S_CRASH_DIR, S_IMMEDIATE_DIR};
  113.  
  114. /*
  115.  *
  116.  *  Message Base Types
  117.  *
  118.  */
  119.  
  120. #ifndef MSGTYPE_SDM
  121.   #define MSGTYPE_SDM     0x01
  122. #endif
  123. #ifndef MSGTYPE_SQUISH
  124.   #define MSGTYPE_SQUISH  0x02
  125. #endif
  126. #ifndef MSGTYPE_HUDSON
  127.   #define MSGTYPE_HUDSON  0x03
  128. #endif
  129. #ifndef MSGTYPE_JAM
  130.   #define MSGTYPE_JAM     0x04
  131. #endif
  132. #ifndef MSGTYPE_PASSTH
  133.   #define MSGTYPE_PASSTH  0x0F
  134. #endif
  135. #ifndef MSGTYPE_ECHO
  136.   #define MSGTYPE_ECHO    0x80
  137. #endif
  138. #ifndef MSGTYPE_LOCAL
  139.   #define MSGTYPE_LOCAL   0x90
  140. #endif
  141. #ifndef MSGTYPE_NET
  142.   #define MSGTYPE_NET     0xA0
  143. #endif
  144.  
  145. /*
  146.  *
  147.  *  Via Line Switches
  148.  *
  149.  */
  150.  
  151. enum {VIA_NONE=1, VIA_EXP, VIA_IMP, VIA_BOTH};
  152.  
  153. /*
  154.  *
  155.  *  Dupe ring check switches
  156.  *
  157.  */
  158.  
  159. enum {DUPE_NONE, DUPE_COPY, DUPE_KILL, DUPE_KILLCOPY};
  160.  
  161. /*
  162.  *
  163.  *  Circular path detection switches
  164.  *
  165.  */
  166.  
  167. enum {CPD_NONE, CPD_COPY, CPD_KILL, CPD_KILLCOPY};
  168.  
  169. /*
  170.  *
  171.  *  Unlink handling
  172.  *
  173.  */
  174.  
  175. enum {ULNK_NONE, ULNK_PASSTH, ULNK_ALL};
  176.  
  177. /*
  178.  *
  179.  *  Personal Mail handling
  180.  *
  181.  */
  182.  
  183. enum {PERSM_NONE, PERSM_LOG, PERSM_MSG, PERSM_COPY};
  184.  
  185. /*
  186.  *
  187.  *  AreaLink Request Handling
  188.  *
  189.  */
  190.  
  191. enum {KEEP_NONE, KEEP_MSG, KEEP_ALL};
  192.  
  193. /*
  194.  *
  195.  *  PKTs not for us Handling
  196.  *
  197.  */
  198.  
  199. enum {PKT_TOSS, PKT_FORWARD, PKT_RENAME};
  200.  
  201. /*
  202.  *
  203.  *  Kill Dead selection
  204.  *
  205.  */
  206.  
  207. enum {KILL_NONE, KILL_FWD, KILL_ALL};
  208.  
  209. /*
  210.  *
  211.  *  Macros to make life easier
  212.  *
  213.  */
  214.  
  215. #define BASEMASK          0x0F
  216. #define TYPEMASK          0xF0
  217.  
  218. #define IsSdm(Type)       ((Type & BASEMASK) == MSGTYPE_SDM)
  219. #define IsMsg(Type)       ((Type & BASEMASK) == MSGTYPE_SDM)
  220. #define IsSquish(Type)    ((Type & BASEMASK) == MSGTYPE_SQUISH)
  221. #define IsHudson(Type)    ((Type & BASEMASK) == MSGTYPE_HUDSON)
  222. #define IsJam(Type)       ((Type & BASEMASK) == MSGTYPE_JAM)
  223. #define IsPassth(Type)    ((Type & BASEMASK) == MSGTYPE_PASSTH)
  224. #define IsEcho(Type)      ((Type & TYPEMASK) == MSGTYPE_ECHO)
  225. #define IsLocal(Type)     ((Type & TYPEMASK) == MSGTYPE_LOCAL)
  226. #define IsNet(Type)       ((Type & TYPEMASK) == MSGTYPE_NET)
  227.  
  228.  
  229. /*
  230.  *
  231.  *  Exit Errorlevels & Error Messages
  232.  *
  233.  */
  234.  
  235. #define E_NOERR              0            /* no error */
  236. #define E_NOPKTS             236          /* */
  237. #define E_GOPEN              237          /* Error opening IMAIL.GI */
  238. #define E_CRDIR              238          /* Error creating directory */
  239. #define E_ELOCK              239          /* File locking error */
  240. #define E_AOPEN              240          /* Error opening IMAIL.AI */
  241. #define E_BOPEN              241          /* Error opening IMAIL.BI */
  242. #define E_NOIDX              242          /* Index file missing/corrupt */
  243. #define E_NOCFG              243          /* IMAIL.CF not found */
  244. #define E_NOARE              244          /* IMAIL.AR not found */
  245. #define E_NONOD              245          /* IMAIL.ND not found */
  246. #define E_BADCF              246          /* Error in IMAIL.CF */
  247. #define E_BADVR              247          /* Bad version of IMAIL.CF */
  248. #define E_EOPEN              248          /* Error opening file */
  249. #define E_EREAD              249          /* Error reading file */
  250. #define E_EWRIT              250          /* Error writing file */
  251. #define E_CMDPR              251          /* Command Line Parameter error */
  252. #define E_FILNF              252          /* File not found */
  253. #define E_MEMRY              253          /* Memory Allocation error */
  254. #define E_DISKF              254          /* Insufficient disk space */
  255. #define E_UNKWN              255          /* Unknown error */
  256.  
  257. /*
  258.  *
  259.  * Internal status flags for TOSS and SCAN
  260.  *
  261.  */
  262.  
  263. #define T_NOMAIL             0x00000000L    /* no mail processed */
  264. #define T_NET                0x00010000L    /* Net mail */
  265. #define T_ECHO               0x00020000L    /* Echo mail */
  266. #define T_BAD                0x00040000L    /* Bad and/or dupe mail */
  267. #define T_HUDSON             0x00080000L    /* Hudson message base changed */
  268. #define T_MSG                0x00100000L    /* *.MSG message base changed */
  269. #define T_SQUISH             0x00200000L    /* Squish message base changed */
  270. #define T_JAM                0x00400000L    /* JAM message base changed */
  271. #define T_PERS               0x00800000L    /* Mail to Sysop received */
  272. #define T_NEWAREA            0x01000000L    /* New echos have been created */
  273. #define T_MSGNR              0x02000000L    /* Abort due to too many msgs */
  274.  
  275. /*
  276.  *
  277.  *  Special values for 'ALL'
  278.  *
  279.  */
  280.  
  281. #define ZONE_ALL             56685u
  282. #define NET_ALL              56685u
  283. #define NODE_ALL             56685u
  284. #define POINT_ALL            56685u
  285.  
  286. /*
  287.  *
  288.  *  Misc other definitions required
  289.  *
  290.  */
  291.  
  292. #define FA_ANYFILE FA_RDONLY+FA_HIDDEN+FA_SYSTEM+FA_ARCH
  293. #define _A_ANYFILE _A_RDONLY+_A_HIDDEN+_A_SYSTEM+_A_ARCH
  294.  
  295. #define TRUE                1
  296. #define FALSE                0
  297. #define BLANK              ' '
  298.  
  299. typedef char str255[256];
  300. typedef char str35[36];
  301. typedef char str16[16];
  302.  
  303. typedef char pktdate[20];
  304.  
  305. struct array512
  306. {
  307.   word         len;
  308.   char         longstring[512];
  309. };
  310.  
  311. /* define some simple keyword replacements */
  312.  
  313. #define strdelete(s,p,num) strcpy(s+p-1,s+p+num)
  314.  
  315. #define stoz(s, z) memmove(z, ((char *)(s))+1, (size_t)((byte)*(s)))
  316.  
  317. #define stozn(s, z, n) memmove(z, ((char *)(s))+1, (size_t)(((byte)*(s)<=n) ? (byte)*(s) : n))
  318.  
  319. #define ztos(z, s) memmove((char *)(s)+1, z, strlen(z)); *(s)=(char)strlen(z)
  320.  
  321. #define STRSIZ               255                  /* default string length */
  322.  
  323. #define NORM_FP(p) MK_FP(FP_SEG(p)+(FP_OFF(p)/0x10), FP_OFF(p)%0x10)
  324.  
  325. /*
  326.  *
  327.  *  In case your compiler doesn't have these ...
  328.  *
  329.  */
  330.  
  331. #ifndef MAXPATH
  332.   #define MAXPATH            80
  333. #endif
  334. #ifndef MAXDRIVE
  335.   #define MAXDRIVE           3
  336. #endif
  337. #ifndef MAXDIR
  338.   #define MAXDIR             66
  339. #endif
  340. #ifndef MAXFILE
  341.   #define MAXFILE            9
  342. #endif
  343. #ifndef MAXEXT
  344.   #define MAXEXT             5
  345. #endif
  346.  
  347. /*
  348.  *
  349.  *  Structs used in IMAIL Configuration files
  350.  *
  351.  */
  352.  
  353. struct naddress {        /* std node number ... */
  354.   word         zone;             /*  Zone Number */
  355.   word         net;              /*  Net Number */
  356.   word         node;             /*  Node Number */
  357.   word         point;            /*  Point Number */
  358. };
  359.  
  360. struct expt {
  361.   struct naddress dest;
  362.   boolean         doexpt;
  363. };
  364.  
  365. struct eaddress {                   /* used in Area Manager ... */
  366.   struct naddress dstn;                     /* node number */
  367.   bit             exp_only:1;               /* export only flag */
  368.   bit             imp_only:1;               /* import only flag */
  369.   bit             paused:1;                 /* echo mail paused */
  370.   bit             rsvd1:5;                  /* reserved */
  371. };
  372.  
  373. struct fwd_link {                   /* used for forward request nodes ... */
  374.   char         areasfile[MAXFILE+MAXEXT];   /* name of areas file */
  375.   char         toprogram[10];               /* name of area manager */
  376.   char         password[21];                /* area manager password */
  377.   struct naddress uplink;                   /* address of uplink */
  378.   char         accessgrp;                   /* accessgroup for forwarding */
  379.   char         creategrp;                   /* creategroup for forwarding */
  380.   char         filler[10];                  /* reserved */
  381. };
  382.  
  383. struct dom {
  384.   char         domain[21];                  /* name of domain */
  385.   char         outbound[MAXPATH];           /* root outbound path */
  386.   word         zones[ZONESDOM];             /* Zones in this domain */
  387.   byte         akas[MAXAKAS];               /* =my= AKAs in this domain */
  388. };
  389.  
  390. struct im_stats {
  391.   long         th_day_nr;                   /* nr this day */
  392.   long         la_day_nr;                   /* nr last day */
  393.   long         th_week_nr;                  /* nr this week */
  394.   long         la_week_nr;                  /* nr last week */
  395.   long         th_month_nr;                 /* nr this month */
  396.   long         la_month_nr;                 /* nr last month */
  397.   long         th_year_nr;                  /* nr this year */
  398.   long         la_year_nr;                  /* nr last year */
  399.   long         th_day_size;                 /* amount this day */
  400.   long         la_day_size;                 /* amount last day */
  401.   long         th_week_size;                /* amount this week */
  402.   long         la_week_size;                /* amount last week */
  403.   long         th_month_size;               /* amount this month */
  404.   long         la_month_size;               /* amount last month */
  405.   long         th_year_size;                /* amount this year */
  406.   long         la_year_size;                /* amount last year */
  407. };
  408.  
  409.  
  410. /*
  411.  *
  412.  *  IMAIL.CF structure
  413.  *
  414.  */
  415.  
  416. struct im_config_type {
  417.   byte         im_ver_maj;                    /* Major Version */
  418.   byte         im_ver_min;                    /* Minor Version */
  419.   byte         struct_maj;                    /* reserved */
  420.   byte         struct_min;                    /* reserved */
  421.   char         sysop[MAXNAME];                /* name of sysop */
  422.   struct naddress aka[MAXAKAS];               /* the AKAs */
  423.   struct dom   domains[MAXAKAS];              /* domain names & zones */
  424.   byte         rsvd1[10];                     /* reserved */
  425.   char         netmail[MAXPATH];              /* net mail subdirectory */
  426.   char         netfile[MAXPATH];              /* inbound files directory */
  427.   char         in_pkt[MAXPATH];               /* Directory for inbound PKTs */
  428.   char         out_pkt[MAXPATH];              /* Directory for outbound PKTs */
  429.   char         outbound[MAXPATH];             /* outbound directory */
  430.   char         quickbbs[MAXPATH];             /* QuickBBS system directory */
  431.   char         uns_netfile[MAXPATH];          /* unsecured inbound files */
  432.   char         echotoss[MAXPATH];             /* name of echotoss.log */
  433.   char         dupebase[MAXPATH];             /* dupe data base directory */
  434.   char         semaphor[MAXPATH];             /* Semaphor directory */
  435.   char         logfilename[MAXPATH];          /* Log file name */
  436.   char         before_toss[MAXPATH];          /* call before proc. a PKT */
  437.   char         semaphor_net[MAXFILE+MAXEXT];  /* Netmail rescan semaphor file */
  438.   char         alnk_help[MAXFILE+MAXEXT];     /* AreaLink help text */
  439.   char         maint_help[MAXFILE+MAXEXT];    /* Alnk Remote Maint. Helptext */
  440.   char         rsvd2[MAXFILE+MAXEXT];         /* reserved */
  441.   char         dflt_origin[MAXORIGIN];        /* default origin line */
  442.   bit          rtnrecpt:1;                    /* True if to send rtn recpt */
  443.   bit          del_empty_msg:1;               /* delete empty netmails (TOSS) */
  444.   bit          ARCmail06:1;                   /* ARCmail 0.6 compatibility */
  445.   bit          use_crc_names:1;               /* use crc-names for auto-areas */
  446.   bit          rsvd3:1;                       /* reserved */
  447.   bit          multi_tasking:1;               /* TRUE if multi-tasking */
  448.   bit          ignore_unknown:1;              /* ALNK ignores unknown systems */
  449.   bit          singleextract:1;               /* extract 1 bundle at a time */
  450.   bit          trunc_sent:1;                  /* 1 = Trunc 0 = Delete */
  451.   bit          keep_alnk_answ:1;              /* keep arealink answer */
  452.   bit          prod_names:1;                  /* use the FTSC product list */
  453.   bit          swap_ems:1;                    /* swap to EMS */
  454.   bit          swap_ext:1;                    /* swap to extended memory */
  455.   bit          forward_everything:1;          /* forward req. not in fwd-lists */
  456.   bit          direct_video:1;                /* use direct screen writing */
  457.   bit          rsvd4:1;                       /* reserved */
  458.   bit          compr_after_pkt:1;             /* compress after each PKT? */
  459.   bit          delete_bases:1;                /* when removing an area, */
  460.                                               /* delete also squish/msg-base */
  461.   bit          rsvd5:1;                       /* reserved */
  462.   bit          use_imcomp:1;                  /* call IMCOMP in case of tight */
  463.                                               /* diskspace or abort at once */
  464.   bit          rsvd6:4;                       /* reserved */
  465.   long         last_run;                      /* last maintenance run */
  466.   word         rsvd7;                         /* reserved */
  467.   byte         rsvd8;                         /* reserved */
  468.   byte         rsvd9;                         /* reserved */
  469.   word         max_arcmail_size;              /* max size of arcmail bundles */
  470.   word         pwd_expire_days;               /* days before pwd expr'd */
  471.   word         max_pkt_size;                  /* max size of pkt to create */
  472.   byte         max_add_pkt;                   /* PKTs to compress in one run */
  473.   byte         pkt_not_for_us;                /* how to handle PKTs not for us */
  474.   byte         environment;                   /* FroDo, Binkley or Intermail */
  475.   byte         max_msg_size;                  /* max size of netmail (split) */
  476.   byte         via_line;                      /* add Via Line to netmails */
  477.   byte         dupe_ring;                     /* Check for possible d-rings */
  478.   byte         cpd_check;                     /* circular path detection */
  479.   byte         pers_mail;                     /* use personal mail feature */
  480.   byte         unlink_req;                    /* Unlink areas without dlink */
  481.   byte         keep_alnk_req;                 /* keep arealink request */
  482.   byte         rsvd10;                        /* reserved */
  483.   long         max_dupes;                     /* max dupes kept in dbase */
  484.   word         max_files_per_dir;             /* max. nr files when autocreate */
  485.   byte         deadlink_days;                 /* nr of days for a dealink req */
  486.   byte         rsvd11;                        /* reserved */
  487.   char         bbs_system;                    /* BBS software used */
  488.   char         new_areas[MAXPATH];            /* name of file for new areas */
  489.   word         sp_before_unpack;              /* min. diskspace required */
  490.   word         sp_before_toss;                /* before decompress, toss */
  491.   word         sp_before_compress;            /* and compress (in MB). */
  492.   char         kill_dead;                     /* Kill Dead Selection */
  493.   word         prod[20];                      /* Type2+ product codes */
  494.   char         rsvd12[720];                   /* reserved */
  495.   struct fwd_link fwd[MAXFWDLINK];            /* forward link requests */
  496.   char         echojam[MAXPATH];              /* path to ECHOMAIL.JAM */
  497.   char         before_toss_ii[MAXPATH];       /* call before proc. the PKTs */
  498.   char         userbase[MAXPATH];             /* path to the userbase */
  499.   long         stoptossmsgs;                  /* stop tossing after xxxxx msgs */
  500.   long         stoptossnetmsgs;               /* stop tossing after xxxxx net */
  501.                                               /* msgs within a PKT or at all */
  502.   char         ignorelist[MAXPATH];           /* list of areas to suppress */
  503.   char         db_queue[MAXPATH];             /* D'Bridge queue directory */
  504.   long         log_level;                     /* logging level */
  505.   char         att_status;                    /* Def. status of attach msg */
  506.   char         msg_status;                    /* Def. status of Alnk msgs */
  507.   char         filler[278];                   /* reserved */
  508. };
  509.  
  510.  
  511. /*
  512.  *
  513.  *  IMAIL.AR structure
  514.  *
  515.  */
  516.  
  517. struct areas_record_type {
  518.   char         aname[MAXTAG];              /* area name */
  519.   char         comment[61];                /* area comment */
  520.   char         origin[MAXORIGIN];          /* origin line to use */
  521.   char         group;                      /* area group */
  522.   char         o_addr;                     /* address for origin */
  523.   char         use_akas[MAXAKAS];          /* addresses for seen-bys */
  524.   byte         msg_base_type;              /* message base type */
  525.   byte         brd;                        /* board number */
  526.   char         msg_path[MAXPATH];          /* MSG/Squish path */
  527.   bit          active:1;                   /* flag area active */
  528.   bit          zone_gate:1;                /* Zone-gate stripping */
  529.   bit          tiny_seen:1;                /* tiny seen-by flag */
  530.   bit          secure:1;                   /* secure flag */
  531.   bit          import_seen:1;              /* import seen-by into base */
  532.   bit          deleted:1;                  /* flag deleted area */
  533.   bit          auto_added:1;               /* flag auto-added record */
  534.   bit          mandatory:1;                /* area is mandatory */
  535.   bit          read_only:1;                /* area is read only */
  536.   bit          unlinked:1;                 /* area has been unlinked */
  537.   bit          ulnk_req:1;                 /* perform unlinked requests? */
  538.   bit          hidden:1;                   /* area is hidden */
  539.   bit          to_link:1;                  /* should by processed by LINK */
  540.   bit          check_dup:1;                /* check for dupes in this area? */
  541.   bit          no_pause:1;                 /* %PAUSE not allowed in this echo? */
  542.   bit          hide_seen:1;                /* Hide seens when importing */
  543.   bit          manual:1;                   /* No changes via Arealink */
  544.   bit          fwdreq_pending:1;           /* Requested but yet not arrived */
  545.   bit          sqkillfly:1;                /* Squish 'Kill on the fly' */
  546.   bit          dupe_msgid:1;               /* Dupecheck on MSGID only? */
  547.   bit          deadlink_req:1;             /* Deadlink request has been sent */
  548.   bit          rsvd:2;                     /* reserved */
  549.   byte         user_bits;                  /* 8 user-available bits */
  550.   byte         days;                       /* days to keep messages */
  551.   word         msgs;                       /* num messages to keep */
  552.   struct im_stats stats;                   /* statistics */
  553.   time_t       creation;                   /* date/time of statistic start */
  554.   time_t       update;                     /* last update by midnight update */
  555.   time_t       marked;                     /* used by kill dead */
  556.   byte         kill_dead;                  /* kill echos without traffic */
  557.   word         read_sec;                   /* Security level for read access */
  558.   word         write_sec;                  /* Security level for write access */
  559.   char         filler[30];
  560.   struct eaddress export[MAXEXPORT];       /* export list */
  561. };
  562.  
  563.     /* --- Notes --------------------------------------------------
  564.  
  565.     1) The entries in 'o_addr' and 'use_akas' are indexes into
  566.        the list of AKAs in IMAIL.CF, minus 1. eg:
  567.           im_config.aka[o_addr-1]
  568.        A value of 0 means 'no address'
  569.     2) the 'user_bits' entry allows third-part software to store
  570.        extra information in IMAIL.AR. Their meaning is program-
  571.        specific, so be careful when making use of them!
  572.  
  573.     3) IMAIL.AR knows three predefined areatags:
  574.  
  575.         BADMAIL       for the IMAIL badmail area,
  576.         DUPES         for the IMAIL dupe area and
  577.         PERSMAIL      for the IMAIL personal mail area.
  578.  
  579.        All three boards are treated as local areas and
  580.        the BADMAIL area must be present and non-passthru
  581.        otherwise IMAIL will not run.
  582.  
  583.     ------------------------------------------------------------- */
  584.  
  585.  
  586. /*
  587.  *
  588.  *  IMAIL.AI & IMAIL.BI structures
  589.  *
  590.  */
  591.  
  592.     /* --- Notes ---------------------------------------------------
  593.  
  594.     1) These are "true" index files, created by BPlus routines;
  595.        they cannot be used unless you have the BPlus source
  596.        code as implemented in IMAIL.
  597.  
  598.     ------------------------------------------------------------- */
  599.  
  600. /*
  601.  *
  602.  *  IMAIL.ND structure
  603.  *
  604.  */
  605.  
  606. struct node_record_type {
  607.   struct naddress  dstn;                  /* Node to pack for */
  608.   char             sysop[MAXNAME];        /* name of sysop */
  609.   char             domain;                /* index to domain */
  610.   char             pwd[21];               /* AreaLink password */
  611.   char             att_status;            /* Status of file attach msg */
  612.   char             program;               /* packer to use ("packers") */
  613.   char             groups[MAXGROUPS+1];   /* groups node can request */
  614.   word             capability;            /* capability word for node */
  615.   bit              allow_remote:1;        /* allow remote maint. */
  616.   bit              check_pkt_pwd:1;       /* check PKT password */
  617.   bit              auto_cap:1;            /* TRUE = auto-detect capability */
  618.   bit              rsvd2:1;               /* reserved */
  619.   bit              newarea_add:1;         /* auto add to new areas? */
  620.   bit              newarea_create:1;      /* create new areas? */
  621.   bit              rescan_ok:1;           /* allow node to rescan */
  622.   bit              notify:1;              /* Send notify messages? */
  623.   bit              rsvd3:2;               /* reserved */
  624.   bit              forward_req:1;         /* Forward ALNK requests? */
  625.   bit              uplink:1;              /* Is this system an uplink? */
  626.   bit              fsc_comp:1;            /* Is a FSC-0057 arealink used? */
  627.   bit              change_packer:1;       /* system may change packer */
  628.   bit              check_alnk:1;          /* check for Arealink-Msg in echos */
  629.   bit              extarcmail:1;          /* use 'A'-'Z' for arcmail extension*/
  630.   word             user_bits;             /* 16 user-available bits */
  631.   char             newarea_group;         /* new areas default group */
  632.   char             pkt_pwd[9];            /* PKT password */
  633.   long             last_pwd_change;       /* time ALNK pwd last changed */
  634.   char             toprogram[11];         /* name of area manager */
  635.   char             msg_status;            /* Status of Alnk messages */
  636.   char             pkt_o_addr;            /* Aka to use for this system */
  637.   long             msgs_in;               /* nr of msgs received */
  638.   long             bytes_in;              /* amount of msgs received */
  639.   long             msgs_out;              /* nr of msgs sent */
  640.   long             bytes_out;             /* amount of msgs sent */
  641.   long             lrdate;                /* date/time of statistic start */
  642.   byte             pack_priority;         /* priority (9-0) when compressing */
  643.   word             security;              /* Security level for area access */
  644.   word             max_arcmail_size;      /* max size of arcmail bundles */
  645.   word             max_pkt_size;          /* max size of pkt to create */
  646.   byte             max_add_pkt;           /* PKTs to compress in one run */
  647.   char             filler[38];
  648.   struct node_record_type *next_node;
  649.   struct node_record_type *prev_node;
  650. };
  651.  
  652.  
  653.     /* --- Notes ---------------------------------------------------
  654.  
  655.     1) The last 2 fields are not saved to IMAIL.ND
  656.     2) the 'user_bits' entry allows third-part software to store
  657.        extra information in IMAIL.ND. Their meaning is program-
  658.        specific, so be careful when making use of them!
  659.     3) The entry in 'pkt_o_addr' is an index into the list of AKAs
  660.        in IMAIL.CF, minus 1. eg:
  661.          im_config.aka[pkt_o_addr-1]
  662.        A value of 0 means 'use o_addr of the echo'
  663.  
  664.     ------------------------------------------------------------- */
  665.  
  666.  
  667. /*
  668.  *
  669.  *  IMAIL.GR structure
  670.  *
  671.  */
  672.  
  673. struct group_record_type {
  674.   char         grp_desc[27];             /* Group description */
  675.   byte         msg_base_type;            /* message base type */
  676.   char         msg_path[MAXPATH];        /* MSG/Squish/Jam path */
  677.   bit          active:1;                 /* flag area active */
  678.   bit          zone_gate:1;              /* Zone-gate stripping */
  679.   bit          tiny_seen:1;              /* tiny seen-by flag */
  680.   bit          secure:1;                 /* secure flag */
  681.   bit          import_seen:1;            /* import seen-by into base */
  682.   bit          mandatory:1;              /* area is mandatory */
  683.   bit          read_only:1;              /* area is read only */
  684.   bit          ulnk_req:1;               /* perform unlinked requests? */
  685.   bit          hidden:1;                 /* area is hidden */
  686.   bit          check_dup:1;              /* check for dupes in this area? */
  687.   bit          no_pause:1;               /* %PAUSE not allowed in this echo? */
  688.   bit          hide_seen:1;              /* Hide seens when importing */
  689.   bit          sqkillfly:1;              /* Squish 'Kill on the fly' */
  690.   bit          dupe_msgid:1;             /* Dupecheck on MSGID only? */
  691.   bit          manual:1;                 /* Manual only */
  692.   bit          rsvd:1;                   /* reserved */
  693.   byte         days;                     /* days to keep messages */
  694.   word         msgs;                     /* num messages to keep */
  695.   char         o_addr;                   /* address for origin */
  696.   char         use_akas[MAXAKAS];        /* addresses for seen-bys */
  697.   byte         kill_dead;                /* kill echos without traffic */
  698.   byte         low_board;                /* Hudson boards for autocreate */
  699.   byte         high_board;               /* lowest and highest */
  700.   word         read_sec;                 /* Security level for read access */
  701.   word         write_sec;                /* Security level for write access */
  702.   char         filler[44];               /* reserved */
  703. };
  704.  
  705.  
  706. /*
  707.  *
  708.  *  IMAIL.RO structure
  709.  *
  710.  */
  711.  
  712. struct pack_routing_type {          /* used in pack routing */
  713.   struct naddress dst;                      /* pack via this node */
  714.   struct naddress nodes[MAXVIA];            /* nodes to pack */
  715.   struct naddress except[MAXEXCEPT];        /* exceptions */
  716. };
  717.  
  718.   /* Note: In the current implementation, the pack routing has */
  719.   /*       as much records as defined in MAXPACK. */
  720.  
  721. /*
  722.  *
  723.  *  IMAIL.PP structure
  724.  *
  725.  */
  726.  
  727. struct packers {
  728.   char         packname[5];
  729.   char         packer[MAXPACKNAME];
  730. };
  731.  
  732. struct compression_type {
  733.   struct packers prg[MAXPACKERS];               /* Packer defintions */
  734.   char           arcunpak[MAXPACKNAME];         /* cmd to de-arc .ARC files */
  735.   char           arjunpak[MAXPACKNAME];         /* cmd to de-arc .ARJ files */
  736.   char           pkpakunpak[MAXPACKNAME];       /* cmd to de-arc .PKA files */
  737.   char           pkzipunpak[MAXPACKNAME];       /* cmd to de-arc .ZIP files */
  738.   char           lharcunpak[MAXPACKNAME];       /* cmd to de-arc .LZH files */
  739.   char           zoounpak[MAXPACKNAME];         /* cmd to de-arc .ZOO files */
  740.   char           pakunpak[MAXPACKNAME];         /* cmd to de-arc .PAK files */
  741.   char           sqzunpak[MAXPACKNAME];         /* cmd to de-arc .SQZ files */
  742.   char           uc2unpak[MAXPACKNAME];         /* cmd to de-arc .UC2 files */
  743.   char           rarunpak[MAXPACKNAME];         /* cmd to de-arc .RAR files */
  744.   char           unkunpak[MAXPACKNAME];         /* cmd to de-arc unknown files */
  745. };
  746.  
  747.  
  748. /*
  749.  *
  750.  *  IMAIL.DP/IMAIL.DPI structure
  751.  *
  752.  */
  753.  
  754.     /* --- Notes ---------------------------------------------------------
  755.  
  756.     1) The dupe database consists simply of a series of long-sized values,
  757.        which are a two 32-bit CRC of (in order) the following data:
  758.  
  759.        CRC 1: Addressee's name
  760.               Sender's name
  761.               Date
  762.               Subject
  763.        CRC 2: Address and MSGID (if any otherwise 0L)
  764.  
  765.     -------------------------------------------------------------------- */
  766.  
  767. /*
  768.  *
  769.  *  IMAIL.NI structure
  770.  *
  771.  */
  772.  
  773. struct no_import_type
  774. {
  775.   char         names[MAXNOIMPT][MAXNAME];
  776. };
  777.  
  778.  
  779. /*
  780.  *
  781.  *  IMAIL.SN structure
  782.  *
  783.  */
  784.  
  785. struct sysop_names {
  786.   char         names[MAXSYSNAME][MAXNAME];
  787. };
  788.  
  789.  
  790. /*--------------------------------EOF-----------------------------------*/
  791.