4 * main Citadel/UX header file
5 * see copyright.txt for copyright information
8 /* system customizations are in sysconfig.h */
13 /* Build Citadel with the calendar service only if the header *and*
14 * library for libical are both present.
18 #define CITADEL_WITH_CALENDAR_SERVICE 1
24 #include "sysconfig.h"
33 * Text description of this software
35 #define CITADEL "Citadel/UX 6.08"
38 * REV_LEVEL is the current version number (multiplied by 100 to avoid having
39 * to fiddle with the decimal). REV_MIN is the oldest version of Citadel
40 * whose data files are compatible with the current version. If the data files
41 * are older than REV_MIN, none of the programs will work until the setup
42 * program is run again to bring things up to date. EXPORT_REV_MIN is the
43 * oldest version of Citadel whose export files we can read. The latter is
44 * usually more strict because you're not really supposed to dump/load and
45 * upgrade at the same time.
47 #define REV_LEVEL 608 /* This version */
48 #define REV_MIN 591 /* Oldest compatible database */
49 #define EXPORT_REV_MIN 608 /* Oldest compatible export files */
51 #define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please
52 obtain SERVER_TYPE codes for your implementations */
54 /* Various length constants */
56 #define UGLISTLEN 100 /* you get a ungoto list of this size */
57 #define ROOMNAMELEN 128 /* The size of a roomname string */
58 #define NONCE_SIZE 128 /* Added by <bc> to allow for APOP auth
59 * it is BIG becuase there is a hostname
60 * in the nonce, as per the APOP RFC.
63 #define USERNAME_SIZE 64 /* The size of a username string */
64 #define MAX_EDITORS 5 /* # of external editors supported */
65 /* MUST be at least 1 */
68 * Message expiration policy stuff
75 #define EXPIRE_NEXTLEVEL 0 /* Inherit expiration policy */
76 #define EXPIRE_MANUAL 1 /* Don't expire messages at all */
77 #define EXPIRE_NUMMSGS 2 /* Keep only latest n messages */
78 #define EXPIRE_AGE 3 /* Expire messages after n days */
82 * Global system configuration.
84 * Developers: please do NOT remove the fields labelled "not in use". We
85 * can't simply remove them from the struct, because that would render the
86 * configs on existing systems corrupt. However, if you need the same number
87 * of bytes for a *new* field, feel free to use them.
90 char c_nodename[16]; /* Unqualified "short" nodename */
91 char c_fqdn[64]; /* Fully Qualified Domain Name */
92 char c_humannode[21]; /* Long name of system */
93 char c_phonenum[16]; /* Dialup number of system */
94 uid_t c_bbsuid; /* UID of the bbs-only user */
95 char c_creataide; /* room creator = room aide flag */
96 int c_sleeping; /* watchdog timer setting */
97 char c_initax; /* initial access level */
98 char c_regiscall; /* call number to register on */
99 char c_twitdetect; /* twit detect flag */
100 char c_twitroom[ROOMNAMELEN]; /* twit detect msg move to room */
101 char c_moreprompt[80]; /* paginator prompt */
102 char c_restrict; /* restrict Internet mail flag */
103 long c_niu_1; /* (not in use) */
104 char c_bbs_city[32]; /* physical location of server */
105 char c_sysadm[26]; /* name of system administrator */
106 char c_niu_2[15]; /* (not in use) */
107 int c_setup_level; /* what rev level we've setup to */
108 int c_maxsessions; /* maximum concurrent sessions */
109 char c_net_password[20]; /* system net password (obsolete) */
110 int c_port_number; /* Cit listener port (usually 504) */
111 int c_ipgm_secret; /* Internal program authentication */
112 struct ExpirePolicy c_ep; /* System default msg expire policy */
113 int c_userpurge; /* System default user purge (days) */
114 int c_roompurge; /* System default room purge (days) */
115 char c_logpages[ROOMNAMELEN]; /* Room to log pages to (or not) */
116 char c_createax; /* Axlevel required to create rooms */
117 long c_maxmsglen; /* Maximum message length */
118 int c_min_workers; /* Lower limit on number of threads */
119 int c_max_workers; /* Upper limit on number of threads */
120 int c_pop3_port; /* POP3 listener port (usually 110) */
121 int c_smtp_port; /* SMTP listener port (usually 25) */
122 int c_rfc822_strict_from; /* 1 = don't correct From: forgeries*/
123 int c_aide_zap; /* Are Aides allowed to zap rooms? */
124 int c_imap_port; /* IMAP listener port (usually 143) */
125 time_t c_net_freq; /* how often to run the networker */
126 char c_disable_newu; /* disable NEWU command */
127 char c_aide_mailboxes; /* give Aides access to mailboxes */
128 char c_baseroom[ROOMNAMELEN]; /* Name of baseroom (Lobby) */
129 char c_aideroom[ROOMNAMELEN]; /* Name of aideroom (Aide) */
133 * This struct stores a list of rooms with new messages which the client
134 * fetches from the server. This allows the client to "march" through
135 * relevant rooms without having to ask the server each time where to go next.
139 char march_name[ROOMNAMELEN];
140 unsigned int march_flags;
143 unsigned int march_flags2;
147 #define NODENAME config.c_nodename
148 #define FQDN config.c_fqdn
149 #define HUMANNODE config.c_humannode
150 #define PHONENUM config.c_phonenum
151 #define BBSUID config.c_bbsuid
152 #define CREATAIDE config.c_creataide
153 #define REGISCALL config.c_regiscall
154 #define TWITDETECT config.c_twitdetect
155 #define TWITROOM config.c_twitroom
156 #define RESTRICT_INTERNET config.c_restrict
161 struct user { /* User record */
162 int version; /* Cit vers. which created this rec */
163 uid_t uid; /* Associate with a unix account? */
164 char password[32]; /* password (for BBS-only users) */
165 unsigned flags; /* See US_ flags below */
166 long timescalled; /* Total number of logins */
167 long posted; /* Number of messages posted (ever) */
168 cit_uint8_t axlevel; /* Access level */
169 long usernum; /* User number (never recycled) */
170 time_t lastcall; /* Last time the user called */
171 int USuserpurge; /* Purge time (in days) for user */
172 char fullname[64]; /* Name for Citadel messages & mail */
173 cit_uint8_t USscreenwidth; /* Screen width (for textmode users)*/
174 cit_uint8_t USscreenheight; /* Screen height(for textmode users)*/
179 * This is the control record for the message base...
182 long MMhighest; /* highest message number in file */
183 unsigned MMflags; /* Global system flags */
184 long MMnextuser; /* highest user number on system */
185 long MMnextroom; /* highest room number on system */
186 int version; /* Server-hosted upgrade level */
189 /* Bits which may appear in CitControl.MMflags. Note that these don't
190 * necessarily pertain to the message base -- it's just a good place to
191 * store any global flags.
193 #define MM_VALID 4 /* New users need validating */
199 char QRname[ROOMNAMELEN]; /* Name of room */
200 char QRpasswd[10]; /* Only valid if it's a private rm */
201 long QRroomaide; /* User number of room aide */
202 long QRhighest; /* Highest message NUMBER in room */
203 time_t QRgen; /* Generation number of room */
204 unsigned QRflags; /* See flag values below */
205 char QRdirname[15]; /* Directory name, if applicable */
206 long QRinfo; /* Info file update relative to msgs*/
207 char QRfloor; /* Which floor this room is on */
208 time_t QRmtime; /* Date/time of last post */
209 struct ExpirePolicy QRep; /* Message expiration policy */
210 long QRnumber; /* Globally unique room number */
211 char QRorder; /* Sort key for room listing order */
212 unsigned QRflags2; /* Additional flags */
213 int QRdefaultview; /* How to display the contents */
216 /* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
217 * or QR_GUESSNAME is set, then it is invitation-only. Passworded rooms are
218 * flagged with both QR_PRIVATE and QR_PASSWORDED while guess-name rooms are
219 * flagged with both QR_PRIVATE and QR_GUESSNAME. NEVER set all three flags.
225 #define MES_NORMAL 65 /* Normal message */
226 #define MES_ANONONLY 66 /* "****" header */
227 #define MES_ANONOPT 67 /* "Anonymous" header */
229 #define MES_ERROR (-1) /* Can't send message due to bad address */
230 #define MES_LOCAL 0 /* Local message, do no network processing */
231 #define MES_INTERNET 1 /* Convert msg and send as Internet mail */
232 #define MES_IGNET 2 /* Process recipient and send via Cit net */
234 /****************************************************************************/
237 * Floor record. The floor number is implicit in its location in the file.
240 unsigned short f_flags; /* flags */
241 char f_name[256]; /* name of floor */
242 int f_ref_count; /* reference count */
243 struct ExpirePolicy f_ep; /* default expiration policy */
246 #define F_INUSE 1 /* floor is in use */
250 * Values used internally for function call returns, etc.
253 #define NEWREGISTER 0 /* new user to register */
254 #define REREGISTER 1 /* existing user reregistering */
256 #define READ_HEADER 2
257 #define READ_MSGBODY 3
259 /* commands we can send to the sttybbs() routine */
260 #define SB_NO_INTR 0 /* set to bbs mode, i/q disabled */
261 #define SB_YES_INTR 1 /* set to bbs mode, i/q enabled */
262 #define SB_SAVE 2 /* save settings */
263 #define SB_RESTORE 3 /* restore settings */
264 #define SB_LAST 4 /* redo the last command sent */
269 /* server exit codes */
270 #define EXIT_NORMAL 0 /* server terminated normally */
271 /* 1 through 63 reserved for signals */
272 #define EXIT_NULL 64 /* EOF on server command input */
274 /* citadel.rc stuff */
275 #define RC_NO 0 /* always no */
276 #define RC_YES 1 /* always yes */
277 #define RC_DEFAULT 2 /* setting depends on user config */
281 KA_NO, /* no keepalives */
282 KA_YES, /* full keepalives */
283 KA_HALF /* half keepalives */
286 /* for <;G>oto and <;S>kip commands */
287 #define GF_GOTO 0 /* <;G>oto floor mode */
288 #define GF_SKIP 1 /* <;S>kip floor mode */
289 #define GF_ZAP 2 /* <;Z>ap floor mode */
292 * MIME types used in Citadel for configuration stuff
294 #define SPOOLMIME "application/x-citadel-delivery-list"
295 #define INTERNETCFG "application/x-citadel-internet-config"
296 #define IGNETCFG "application/x-citadel-ignet-config"
297 #define IGNETMAP "application/x-citadel-ignet-map"
298 #define FILTERLIST "application/x-citadel-filter-list"
299 #define SPAMSTRINGS "application/x-citadel-spam-strings"
301 #define TRACE lprintf(9, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
304 #define LONG_MAX 2147483647L
311 #define VIEW_BBS 0 /* Traditional Citadel BBS view */
312 #define VIEW_MAILBOX 1 /* Mailbox summary */
313 #define VIEW_ADDRESSBOOK 2 /* Address book view */
322 #define tmpnam(x) CtdlTempFileName(__FILE__, __LINE__)
327 #define tmpfile() CtdlTempFile()
329 #endif /* CITADEL_H */