1 //  This may look like C code, but it is really -*- C++ -*-
2 
3 //  ------------------------------------------------------------------
4 //  The Goldware Library
5 //  Copyright (C) 1992-1994 by Andreas Klein
6 //  Copyright (C) 1990-1999 Odinn Sorensen
7 //  ------------------------------------------------------------------
8 //  This library is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU Library General Public
10 //  License as published by the Free Software Foundation; either
11 //  version 2 of the License, or (at your option) any later version.
12 //
13 //  This library is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 //  Library General Public License for more details.
17 //
18 //  You should have received a copy of the GNU Library General Public
19 //  License along with this program; if not, write to the Free
20 //  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 //  MA 02111-1307, USA
22 //  ------------------------------------------------------------------
23 //  $Id: gs_im160.h,v 1.4 2005/10/22 03:38:17 ssianky Exp $
24 //  ------------------------------------------------------------------
25 //  IMail Definitions and Structures
26 //  ------------------------------------------------------------------
27 
28 #ifndef __gs_im160_h
29 #define __gs_im160_h
30 
31 
32 //  ------------------------------------------------------------------
33 
34 #include <gftnall.h>
35 
36 
37 //  ------------------------------------------------------------------
38 
39 #if defined(GOLD_CANPACK)
40 #pragma pack(1)
41 #endif
42 
43 
44 //  ------------------------------------------------------------------
45 
46 #define IMAIL_MAJ_VERSION     1
47 #define IMAIL_MIN_VERSION     60
48 #define IMAIL_MAJ_VERSION_STR "1"
49 #define IMAIL_MIN_VERSION_STR "60"
50 #define STRUCT_MAJ_VERSION    4
51 #define STRUCT_MIN_VERSION    01
52 #define IM_PRD_CODE           0x4B
53 
54 //  Internal limits
55 
56 #define MAXAKAS              16       /* Max # of addresses */
57 #define MAXPACKERS           11       /* Max # of packer def */
58 #define MAXEXPORT           200       /* Max export defs */
59 #define MAXVIA               40       /* max nodes packed via */
60 #define MAXGROUPS            26       /* max nodes packed via */
61 #define MAXEXCEPT            10       /* max EXCEPT nodes */
62 #define MAXPACK              32       /* max default pack cmd */
63 #define MAXFWDLINK           15       /* max fwd link structs */
64 #define MAXNOIMPT            20       /* max # names for IMPORT */
65 #define MAXSYSNAME           20       /* max # names for PERSMAIL */
66 #define ZONESDOM             10       /* zones per domain entry */
67 #define MAXTAG               51       /* max areatag length */
68 #define MAXNAME              37       /* max namefield lenght */
69 #define MAXPACKNAME          50       /* max packer length */
70 #define MAXORIGIN            64       /* max origin length */
71 
72 //  Message Base Types
73 
74 #ifndef MSGTYPE_SDM
75   #define MSGTYPE_SDM     0x01
76 #endif
77 #ifndef MSGTYPE_SQUISH
78   #define MSGTYPE_SQUISH  0x02
79 #endif
80 #ifndef MSGTYPE_HUDSON
81   #define MSGTYPE_HUDSON  0x03
82 #endif
83 #ifndef MSGTYPE_JAM
84   #define MSGTYPE_JAM     0x04
85 #endif
86 #ifndef MSGTYPE_PASSTH
87   #define MSGTYPE_PASSTH  0x0F
88 #endif
89 #ifndef MSGTYPE_ECHO
90   #define MSGTYPE_ECHO    0x80
91 #endif
92 #ifndef MSGTYPE_LOCAL
93   #define MSGTYPE_LOCAL   0x90
94 #endif
95 #ifndef MSGTYPE_NET
96   #define MSGTYPE_NET     0xA0
97 #endif
98 
99 #define BASEMASK          0x0F
100 #define TYPEMASK          0xF0
101 
102 //  In case your compiler doesn't have these ...
103 
104 #ifndef IMAXPATH
105   #define IMAXPATH            80
106 #endif
107 #ifndef IMAXDRIVE
108   #define IMAXDRIVE           3
109 #endif
110 #ifndef IMAXDIR
111   #define IMAXDIR             66
112 #endif
113 #ifndef IMAXFILE
114   #define IMAXFILE            9
115 #endif
116 #ifndef IMAXEXT
117   #define IMAXEXT             5
118 #endif
119 
120 
121 //  Structs used in IMAIL Configuration files
122 
123 struct eaddress {                   /* used in Area Manager ... */
124   ftn_addr  dstn;                   /* node number */
125   bits      exp_only:1;             /* export only flag */
126   bits      imp_only:1;             /* import only flag */
127   bits      paused:1;               /* echo mail paused */
128   bits      rsvd1:5;                /* reserved */
129 };
130 
131 struct fwd_link {                   /* used for forward request nodes ... */
132   char         areasfile[IMAXFILE+IMAXEXT];   /* name of areas file */
133   char         toprogram[10];               /* name of area manager */
134   char         password[21];                /* area manager password */
135   ftn_addr     uplink;                      /* address of uplink */
136   char         accessgrp;                   /* accessgroup for forwarding */
137   char         creategrp;                   /* creategroup for forwarding */
138   char         filler[10];                  /* reserved */
139 };
140 
141 struct dom {
142   char         domain[21];                  /* name of domain */
143   char         outbound[IMAXPATH];          /* root outbound path */
144   word         zones[ZONESDOM];             /* Zones in this domain */
145   byte         akas[MAXAKAS];               /* =my= AKAs in this domain */
146 };
147 
148 struct im_stats {
149   long         th_day_nr;                   /* nr this day */
150   long         la_day_nr;                   /* nr last day */
151   long         th_week_nr;                  /* nr this week */
152   long         la_week_nr;                  /* nr last week */
153   long         th_month_nr;                 /* nr this month */
154   long         la_month_nr;                 /* nr last month */
155   long         th_year_nr;                  /* nr this year */
156   long         la_year_nr;                  /* nr last year */
157   long         th_day_size;                 /* amount this day */
158   long         la_day_size;                 /* amount last day */
159   long         th_week_size;                /* amount this week */
160   long         la_week_size;                /* amount last week */
161   long         th_month_size;               /* amount this month */
162   long         la_month_size;               /* amount last month */
163   long         th_year_size;                /* amount this year */
164   long         la_year_size;                /* amount last year */
165 };
166 
167 
168 //  IMAIL.CF structure
169 
170 struct im_config_type {
171   byte         im_ver_maj;                    /* Major Version */
172   byte         im_ver_min;                    /* Minor Version */
173   byte         struct_maj;                    /* reserved */
174   byte         struct_min;                    /* reserved */
175   char         sysop[MAXNAME];                /* name of sysop */
176   ftn_addr     aka[MAXAKAS];               /* the AKAs */
177   struct dom   domains[MAXAKAS];              /* domain names & zones */
178   byte         rsvd1[10];                     /* reserved */
179   char         netmail[IMAXPATH];              /* net mail subdirectory */
180   char         netfile[IMAXPATH];              /* inbound files directory */
181   char         in_pkt[IMAXPATH];               /* Directory for inbound PKTs */
182   char         out_pkt[IMAXPATH];              /* Directory for outbound PKTs */
183   char         outbound[IMAXPATH];             /* outbound directory */
184   char         quickbbs[IMAXPATH];             /* QuickBBS system directory */
185   char         uns_netfile[IMAXPATH];          /* unsecured inbound files */
186   char         echotoss[IMAXPATH];             /* name of echotoss.log */
187   char         dupebase[IMAXPATH];             /* dupe data base directory */
188   char         semaphor[IMAXPATH];             /* Semaphor directory */
189   char         logfilename[IMAXPATH];          /* Log file name */
190   char         before_toss[IMAXPATH];          /* call before proc. a PKT */
191   char         semaphor_net[IMAXFILE+IMAXEXT];  /* Netmail rescan semaphor file */
192   char         alnk_help[IMAXFILE+IMAXEXT];     /* AreaLink help text */
193   char         maint_help[IMAXFILE+IMAXEXT];    /* Alnk Remote Maint. Helptext */
194   char         rsvd2[IMAXFILE+IMAXEXT];         /* reserved */
195   char         dflt_origin[MAXORIGIN];        /* default origin line */
196   bits         rtnrecpt:1;                    /* True if to send rtn recpt */
197   bits         del_empty_msg:1;               /* delete empty netmails (TOSS) */
198   bits         ARCmail06:1;                   /* ARCmail 0.6 compatibility */
199   bits         use_crc_names:1;               /* use crc-names for auto-areas */
200   bits         rsvd3:1;                       /* reserved */
201   bits         multi_tasking:1;               /* true if multi-tasking */
202   bits         ignore_unknown:1;              /* ALNK ignores unknown systems */
203   bits         singleextract:1;               /* extract 1 bundle at a time */
204   bits         trunc_sent:1;                  /* 1 = Trunc 0 = Delete */
205   bits         keep_alnk_answ:1;              /* keep arealink answer */
206   bits         prod_names:1;                  /* use the FTSC product list */
207   bits         swap_ems:1;                    /* swap to EMS */
208   bits         swap_ext:1;                    /* swap to extended memory */
209   bits         forward_everything:1;          /* forward req. not in fwd-lists */
210   bits         direct_video:1;                /* use direct screen writing */
211   bits         rsvd4:1;                       /* reserved */
212   bits         compr_after_pkt:1;             /* compress after each PKT? */
213   bits         delete_bases:1;                /* when removing an area, */
214                                               /* delete also squish/msg-base */
215   bits         rsvd5:1;                       /* reserved */
216   bits         use_imcomp:1;                  /* call IMCOMP in case of tight */
217                                               /* diskspace or abort at once */
218   bits         rsvd6:4;                       /* reserved */
219   long         last_run;                      /* last maintenance run */
220   word         rsvd7;                         /* reserved */
221   byte         rsvd8;                         /* reserved */
222   byte         rsvd9;                         /* reserved */
223   word         max_arcmail_size;              /* max size of arcmail bundles */
224   word         pwd_expire_days;               /* days before pwd expr'd */
225   word         max_pkt_size;                  /* max size of pkt to create */
226   byte         max_add_pkt;                   /* PKTs to compress in one run */
227   byte         pkt_not_for_us;                /* how to handle PKTs not for us */
228   byte         environment;                   /* FroDo, Binkley or Intermail */
229   byte         max_msg_size;                  /* max size of netmail (split) */
230   byte         via_line;                      /* add Via Line to netmails */
231   byte         dupe_ring;                     /* Check for possible d-rings */
232   byte         cpd_check;                     /* circular path detection */
233   byte         pers_mail;                     /* use personal mail feature */
234   byte         unlink_req;                    /* Unlink areas without dlink */
235   byte         keep_alnk_req;                 /* keep arealink request */
236   byte         rsvd10;                        /* reserved */
237   long         max_dupes;                     /* max dupes kept in dbase */
238   word         max_files_per_dir;             /* max. nr files when autocreate */
239   byte         deadlink_days;                 /* nr of days for a dealink req */
240   byte         rsvd11;                        /* reserved */
241   char         bbs_system;                    /* BBS software used */
242   char         new_areas[IMAXPATH];            /* name of file for new areas */
243   word         sp_before_unpack;              /* min. diskspace required */
244   word         sp_before_toss;                /* before decompress, toss */
245   word         sp_before_compress;            /* and compress (in MB). */
246   char         kill_dead;                     /* Kill Dead Selection */
247   word         prod[20];                      /* Type2+ product codes */
248   char         rsvd12[720];                   /* reserved */
249   struct fwd_link fwd[MAXFWDLINK];            /* forward link requests */
250   char         echojam[IMAXPATH];              /* path to ECHOMAIL.JAM */
251   char         before_toss_ii[IMAXPATH];       /* call before proc. the PKTs */
252   char         userbase[IMAXPATH];             /* path to the userbase */
253   long         stoptossmsgs;                  /* stop tossing after xxxxx msgs */
254   long         stoptossnetmsgs;               /* stop tossing after xxxxx net */
255                                               /* msgs within a PKT or at all */
256   char         ignorelist[IMAXPATH];           /* list of areas to suppress */
257   char         db_queue[IMAXPATH];             /* D'Bridge queue directory */
258   long         log_level;                     /* logging level */
259   char         att_status;                    /* Def. status of attach msg */
260   char         msg_status;                    /* Def. status of Alnk msgs */
261   char         filler[278];                   /* reserved */
262 };
263 
264 
265 //  IMAIL.AR structure
266 
267 struct areas_record_type {
268   char         aname[MAXTAG];              /* area name */
269   char         comment[61];                /* area comment */
270   char         origin[MAXORIGIN];          /* origin line to use */
271   char         group;                      /* area group */
272   char         o_addr;                     /* address for origin */
273   char         use_akas[MAXAKAS];          /* addresses for seen-bys */
274   byte         msg_base_type;              /* message base type */
275   byte         brd;                        /* board number */
276   char         msg_path[IMAXPATH];          /* MSG/Squish path */
277   bits         active:1;                   /* flag area active */
278   bits         zone_gate:1;                /* Zone-gate stripping */
279   bits         tiny_seen:1;                /* tiny seen-by flag */
280   bits         secure:1;                   /* secure flag */
281   bits         import_seen:1;              /* import seen-by into base */
282   bits         deleted:1;                  /* flag deleted area */
283   bits         auto_added:1;               /* flag auto-added record */
284   bits         mandatory:1;                /* area is mandatory */
285   bits         read_only:1;                /* area is read only */
286   bits         unlinked:1;                 /* area has been unlinked */
287   bits         ulnk_req:1;                 /* perform unlinked requests? */
288   bits         hidden:1;                   /* area is hidden */
289   bits         to_link:1;                  /* should by processed by LINK */
290   bits         check_dup:1;                /* check for dupes in this area? */
291   bits         no_pause:1;                 /* %PAUSE not allowed in this echo? */
292   bits         hide_seen:1;                /* Hide seens when importing */
293   bits         manual:1;                   /* No changes via Arealink */
294   bits         fwdreq_pending:1;           /* Requested but yet not arrived */
295   bits         sqkillfly:1;                /* Squish 'Kill on the fly' */
296   bits         dupe_msgid:1;               /* Dupecheck on MSGID only? */
297   bits         deadlink_req:1;             /* Deadlink request has been sent */
298   bits         rsvd:2;                     /* reserved */
299   byte         user_bits;                  /* 8 user-available bits */
300   byte         days;                       /* days to keep messages */
301   word         msgs;                       /* num messages to keep */
302   struct im_stats stats;                   /* statistics */
303   time32_t     creation;                   /* date/time of statistic start */
304   time32_t     update;                     /* last update by midnight update */
305   time32_t     marked;                     /* used by kill dead */
306   byte         kill_dead;                  /* kill echos without traffic */
307   word         read_sec;                   /* Security level for read access */
308   word         write_sec;                  /* Security level for write access */
309   char         filler[30];
310   struct eaddress exp[MAXEXPORT];       /* export list */
311 };
312 
313 
314 //  ------------------------------------------------------------------
315 
316 #if defined(GOLD_CANPACK)
317 #pragma pack()
318 #endif
319 
320 
321 //  ------------------------------------------------------------------
322 
323 #endif
324 
325 //  ------------------------------------------------------------------
326