echocfg.c 59.5 KB
Newer Older
1
2
3
4
5
6
7
8
/* SBBSecho configuration utility 											*/

/* $Id$ */

/****************************************************************************
 * @format.tab-size 4		(Plain Text/Source Code File Header)			*
 * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
 *																			*
9
 * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 *																			*
 * This program is free software; you can redistribute it and/or			*
 * modify it under the terms of the GNU General Public License				*
 * as published by the Free Software Foundation; either version 2			*
 * of the License, or (at your option) any later version.					*
 * See the GNU General Public License for more details: gpl.txt or			*
 * http://www.fsf.org/copyleft/gpl.html										*
 *																			*
 * Anonymous FTP access to the most recent released source is available at	*
 * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net	*
 *																			*
 * Anonymous CVS access to the development source and modification history	*
 * is available at cvs.synchro.net:/cvsroot/sbbs, example:					*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login			*
 *     (just hit return, no password is necessary)							*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src		*
 *																			*
 * For Synchronet coding style and modification guidelines, see				*
 * http://www.synchro.net/source.html										*
 *																			*
 * You are encouraged to submit any modifications (preferably in Unix diff	*
 * format) via e-mail to mods@synchro.net									*
 *																			*
 * Note: If this box doesn't appear square, then you need to fix your tabs.	*
 ****************************************************************************/
35
36
37

/* Portions written by Allen Christiansen 1994-1996 						*/

38
#include <stdio.h>
39

40
#undef JAVASCRIPT
41

rswindell's avatar
rswindell committed
42
43
44
/* XPDEV Headers */
#include "gen_defs.h"

45
46
#define __COLORS
#include "ciolib.h"
47
48
#include "uifc.h"
#include "sbbs.h"
49
50
51
52
#include "sbbsecho.h"

char **opt;

rswindell's avatar
rswindell committed
53
sbbsecho_cfg_t cfg;
54
55
uifcapi_t uifc;

56
57
58
void bail(int code)
{

59
60
	if(uifc.bail!=NULL)
		uifc.bail();
61
62
63
	exit(code);
}

64
65
66
/* These correlate with the LOG_* definitions in syslog.h/gen_defs.h */
static char* logLevelStringList[] 
	= {"Emergency", "Alert", "Critical", "Error", "Warning", "Notice", "Informational", "Debugging", NULL};
67
68
69
70

int main(int argc, char **argv)
{
	char str[256],*p;
rswindell's avatar
rswindell committed
71
	int i,j,k,x,dflt,nodeop=0,packop=0,listop=0;
72
73
74
	echolist_t savlistcfg;
	nodecfg_t savnodecfg;
	arcdef_t savarcdef;
75
	BOOL door_mode=FALSE;
76
	int		ciolib_mode=CIOLIB_MODE_AUTO;
rswindell's avatar
rswindell committed
77
78
79
	unsigned int u;
	char	sysop_aliases[256];
	sbbsecho_cfg_t orig_cfg;
80

81
82
83
84
	ZERO_VAR(savlistcfg);
	ZERO_VAR(savnodecfg);
	ZERO_VAR(savarcdef);

85
86
	fprintf(stderr,"\nSBBSecho Configuration  Version %u.%02u  Copyright %s "
		"Rob Swindell\n\n",SBBSECHO_VERSION_MAJOR, SBBSECHO_VERSION_MINOR, __DATE__+7);
87

rswindell's avatar
rswindell committed
88
	memset(&cfg,0,sizeof(cfg));
89
90
91
92
	str[0]=0;
	for(i=1;i<argc;i++) {
		if(argv[i][0]=='-')
			switch(toupper(argv[i][1])) {
93
                case 'D':
94
					printf("NOTICE: The -d option is deprecated, use -id instead\r\n");
95
96
97
98
99
100
101
102
103
					SLEEP(2000);
                    door_mode=TRUE;
                    break;
                case 'L':
                    uifc.scrn_len=atoi(argv[i]+2);
                    break;
                case 'E':
                    uifc.esc_delay=atoi(argv[i]+2);
                    break;
104
				case 'I':
105
106
107
108
109
110
111
112
					switch(toupper(argv[i][2])) {
						case 'A':
							ciolib_mode=CIOLIB_MODE_ANSI;
							break;
						case 'C':
							ciolib_mode=CIOLIB_MODE_CURSES;
							break;
						case 0:
113
							printf("NOTICE: The -i option is deprecated, use -if instead\r\n");
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
							SLEEP(2000);
						case 'F':
							ciolib_mode=CIOLIB_MODE_CURSES_IBM;
							break;
						case 'X':
							ciolib_mode=CIOLIB_MODE_X;
							break;
						case 'W':
							ciolib_mode=CIOLIB_MODE_CONIO;
							break;
						case 'D':
		                    door_mode=TRUE;
		                    break;
						default:
							goto USAGE;
					}
130
					break;
131
132
133
				case 'K':	/* Keyboard-only mode (no mouse support) */
					uifc.mode |= UIFC_NOMOUSE;
					break;
134
135
136
137
138
139
		        case 'M':   /* Monochrome mode */
        			uifc.mode|=UIFC_MONO;
                    break;
                case 'C':
        			uifc.mode|=UIFC_COLOR;
                    break;
140
141
                case 'V':
                    textmode(atoi(argv[i]+2));
142
                    break;
143
144
                default:
					USAGE:
rswindell's avatar
rswindell committed
145
                    printf("\nusage: echocfg [path/to/sbbsecho.ini] [options]"
146
                        "\n\noptions:\n\n"
147
						"-k  =  keyboard mode only (no mouse support)\r\n"
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
                        "-c  =  force color mode\r\n"
						"-m  =  force monochrome mode\r\n"
                        "-e# =  set escape delay to #msec\r\n"
						"-iX =  set interface mode to X (default=auto) where X is one of:\r\n"
#ifdef __unix__
						"       X = X11 mode\r\n"
						"       C = Curses mode\r\n"
						"       F = Curses mode with forced IBM charset\r\n"
#else
						"       W = Win32 native mode\r\n"
#endif
						"       A = ANSI mode\r\n"
						"       D = standard input/output/door mode\r\n"
                        "-v# =  set video mode to # (default=auto)\r\n"
                        "-l# =  set screen lines to # (default=auto-detect)\r\n"
                        );
        			exit(0);
165
166
		}
		else
167
			strcpy(str,argv[i]);
168
169
	}
	if(str[0]==0) {
170
171
172
173
		p=getenv("SBBSCTRL");
		if(!p) {
			p=getenv("SBBSNODE");
			if(!p) {
rswindell's avatar
rswindell committed
174
				goto USAGE;
175
176
				exit(1); 
			}
177
178
			strcpy(str,p);
			backslash(str);
rswindell's avatar
rswindell committed
179
			strcat(str,"../ctrl/sbbsecho.ini"); 
180
		}
181
182
183
		else {
			strcpy(str,p);
			backslash(str);
rswindell's avatar
rswindell committed
184
			strcat(str,"sbbsecho.ini"); 
185
186
		} 
	}
rswindell's avatar
rswindell committed
187
	SAFECOPY(cfg.cfgfile,str);
188

rswindell's avatar
rswindell committed
189
190
191
192
193
	if(!sbbsecho_read_ini(&cfg)) {
		fprintf(stderr, "ERROR %d (%s) reading %s\n", errno, strerror(errno), cfg.cfgfile);
		exit(1);
	}
	orig_cfg = cfg;
194

195
	// savnum=0;
rswindell's avatar
rswindell committed
196
	if((opt=(char **)malloc(sizeof(char *)*1000))==NULL) {
197
		puts("memory allocation error\n");
198
199
		exit(1); 
	}
rswindell's avatar
rswindell committed
200
201
	for(i=0;i<1000;i++)
		if((opt[i]=(char *)malloc(MAX_OPLN+1))==NULL) {
202
			puts("memory allocation error\n");
203
204
			exit(1); 
		}
205
	uifc.size=sizeof(uifc);
206
207
208
209
210
211
212
213
	if(!door_mode) {
		i=initciolib(ciolib_mode);
		if(i!=0) {
    		printf("ciolib library init returned error %d\n",i);
    		exit(1);
		}
    	i=uifcini32(&uifc);  /* curses/conio/X/ANSI */
	}
214
	else
215
    	i=uifcinix(&uifc);  /* stdio */
216
217
218
219
220
221

	if(i!=0) {
		printf("uifc library init returned error %d\n",i);
		exit(1);
	}

rswindell's avatar
rswindell committed
222
223
	uifc.timedisplay = NULL;
	sprintf(str,"SBBSecho Config v%u.%02u",SBBSECHO_VERSION_MAJOR, SBBSECHO_VERSION_MINOR);
224
	uifc.scrn(str);
rswindell's avatar
rswindell committed
225
226
227
228
	p=cfg.cfgfile;
	if(strlen(p) + strlen(str) + 4 > uifc.scrn_width)
		p=getfname(cfg.cfgfile);
	uifc.printf(uifc.scrn_width-(strlen(p)+1),1,uifc.bclr|(uifc.cclr<<4),p);
229

230
231
	dflt=0;
	while(1) {
rswindell's avatar
rswindell committed
232
233
		if(memcmp(&cfg, &orig_cfg, sizeof(cfg)) != 0)
			uifc.changes = TRUE;
234
		uifc.helpbuf=
235
	"~ SBBSecho Configuration ~\r\n\r\n"
rswindell's avatar
rswindell committed
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
	"This program allows you to easily configure the Synchronet BBS\r\n"
	"FidoNet-style EchoMail program known as `SBBSecho`.  Alternatively, you\r\n"
	"may edit the SBBSecho configuration file (e.g. `ctrl/sbbsecho.ini`) using\r\n"
	"an ASCII/plain-text editor.\r\n"
	"\r\n"
	"For detailed documentation, see `http://wiki.synchro.net/util:sbbsecho`\r\n"
	"\r\n"
	"`Mailer Type` should normally be set to `Binkley/FLO` to enable SBBSecho's\r\n"
	"\"Binkley-Style Outbound\" operating mode (a.k.a. `BSO` or `FLO` mode).\r\n"
	"If you are using an `Attach`, `ArcMail`, or `FrontDoor` style FidoNet\r\n"
	"mailer, then set this setting to `ArcMail/Attach`, but know that most\r\n"
	"modern FidoNet mailers are Binkley-Style and therefore that mode of\r\n"
	"operation in SBBSecho is more widely tested and supported.\r\n"
	"\r\n"
	"`Log Level` should normally be set to `Informational` but if you're\r\n"
	"experiencing problems with SBBSecho and would like more verbose log\r\n"
	"output, set this to `Debugging`. If you want less verbose logging,\r\n"
	"set to higher-severity levels to reduce the number of log messages.\r\n"
	"\r\n"
	"The `Linked Nodes` sub-menu is where you configure your FidoNet-style\r\n"
	"links: other FidoNet-style nodes/systems you directly connect with.\r\n"
	"\r\n"
	"The `Archive Types` sub-menu is where you configure your archive\r\n"
	"programs (a.k.a. \"packers\") used for the packing and unpacking of\r\n"
	"EchoMail bundle files (usually in 'zip' format).\r\n"
	"\r\n"
262
	"The `NetMail Settings` sub-menu is where you configure NetMail-specific\r\n"
rswindell's avatar
rswindell committed
263
264
	"settings.\r\n"
	"\r\n"
265
	"The `EchoMail Settings` sub-menu is where you configure EchoMail-specific\r\n"
rswindell's avatar
rswindell committed
266
267
268
269
270
271
	"settings.\r\n"
	"\r\n"
	"The `Paths and Filenames` sub-menu is where you configure your system's\r\n"
	"directory and file paths used by SBBSecho.\r\n"
	"\r\n"
	"The `Additional EchoLists` sub-menu is for configuring additional\r\n"
rswindell's avatar
rswindell committed
272
	"(optional) lists of FidoNet-style message areas in `BACKBONE.NA` format.\r\n"
rswindell's avatar
rswindell committed
273
	"These lists, if configured, are used in addition to your main\r\n"
rswindell's avatar
rswindell committed
274
	"`Area File` (e.g. areas.bbs) for advanced AreaFix/AreaMgr operations."
rswindell's avatar
rswindell committed
275
	;
276
		i=0;
rswindell's avatar
rswindell committed
277
278
279
280
281
		sprintf(opt[i++],"%-25s %s","Mailer Type"
			,cfg.flo_mailer ? "Binkley/FLO":"ArcMail/Attach");
		sprintf(opt[i++],"%-25s %s","Log Level",logLevelStringList[cfg.log_level]);
		sprintf(opt[i++],"Linked Nodes...");
		sprintf(opt[i++],"Archive Types...");
282
283
		sprintf(opt[i++],"NetMail Settings...");
		sprintf(opt[i++],"EchoMail Settings...");
rswindell's avatar
rswindell committed
284
285
286
287
		sprintf(opt[i++],"Paths and Filenames...");
		sprintf(opt[i++],"Additional EchoLists...");
		if(uifc.changes)
			snprintf(opt[i++],MAX_OPLN-1,"Save Changes to %s", getfname(cfg.cfgfile));
rswindell's avatar
rswindell committed
288
		opt[i][0]=0;
rswindell's avatar
rswindell committed
289
290
		switch(uifc.list(WIN_ORG|WIN_MID|WIN_ACT|WIN_ESC,0,0,45,&dflt,0
			,"Configure SBBSecho",opt)) {
291

292
			case 0:
rswindell's avatar
rswindell committed
293
				cfg.flo_mailer = !cfg.flo_mailer;
294
				break;
295

296
297
			case 1:
	uifc.helpbuf=
rswindell's avatar
rswindell committed
298
299
300
301
302
303
304
305
	"~ Log Level ~\r\n"
	"\r\n"
	"Select the minimum severity of log entries to be logged to the log file.\r\n"
	"The default/normal setting is `Informational`.";
				j=cfg.log_level;
				i=uifc.list(WIN_MID,0,0,0,&j,0,"Log Level",logLevelStringList);
				if(i>=0 && i<=LOG_DEBUG)
					cfg.log_level=i;
306
				break;
307
308


rswindell's avatar
rswindell committed
309
			case 2:
310
311
				i=0;
				while(1) {
rswindell's avatar
rswindell committed
312
313
314
315
316
317
318
319
320
					uifc.helpbuf=
	"~ Linked Nodes ~\r\n\r\n"
	"From this menu you can configure the settings for your linked\r\n"
	"FidoNet-style nodes (uplinks and downlinks).\r\n"
	"\r\n"
	"A single node configuration can represent one node or a collection\r\n"
	"of nodes, by using the `ALL` wildcard word."
	;

321
					for(u=0;u<cfg.nodecfgs;u++)
rswindell's avatar
rswindell committed
322
323
324
						snprintf(opt[u], MAX_OPLN-1, "%-23s %s"
							,faddrtoa(&cfg.nodecfg[u].addr)
							,cfg.nodecfg[u].comment);
325
					opt[u][0]=0;
326
327
328
329
330
					int mode = WIN_SAV | WIN_INS | WIN_DEL | WIN_ACT | WIN_GET 
						| WIN_INSACT | WIN_DELACT | WIN_XTR;
					if (savnodecfg.addr.zone)
						mode |= WIN_PUT;
					i=uifc.list(mode,0,0,0,&i,0,"Linked Nodes",opt);
331
332
333
334
335
336
					if(i==-1)
						break;
					if((i&MSK_ON)==MSK_INS) {
						i&=MSK_OFF;
						str[0]=0;
	uifc.helpbuf=
337
	"~ Address ~\r\n\r\n"
rswindell's avatar
rswindell committed
338
339
	"This is the FidoNet style address of the node you wish to add (4D).\r\n";
						if(uifc.input(WIN_MID|WIN_SAV,0,0
340
341
342
							,"Node Address (ALL wildcard allowed)",str
							,25,K_EDIT)<1)
							continue;
deuce's avatar
deuce committed
343
						if((cfg.nodecfg=(nodecfg_t *)realloc(cfg.nodecfg
344
345
							,sizeof(nodecfg_t)*(cfg.nodecfgs+1)))==NULL) {
							printf("\nMemory Allocation Error\n");
346
347
							exit(1); 
						}
348
349
350
351
352
						for(j=cfg.nodecfgs;j>i;j--)
							memcpy(&cfg.nodecfg[j],&cfg.nodecfg[j-1]
								,sizeof(nodecfg_t));
						cfg.nodecfgs++;
						memset(&cfg.nodecfg[i],0,sizeof(nodecfg_t));
rswindell's avatar
rswindell committed
353
354
						cfg.nodecfg[i].addr=atofaddr(str);
						uifc.changes=TRUE;
355
356
						continue; 
					}
357

358
359
					if((i&MSK_ON)==MSK_DEL || (i&MSK_ON) == MSK_CUT) {
						int msk = i&MSK_ON;
360
						i&=MSK_OFF;
361
362
						if(msk == MSK_CUT)
							memcpy(&savnodecfg, &cfg.nodecfg[i], sizeof(nodecfg_t));
363
364
365
						cfg.nodecfgs--;
						if(cfg.nodecfgs<=0) {
							cfg.nodecfgs=0;
366
367
							continue; 
						}
368
369
						for(u=i;u<cfg.nodecfgs;u++)
							memcpy(&cfg.nodecfg[u],&cfg.nodecfg[u+1]
370
								,sizeof(nodecfg_t));
deuce's avatar
deuce committed
371
						if((cfg.nodecfg=(nodecfg_t *)realloc(cfg.nodecfg
372
373
							,sizeof(nodecfg_t)*(cfg.nodecfgs)))==NULL) {
							printf("\nMemory Allocation Error\n");
374
375
							exit(1); 
						}
rswindell's avatar
rswindell committed
376
						uifc.changes=TRUE;
377
378
						continue; 
					}
379
380
381
					if((i&MSK_ON)==MSK_GET) {
						i&=MSK_OFF;
						memcpy(&savnodecfg,&cfg.nodecfg[i],sizeof(nodecfg_t));
382
383
						continue; 
					}
384
385
386
					if((i&MSK_ON)==MSK_PUT) {
						i&=MSK_OFF;
						memcpy(&cfg.nodecfg[i],&savnodecfg,sizeof(nodecfg_t));
rswindell's avatar
rswindell committed
387
						uifc.changes=TRUE;
388
389
						continue; 
					}
390
391
					while(1) {
	uifc.helpbuf=
rswindell's avatar
rswindell committed
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
	"~ Linked Node Settings ~\r\n\r\n"
	"These are the settings available for each configured node:\r\n"
	"\r\n"
	"`Address` is the FidoNet-style address in the Zone:Net/Node (3D) or\r\n"
	"Zone:Net/Node.Point (4D) format. The wildcard word '`ALL`' may be used\r\n"
	"in place of one of the fields to create a node configuration which\r\n"
	"will apply to *all* nodes matching that address pattern.\r\n"
	"e.g. '`1:ALL`' matches all nodes within FidoNet Zone 1.\r\n"
	"\r\n"
	"`Comment` is a note to yourself about this node. Setting this to the\r\n"
	"user or sysop name corresponding with the configured node can be\r\n"
	"a helpful reminder to yourself later.\r\n"
	"\r\n"
	"`Archive Type` is the name of an archive type corresponding with one of\r\n"
	"your configured archive types or '`None`'.  This archive type will\r\n"
	"be used when creating EchoMail bundles or if `None`, raw/uncompressed\r\n"
	"EchoMail packets will be sent to this node.\r\n"
	"This setting may be managed by the node using NetMail/AreaFix requests.\r\n"
	"\r\n"
	"`Packet Type` is the type of outbound packet generated for this node.\r\n"
	"Incoming packet types are automatically detected from among the list\r\n"
rswindell's avatar
rswindell committed
413
414
	"of supported packet types (`2`, `2.2`, `2e`, and `2+`).\r\n"
	"The default outbound packet type is `Type-2+`.\r\n"
rswindell's avatar
rswindell committed
415
416
417
418
419
420
	"\r\n"
	"`Packet Password` is an optional password that may be added to outbound\r\n"
	"packets for this node.  Incoming packets from this node must also have\r\n"
	"the same password value if this password is configured (not blank).\r\n"
	"Packet passwords are case insensitive.\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
421
	"`AreaFix Password` is an optional password used to enable AreaFix\r\n"
rswindell's avatar
rswindell committed
422
	"NetMail requests from this node.\r\n"
rswindell's avatar
rswindell committed
423
	"AreaFix Passwords are case insensitive.\r\n"
rswindell's avatar
rswindell committed
424
425
	"This setting may be managed by the node using NetMail/AreaFix requests.\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
426
427
	"`AreaFix Keys` is a list of keys which enable AreaFix access to one or\r\n"
	"more Additional EchoLists.\r\n"
rswindell's avatar
rswindell committed
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
	"\r\n"
	"`Status` is the default mode for sending mail to this node: `Normal`, `Hold`\r\n"
	"(wait for pickup) or `Crash` (immediate).\r\n"
	"\r\n"
	"`Direct` determines whether to connect to this node directly (whenever\r\n"
	"possible) when sending mail to this node.\r\n"
	"\r\n"
	"`Passive` is used to temporarily disable the packing and sending of\r\n"
	"EchoMail for a node.  The opposite of Passive is `Active`.\r\n"
	"This setting may be managed by the node using NetMail/AreaFix requests.\r\n"
	"\r\n"
	"`Send Notify List` is used to flag nodes that you want notified via\r\n"
	"NetMail of their current AreaFix settings whenever SBBSecho is run\r\n"
	"with the '`G`' option.\r\n"
	"\r\n"
	"`Route To` is only used in Binkley-Style Outbound (BSO/FLO) operating\r\n"
	"mode and is used to set the FidoNet address to route mail for this node.\r\n"
	"\r\n"
	"`Inbox Directory` is only used in BSO operating mode and is an optional\r\n"
	"alternate directory to search for incoming files from this node (e.g.\r\n"
	"used in combination with BinkD's ibox setting).\r\n"
	"\r\n"
	"`Outbox Directory` is only used in BSO operating mode and is an optional\r\n"
	"alternate directory to place outbound files for this node (e.g. used\r\n"
	"in combination with BinkD's obox setting).\r\n"
	;
454
						j=0;
rswindell's avatar
rswindell committed
455
456
457
458
459
460
461
462
463
464
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Address"
							,faddrtoa(&cfg.nodecfg[i].addr));
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Comment"
							,cfg.nodecfg[i].comment);
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Archive Type"
							,cfg.nodecfg[i].archive ==  SBBSECHO_ARCHIVE_NONE ?
							"None":cfg.nodecfg[i].archive->name);
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Packet Type"
							,pktTypeStringList[cfg.nodecfg[i].pkt_type]);
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Packet Password"
465
							,cfg.nodecfg[i].pktpwd);
rswindell's avatar
rswindell committed
466
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","AreaFix Password"
467
							,cfg.nodecfg[i].password);
rswindell's avatar
rswindell committed
468
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","AreaFix Keys"
rswindell's avatar
rswindell committed
469
470
471
472
473
474
475
476
477
478
479
							,strListCombine(cfg.nodecfg[i].keys,str,sizeof(str),","));
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Status"
							,mailStatusStringList[cfg.nodecfg[i].status]);
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Direct"
							,cfg.nodecfg[i].direct ? "Yes":"No");
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Passive"
							,cfg.nodecfg[i].passive ? "Yes":"No");
						snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Send Notify List"
							,cfg.nodecfg[i].send_notify ? "Yes" : "No");
						if(cfg.flo_mailer) {
							snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s","Route To"
480
								,cfg.nodecfg[i].route.zone
rswindell's avatar
rswindell committed
481
								? faddrtoa(&cfg.nodecfg[i].route) : "Disabled");
482
483
484
485
							if(!faddr_contains_wildcard(&cfg.nodecfg[i].addr)) {
								snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s", "Inbox Directory", cfg.nodecfg[i].inbox);
								snprintf(opt[j++],MAX_OPLN-1,"%-30.30s %s", "Outbox Directory", cfg.nodecfg[i].outbox);
							}
rswindell's avatar
rswindell committed
486
						}
487
						opt[j][0]=0;
rswindell's avatar
rswindell committed
488
489
490
						SAFEPRINTF(str, "Linked Node - %s"
							,cfg.nodecfg[i].comment[0] ? cfg.nodecfg[i].comment : faddrtoa(&cfg.nodecfg[i].addr));
						k=uifc.list(WIN_MID|WIN_ACT|WIN_SAV,0,0,60,&nodeop,0,str,opt);
491
492
493
494
495
						if(k==-1)
							break;
						switch(k) {
							case 0:
	uifc.helpbuf=
496
	"~ Address ~\r\n\r\n"
rswindell's avatar
rswindell committed
497
498
499
	"This is the FidoNet style address of this linked node.\r\n";
								strcpy(str,faddrtoa(&cfg.nodecfg[i].addr));
								if(uifc.input(WIN_MID|WIN_SAV,0,0
500
									,"Node Address (ALL wildcard allowed)",str
rswindell's avatar
rswindell committed
501
502
									,25,K_EDIT|K_UPPER)>0)
									cfg.nodecfg[i].addr=atofaddr(str);
503
504
505
								break;
							case 1:
	uifc.helpbuf=
rswindell's avatar
rswindell committed
506
	"~ Comment ~\r\n\r\n"
507
	"This is an optional comment for the node (e.g. the sysop's name).\r\n"
rswindell's avatar
rswindell committed
508
509
510
511
512
513
514
515
	"This is used for informational purposes only.\r\n";
								uifc.input(WIN_MID|WIN_SAV,0,0
									,"Comment"
									,cfg.nodecfg[i].comment,sizeof(cfg.nodecfg[i].comment)-1
									,K_EDIT);
								break;
							case 2:
	uifc.helpbuf=
516
	"~ Archive Type ~\r\n\r\n"
rswindell's avatar
rswindell committed
517
518
519
520
521
522
	"This is the archive type that will be used for compressing packets\r\n"
	"into archive bundles for this node.\r\n";
								int cur=cfg.arcdefs;
								for(u=0;u<cfg.arcdefs;u++) {
									if(cfg.nodecfg[i].archive == &cfg.arcdef[u])
										cur=u;
523
									strcpy(opt[u],cfg.arcdef[u].name);
rswindell's avatar
rswindell committed
524
								}
525
526
								strcpy(opt[u++],"None");
								opt[u][0]=0;
rswindell's avatar
rswindell committed
527
								k=uifc.list(WIN_RHT|WIN_SAV,0,0,0,&cur,0
528
529
530
									,"Archive Type",opt);
								if(k==-1)
									break;
531
								if((unsigned)k>=cfg.arcdefs)
rswindell's avatar
rswindell committed
532
									cfg.nodecfg[i].archive = SBBSECHO_ARCHIVE_NONE;
533
								else
rswindell's avatar
rswindell committed
534
535
									cfg.nodecfg[i].archive = &cfg.arcdef[k];
								uifc.changes=TRUE;
536
								break;
rswindell's avatar
rswindell committed
537
							case 3:
538
	uifc.helpbuf=
539
	"~ Packet Type ~\r\n\r\n"
rswindell's avatar
rswindell committed
540
	"This is the packet header type that will be used in mail packets\r\n"
rswindell's avatar
rswindell committed
541
542
543
544
545
546
547
	"created for this node.  SBBSecho defaults to creating `Type-2+` packets.\r\n"
	"\r\n"
	"`Type-2  ` packets are defined in FTS-0001.16 (Stone Age)\r\n"
	"`Type-2e ` packets are defined in FSC-0039.04 (Sometimes called 2+)\r\n"
	"`Type-2+ ` packets are defined in FSC-0048.02 (4D address support)\r\n"
	"`Type-2.2` packets are defined in FSC-0045.01 (5D address support)\r\n"
	;
548
549
								j=cfg.nodecfg[i].pkt_type;
								k=uifc.list(WIN_RHT|WIN_SAV,0,0,0,&j,0,"Packet Type"
rswindell's avatar
rswindell committed
550
									,pktTypeStringList);
551
552
553
								if(k==-1)
									break;
								cfg.nodecfg[i].pkt_type=k;
rswindell's avatar
rswindell committed
554
								uifc.changes=TRUE;
555
								break;
rswindell's avatar
rswindell committed
556
							case 4:
557
	uifc.helpbuf=
558
	"~ Packet Password ~\r\n\r\n"
559
560
561
562
	"This is an optional password that SBBSecho will place into packets\r\n"
	"destined for this node.\r\n";
								uifc.input(WIN_MID|WIN_SAV,0,0
									,"Packet Password (optional)"
rswindell's avatar
rswindell committed
563
564
									,cfg.nodecfg[i].pktpwd,sizeof(cfg.nodecfg[i].pktpwd)-1
									,K_EDIT|K_UPPER);
565
								break;
rswindell's avatar
rswindell committed
566
							case 5:
567
	uifc.helpbuf=
rswindell's avatar
rswindell committed
568
	"~ AreaFix Password ~\r\n\r\n"
569
	"This is the password that will be used by this node when doing remote\r\n"
rswindell's avatar
rswindell committed
570
	"AreaManager / AreaFix functions.\r\n";
571
								uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
572
									,"AreaFix Password"
rswindell's avatar
rswindell committed
573
574
									,cfg.nodecfg[i].password,sizeof(cfg.nodecfg[i].password)-1
									,K_EDIT|K_UPPER);
575
								break;
rswindell's avatar
rswindell committed
576
							case 6:
577
	uifc.helpbuf=
rswindell's avatar
rswindell committed
578
	"~ AreaFix Keys ~\r\n\r\n"
rswindell's avatar
rswindell committed
579
580
	"These are a named-keys to be given to this node allowing access to one or\r\n"
	"more of the configured `Additional Echolists`\r\n";
581
								while(1) {
rswindell's avatar
rswindell committed
582
583
									for(j=0; cfg.nodecfg[i].keys!=NULL && cfg.nodecfg[i].keys[j]!=NULL ;j++)
										strcpy(opt[j],cfg.nodecfg[i].keys[j]);
584
585
586
									opt[j][0]=0;
									k=uifc.list(WIN_SAV|WIN_INS|WIN_DEL|WIN_ACT|
										WIN_XTR|WIN_INSACT|WIN_DELACT|WIN_RHT
rswindell's avatar
rswindell committed
587
										,0,0,0,&k,0,"AreaFix Keys",opt);
588
589
590
591
592
									if(k==-1)
										break;
									if((k&MSK_ON)==MSK_INS) {
										k&=MSK_OFF;
										if(uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
593
											,"AreaFix Keys",str,SBBSECHO_MAX_KEY_LEN
rswindell's avatar
rswindell committed
594
											,K_UPPER)<1)
595
											continue;
rswindell's avatar
rswindell committed
596
597
										strListInsert(&cfg.nodecfg[i].keys, str, k);
										uifc.changes=TRUE;
598
599
										continue; 
									}
600
601
602

									if((k&MSK_ON)==MSK_DEL) {
										k&=MSK_OFF;
rswindell's avatar
rswindell committed
603
604
										strListRemove(&cfg.nodecfg[i].keys, k);
										uifc.changes=TRUE;
605
606
										continue; 
									}
rswindell's avatar
rswindell committed
607
									SAFECOPY(str,cfg.nodecfg[i].keys[k]);
rswindell's avatar
rswindell committed
608
									uifc.input(WIN_MID|WIN_SAV,0,0,"AreaFix Key"
rswindell's avatar
rswindell committed
609
610
611
										,str,SBBSECHO_MAX_KEY_LEN,K_EDIT|K_UPPER);
									strListReplace(cfg.nodecfg[i].keys, k, str);
									uifc.changes=TRUE;
612
613
									continue; 
								}
614
615
								break;
							case 7:
rswindell's avatar
rswindell committed
616
617
618
619
620
621
622
623
624
625
626
627
	uifc.helpbuf=
	"~ Mail Status ~\r\n\r\n"
	"Set the mail status for this node: `Normal`, `Hold`, or `Crash`.\r\n";
								j=cfg.nodecfg[i].status;
								k=uifc.list(WIN_RHT|WIN_SAV,0,0,0,&j,0,"Mail Status"
									,mailStatusStringList);
								if(k==-1)
									break;
								if(cfg.nodecfg[i].status!=k) {
									cfg.nodecfg[i].status=k;
									uifc.changes=TRUE;
								}
628
629
								break;
							case 8:
rswindell's avatar
rswindell committed
630
631
632
633
634
635
								k = !cfg.nodecfg[i].direct;
								switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
									,"Direct Delivery",uifcYesNoOpts)) {
									case 0:	cfg.nodecfg[i].direct = true;	uifc.changes=TRUE; break;
									case 1:	cfg.nodecfg[i].direct = false;	uifc.changes=TRUE; break;
								}
636
637
								break;
							case 9:
rswindell's avatar
rswindell committed
638
639
640
641
642
643
								k = !cfg.nodecfg[i].passive;
								switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
									,"Passive Node",uifcYesNoOpts)) {
									case 0:	cfg.nodecfg[i].passive = true;	uifc.changes=TRUE; break;
									case 1:	cfg.nodecfg[i].passive = false;	uifc.changes=TRUE; break;
								}
644
645
								break;
							case 10:
rswindell's avatar
rswindell committed
646
647
648
649
650
651
652
653
								k = !cfg.nodecfg[i].send_notify;
								switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
									,"Send AreaFix Notifications",uifcYesNoOpts)) {
									case 0:	cfg.nodecfg[i].send_notify = true;	uifc.changes=TRUE; break;
									case 1:	cfg.nodecfg[i].send_notify = false;	uifc.changes=TRUE; break;
								}
								break;
							case 11:
654
	uifc.helpbuf=
655
	"~ Route To ~\r\n\r\n"
rswindell's avatar
rswindell committed
656
657
	"When using a BSO/FLO type mailer, this is the Fido address to route mail\r\n"
	"for this node(s) to.\r\n"
658
659
660
	"\r\n"
	"This option is normally only used with wildcard type node entries\r\n"
	"(e.g. `ALL`, or `1:ALL`, `2:ALL`, etc.) and is used to route non-direct\r\n"
rswindell's avatar
rswindell committed
661
662
663
	"NetMail packets to your uplink node (hub).\r\n";
								strcpy(str,faddrtoa(&cfg.nodecfg[i].route));
								if(uifc.input(WIN_MID|WIN_SAV,0,0
664
									,"Node Address to Route To",str
rswindell's avatar
rswindell committed
665
									,25,K_EDIT) >= 0) {
666
667
									if(str[0])
										cfg.nodecfg[i].route=atofaddr(str);
668
669
									else
										cfg.nodecfg[i].route.zone=0;
rswindell's avatar
rswindell committed
670
671
672
673
674
675
676
677
678
679
680
681
									uifc.changes=TRUE;
								}
								break;
							case 12:
								uifc.input(WIN_MID|WIN_SAV,0,0,"Inbound FileBox Directory"
									,cfg.nodecfg[i].inbox, sizeof(cfg.nodecfg[i].inbox)-1
									,K_EDIT);
								break;
							case 13:
								uifc.input(WIN_MID|WIN_SAV,0,0,"Outbound FileBox Directory"
									,cfg.nodecfg[i].outbox, sizeof(cfg.nodecfg[i].outbox)-1
									,K_EDIT);
682
								break;
683
684
685
						} 
					} 
				}
686
687
				break;

rswindell's avatar
rswindell committed
688
			case 6:	/* Paths and Filenames... */
689
				j=0;
690
				while(1) {
691
					i=0;
692
					snprintf(opt[i++],MAX_OPLN-1,"%-30.30s %s","Non-secure Inbound Directory"
rswindell's avatar
rswindell committed
693
694
695
696
						,cfg.inbound);
					snprintf(opt[i++],MAX_OPLN-1,"%-30.30s %s","Secure Inbound Directory"
						,cfg.secure_inbound[0] ? cfg.secure_inbound : "<None>");
					snprintf(opt[i++],MAX_OPLN-1,"%-30.30s %s","Outbound Directory"
697
						,cfg.outbound);
rswindell's avatar
rswindell committed
698
699
					snprintf(opt[i++],MAX_OPLN-1,"%-30.30s %s","Area File"
						,cfg.areafile);
rswindell's avatar
rswindell committed
700
701
					snprintf(opt[i++],MAX_OPLN-1,"%-30.30s %s","Bad Area File"
						,cfg.badareafile);
rswindell's avatar
rswindell committed
702
					snprintf(opt[i++],MAX_OPLN-1,"%-30.30s %s","Log File"
703
704
						,cfg.logfile[0] ? cfg.logfile
						: "SCFG->data/sbbsecho.log");
705
706
707
					snprintf(opt[i++],MAX_OPLN-1,"%-30.30s %s","Temporary File Directory"
						,cfg.temp_dir[0] ? cfg.temp_dir
						: "../temp/sbbsecho");
rswindell's avatar
rswindell committed
708
					opt[i][0]=0;
709
					uifc.helpbuf=
rswindell's avatar
rswindell committed
710
						"~ Paths and Filenames ~\r\n\r\n"
711
						"From this menu you can configure the paths that SBBSecho will use\r\n"
rswindell's avatar
rswindell committed
712
						"when importing, exporting and logging.\r\n";
713
714
715
					j=uifc.list(WIN_MID|WIN_ACT,0,0,60,&j,0
						,"Paths and Filenames",opt);
					if(j==-1)
716
						break;
717
					switch(j) {
718
						case 0:
719
	uifc.helpbuf=
720
	"~ Non-secure Inbound Directory ~\r\n\r\n"
rswindell's avatar
rswindell committed
721
722
723
724
	"This is the path where your FTN mailer stores, and where SBBSecho will\r\n"
	"look for, incoming files (potentially including message bundles and\r\n"
	"packets) from unauthenticated (non-secure) mailer sessions."
	;
725
							uifc.input(WIN_MID|WIN_SAV,0,0,"Non-secure Inbound Directory"
rswindell's avatar
rswindell committed
726
727
								,cfg.inbound,sizeof(cfg.inbound)-1
								,K_EDIT);
728
							break;
729

730
						case 1:
731
	uifc.helpbuf=
732
	"~ Secure Inbound Directory ~\r\n\r\n"
rswindell's avatar
rswindell committed
733
734
735
	"This is the path where your FTN mailer stores, and where SBBSecho will\r\n"
	"look for, incoming message bundles and packets for `Secure` (password\r\n"
	"protected) sessions.";
rswindell's avatar
rswindell committed
736
737
738
							uifc.input(WIN_MID|WIN_SAV,0,0,"Secure Inbound Directory"
								,cfg.secure_inbound,sizeof(cfg.secure_inbound)-1
								,K_EDIT);
739
							break;
740

741
						case 2:
742
	uifc.helpbuf=
743
	"~ Outbound Directory ~\r\n\r\n"
rswindell's avatar
rswindell committed
744
745
	"This is the path where your FTN mailer will look for, and where SBBSecho\r\n"
	"will place, outgoing message bundles and packets.\r\n"
rswindell's avatar
rswindell committed
746
	"\r\n"
rswindell's avatar
rswindell committed
747
	"In Binkley-Style Outbound mode, this serves as the base directory\r\n"
rswindell's avatar
rswindell committed
748
749
750
751
752
	"name for special foreign zone and point destination nodes as well."
	;
							uifc.input(WIN_MID|WIN_SAV,0,0,"Outbound Directory"
								,cfg.outbound,sizeof(cfg.outbound)-1
								,K_EDIT);
753
							break;
754

755
						case 3:
756
	uifc.helpbuf=
757
	"~ Area File ~\r\n\r\n"
rswindell's avatar
rswindell committed
758
759
760
761
762
763
764
765
766
767
768
769
770
	"This is the path of the file SBBSecho will use as your primary\r\n"
	"list of FidoNet-style message areas (default is `data/areas.bbs`).\r\n"
	"\r\n"
	"Each line in the file defines an FTN message area (echo) of the format:\r\n"
	"\r\n"
	"   <`code`> <`tag`> [[`link`] [`link`] [...]]\r\n"
	"\r\n"
	"Each field is separated by one or more white-space characters:\r\n"
	"\r\n"
	"   `<code>` is the Synchronet `internal code` for the local sub-board\r\n"
	"   `<tag>`  is the network's agreed-upon `echo tag` for the message area\r\n"
	"   `[link]` is an `FTN address` to send and receive messages for this area\r\n"
	"          (there may be many linked nodes for each area)\r\n"
771
772
773
774
775
	"          (often your FTN hub may be the only linked node)\r\n"
	"\r\n"
	"Example Area Line:\r\n"
	"\r\n"
	"   `FIDO_BBS_CARN    BBS_CARNIVAL                        1:218/700`\r\n"
rswindell's avatar
rswindell committed
776
777
778
	"\r\n"
	"Notes:\r\n"
	"\r\n"
779
780
781
782
783
784
785
786
787
	" `*` Only the `<code>` and `<tag>` fields are required\r\n"
	" `*` The `<code>` and `<tag>` fields are case in-sensitive\r\n"
	" `*` The `[link]` fields must be 2D, 3D, or 4D FidoNet-style node addresses\r\n"
	" `*` The '`<`' and '`>`', '`[`' and '`]`' characters are not part of the syntax\r\n"
	" `*` Lines beginning with a semicolon (`;`) are ignored (i.e. comments)\r\n"
	" `*` Leading white-space characters are ignored\r\n"
	" `*` Blank lines are ignored\r\n"
	" `*` This file may be import/exported to/from your `Message Areas` in `SCFG`\r\n"
	" `*` This file may be remotely modified by authorized nodes using `AreaFix`\r\n"
rswindell's avatar
rswindell committed
788
	;
rswindell's avatar
rswindell committed
789
790
791
							uifc.input(WIN_MID|WIN_SAV,0,0,"Area File"
								,cfg.areafile,sizeof(cfg.areafile)-1
								,K_EDIT);
792
							break;
793

794
						case 4:
795
	uifc.helpbuf=
rswindell's avatar
rswindell committed
796
797
798
	"~ Bad Area File ~\r\n\r\n"
	"This is the path of the file SBBSecho will use to record the names\r\n"
	"(echo tags) and descriptions of FTN message areas (echoes) that your\r\n"
799
800
801
802
	"system has received EchoMail for, but does not carry locally. The\r\n"
	"default path/filename is `data/badareas.lst`.\r\n"
	"\r\n"
	"Notes:\r\n"
rswindell's avatar
rswindell committed
803
	"\r\n"
804
805
806
	" `*` The descriptions of the areas will only be included if the\r\n"
	"   corresponding echo tags can be located in one of your configured\r\n"
	"   `Additional EchoLists`.\r\n"
rswindell's avatar
rswindell committed
807
	"\r\n"
808
809
	" `*` The format of the file is the same as `BACKBONE.NA` and suitable for\r\n"
	"   importing into a Synchronet Message Group using `SCFG`.\r\n"
rswindell's avatar
rswindell committed
810
	"\r\n"
811
812
813
	" `*` SBBSecho will automatically sort and maintain this list, removing\r\n"
	"   areas if they are added to your configuration (`SCFG->Message Areas`\r\n"
	"   and `Area File`).\r\n"
rswindell's avatar
rswindell committed
814
815
816
817
818
819
820
821
	;
							uifc.input(WIN_MID|WIN_SAV,0,0,"Bad Area File"
								,cfg.badareafile,sizeof(cfg.badareafile)-1
								,K_EDIT);
							break;

						case 5:
	uifc.helpbuf=
822
	"~ Log File ~\r\n\r\n"
rswindell's avatar
rswindell committed
823
824
	"This is the path of the file SBBSecho will use to log information each time\r\n"
	"it is run (default is `data/sbbsecho.log`)."
825
	;
rswindell's avatar
rswindell committed
826
827
828
							uifc.input(WIN_MID|WIN_SAV,0,0,"Log File"
								,cfg.logfile,sizeof(cfg.logfile)-1
								,K_EDIT);
829
							break; 
rswindell's avatar
rswindell committed
830
831

						case 6:
832
833
834
835
836
837
838
839
840
841
	uifc.helpbuf=
	"~ Temporary File Directory ~\r\n\r\n"
	"This is the directory where SBBSecho will store temporary files that\r\n"
	"it creates and uses during its run-time.\r\n"
	"(default is `../temp/sbbsecho`)."
	;
							uifc.input(WIN_MID|WIN_SAV,0,0,"Temp Dir"
								,cfg.temp_dir,sizeof(cfg.temp_dir)-1
								,K_EDIT);
							break; 
842
843
					} 
				}
844
				break;
rswindell's avatar
rswindell committed
845

846
			case 4:	/* NetMail Settings */
847
848
				j=0;
				while(1) {
rswindell's avatar
rswindell committed
849
					uifc.helpbuf=
rswindell's avatar
rswindell committed
850
851
	"~ NetMail Settings ~\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
	"`Sysop Aliases` is a comma-separated list of names by which the sysop\r\n"
	"    (user #1) may receive NetMail messages, in addition to the alias\r\n"
	"    and real name associated with their BBS user account.\r\n"
	"    This setting defaults to just '`SYSOP`'.\r\n"
	"\r\n"
    "`Default Recipient` is the name of the user account you wish to receive\r\n"
	"    inbound NetMail messages that have been addressed to an unrecognized\r\n"
	"    user name or alias.\r\n"
	"\r\n"
	"`Fuzzy Zone Operation` when set to `Yes`, if SBBSecho receives an inbound\r\n"
	"    netmail with no international zone information, it will compare the\r\n"
	"    net/node of the destination to the net/node information in your AKAs\r\n"
	"    and assume the zone of a matching AKA.\r\n"
	"    This setting defaults to `No`.\r\n"
	"\r\n"
	"`Kill/Ignore Empty NetMail Messages` will instruct SBBSecho to simply\r\n"
	"    discard (not import or export) NetMail messages without any body.\r\n"
	"    This setting defaults to `Yes`.\r\n"
	"\r\n"
	"`Delete Processed NetMail Messages` will instruct SBBSecho to delete\r\n"
	"    NetMail messages/files after they have been sent or imported.\r\n"
	"    When set to `No`, SBBSecho will mark them as Sent or Received instead.\r\n"
	"    This setting defaults to `Yes`.\r\n"
	"\r\n"
	"`Ignore NetMail Destination Address` will instruct SBBSecho to treat\r\n"
	"    all NetMail as though it is destined for one of your systems's FTN\r\n"
	"    addresses (AKAs) and potentially import it.\r\n"
	"    This setting defaults to `No`.\r\n"
	"\r\n"
881
882
883
884
885
886
	"`Ignore Netmail 'Sent' Attribute` will instruct SBBSecho to export\r\n"
	"    NetMail messages even when their 'Sent' attribute flag is set.\r\n"
	"    This setting `should not` be set to `Yes` when `Delete NetMail` is\r\n"
	"    disabled.\r\n"
	"    This setting defaults to `No`.\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
887
888
889
890
891
892
893
894
895
896
897
898
	"`Ignore Netmail 'Received' Attribute` will instruct SBBSecho to import\r\n"
	"    NetMail messages even when their 'Received' attribute flag is set.\r\n"
	"    This setting defaults to `No`.\r\n"
	"\r\n"
	"`Ignore NetMail 'Local' Attribute` will instruct SBBSecho to import\r\n"
	"    NetMail messages even when their 'Local' attribute flag is set.\r\n"
	"    This setting defaults to `No`.\r\n"
	"\r\n"
	"`Maximum Age of Imported NetMail` allows you to optionally set an age\r\n"
	"    limit (in days) of NetMail messages that may be imported.\r\n"
	"    This setting defaults to `None` (no maximum age).\r\n"
;
899
					i=0;
rswindell's avatar
rswindell committed
900
901
902
903
904
905
906
907
908
909
910
911
					strListCombine(cfg.sysop_alias_list, sysop_aliases, sizeof(sysop_aliases)-1, ",");
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%s", "Sysop Aliases",sysop_aliases);
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%s", "Default Recipient"
						,cfg.default_recipient);
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%-3.3s","Fuzzy Zone Operation"
						,cfg.fuzzy_zone ? "Yes":"No");
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%-3.3s","Kill/Ignore Empty NetMail "
						"Messages",cfg.kill_empty_netmail ? "Yes":"No");
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%-3.3s","Delete Processed NetMail"
						,cfg.delete_netmail ? "Yes":"No");
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%-3.3s","Ignore NetMail Destination Address"
						,cfg.ignore_netmail_dest_addr ? "Yes" : "No");
912
913
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%-3.3s","Ignore NetMail 'Sent' Attribute"
						,cfg.ignore_netmail_sent_attr ? "Yes" : "No");
rswindell's avatar
rswindell committed
914
915
916
917
918
919
920
921
922
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%-3.3s","Ignore NetMail 'Received' Attribute"
						,cfg.ignore_netmail_recv_attr ? "Yes" : "No");
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%-3.3s","Ignore NetMail 'Local' Attribute"
						,cfg.ignore_netmail_local_attr ? "Yes" : "No");
					if(cfg.max_netmail_age)
						sprintf(str,"%1.0f days", cfg.max_netmail_age / (24.0*60.0*60.0));
					else
						strcpy(str, "None");
					snprintf(opt[i++],MAX_OPLN-1,"%-40.40s%s","Maximum Age of Imported NetMail"	, str);
rswindell's avatar
rswindell committed
923
					opt[i][0]=0;
924
					j=uifc.list(WIN_ACT,0,0,60,&j,0,"NetMail Settings",opt);
925
926
927
928
					if(j==-1)
						break;
					switch(j) {
						case 0:
rswindell's avatar
rswindell committed
929
930
931
932
933
934
935
936
937
938
939
940
							uifc.helpbuf=
							"~ Sysop Aliases ~\r\n\r\n"
							"This is a comma-separated list of additional `To` names that the sysop\r\n"
							"(user #1) can receive netmail by. When specifying multiple aliases,\r\n"
							"they must be separated by a single comma and no extra white-space\r\n"
							"(e.g. \"SYSOP,COORDINATOR\"). The default value is just `SYSOP`.\r\n";
							if(uifc.input(WIN_MID|WIN_BOT|WIN_SAV,0,0,"Sysop Aliases (comma separated)"
								,sysop_aliases
								,sizeof(sysop_aliases)-1,K_EDIT|K_UPPER) >= 0) {
								strListFree(&cfg.sysop_alias_list);
								cfg.sysop_alias_list = strListSplit(NULL, sysop_aliases, ",");
							}
941
942
							break;
						case 1:
rswindell's avatar
rswindell committed
943
944
945
							uifc.input(WIN_MID|WIN_SAV,0,0,"Default Recipient"
								,cfg.default_recipient, sizeof(cfg.default_recipient)-1
								,K_EDIT|K_UPPER);
946
947
							break;
						case 2:
rswindell's avatar
rswindell committed
948
949
950
951
952
953
							k = !cfg.fuzzy_zone;
							switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
								,"Fuzzy Zone Operation",uifcYesNoOpts)) {
								case 0:	cfg.fuzzy_zone = true;	break;
								case 1:	cfg.fuzzy_zone = false;	break;
							}
954
955
							break;
						case 3:
rswindell's avatar
rswindell committed
956
957
958
959
960
961
							k = !cfg.kill_empty_netmail;
							switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
								,"Delete Empty NetMail",uifcYesNoOpts)) {
								case 0:	cfg.kill_empty_netmail = true;	break;
								case 1:	cfg.kill_empty_netmail = false;	break;
							}
962
963
							break;
						case 4:
rswindell's avatar
rswindell committed
964
965
966
967
968
969
							k = !cfg.delete_netmail;
							switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
								,"Delete Processed NetMail",uifcYesNoOpts)) {
								case 0:	cfg.delete_netmail = true;	break;
								case 1:	cfg.delete_netmail = false;	break;
							}
970
971
							break;
						case 5:
rswindell's avatar
rswindell committed
972
973
974
975
976
977
							k = !cfg.ignore_netmail_dest_addr;
							switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
								,"Ignore NetMail Destination Address",uifcYesNoOpts)) {
								case 0:	cfg.ignore_netmail_dest_addr = true;	break;
								case 1:	cfg.ignore_netmail_dest_addr = false;	break;
							}
978
979
							break;
						case 6:
980
981
982
983
984
985
986
987
							k = !cfg.ignore_netmail_sent_attr;
							switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
								,"Ignore NetMail 'Sent' Attribute",uifcYesNoOpts)) {
								case 0:	cfg.ignore_netmail_sent_attr = true;	break;
								case 1:	cfg.ignore_netmail_sent_attr = false;	break;
							}
							break;
						case 7:
rswindell's avatar
rswindell committed
988
989
990
991
992
993
							k = !cfg.ignore_netmail_recv_attr;
							switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
								,"Ignore NetMail 'Received' Attribute",uifcYesNoOpts)) {
								case 0:	cfg.ignore_netmail_recv_attr = true;	break;
								case 1:	cfg.ignore_netmail_recv_attr = false;	break;
							}
994
							break;
995
						case 8:
rswindell's avatar
rswindell committed
996
997
998
999
1000
1001
							k = !cfg.ignore_netmail_local_attr;
							switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
								,"Ignore NetMail 'Local' Attribute",uifcYesNoOpts)) {
								case 0:	cfg.ignore_netmail_local_attr = true;	break;
								case 1:	cfg.ignore_netmail_local_attr = false;	break;
							}
1002
							break;
1003
						case 9:
rswindell's avatar
rswindell committed
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
							uifc.helpbuf=
							"~ Maximum Age of Imported NetMail ~\r\n\r\n"
							"Maximum age (in days) of NetMail that may be imported. The age is based\r\n"
							"on the date supplied in the message header and may be incorrect in some\r\n"
							"conditions (e.g. erroneous software or incorrect system date).\r\n"
							"Set this value to `0` to disable this feature (no maximum age imposed)."
							;
							if(cfg.max_netmail_age)
								sprintf(str,"%1.0f", cfg.max_netmail_age / (24.0*60.0*60.0));
							else
								strcpy(str, "None");
							if(uifc.input(WIN_MID|WIN_BOT|WIN_SAV,0,0,"Maximum NetMail Age (in Days)"
								,str, 5, K_EDIT) >= 0)
								cfg.max_netmail_age = (long) (strtod(str, NULL) * (24.0*60.0*60.0));
1018
							break;
rswindell's avatar
rswindell committed
1019

1020
1021
					} 
				}
1022
				break;
1023

1024
			case 5:	/* EchoMail Settings */
rswindell's avatar
rswindell committed
1025
1026
1027
				j=0;
				while(1) {
					uifc.helpbuf=
rswindell's avatar
rswindell committed
1028
1029
	"~ EchoMail Settings ~\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
1030
1031
	"`Area Manager` is the BBS user name or alias to notify (via email) of\r\n"
	"    AreaFix activities and errors.  This setting defaults to `SYSOP`.\r\n"
1032
	"\r\n"
rswindell's avatar
rswindell committed
1033
1034
1035
	"`Maximum Packet Size` is the largest packet file size that SBBSecho will\r\n"
	"    normally create (in bytes).\r\n"
	"    This settings defaults to `250K` (250 Kilobytes, or 256,000 bytes).\r\n"
1036
	"\r\n"
rswindell's avatar
rswindell committed
1037
1038
1039
1040
	"`Maximum Bundle Size` is the largest bundle file size that SBBSecho will\r\n"
	"    normally create (in bytes).\r\n"
	"    This settings defaults to `250K` (250 Kilobytes, or 256,000 bytes).\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
1041
	"`Secure Operation` tells SBBSecho to check the Area File (e.g. areas.bbs)\r\n"
rswindell's avatar
rswindell committed
1042
1043
1044
	"    to insure that the packet origin (FTN address) of EchoMail messages\r\n"
	"    is already linked to the EchoMail area where the message was posted.\r\n"
	"    This setting defaults to `No`.\r\n"
1045
	"\r\n"
1046
1047
1048
1049
1050
	"`Notify Users of Received EchoMail` tells SBBSecho to send telegrams\r\n"
	"    (short messages) to BBS users when EchoMail addressed to their name\r\n"
	"    or alias has been imported into a message base that the user has\r\n"
	"    access to read.\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
1051
1052
1053
	"`Convert Existing Tear Lines` tells SBBSecho to convert any tear lines\r\n"
	"    (`---`) existing in the message text to `===`.\r\n"
	"    This setting defaults to `No`.\r\n"
1054
	"\r\n"
rswindell's avatar
rswindell committed
1055
	"`Allow Nodes to Add Areas from Area File` when set to `Yes` allows linked\r\n"
rswindell's avatar
rswindell committed
1056
	"    nodes to add areas listed in your Area File (e.g. `areas.bbs`).\r\n"
rswindell's avatar
rswindell committed
1057
	"    This setting defaults to `Yes`.\r\n"
1058
1059
1060
1061
	"\r\n"
	"`Strip Line Feeds From Outgoing Messages` when set to `Yes` instructs\r\n"
	"    SBBSecho to remove any line-feed (ASCII 10) characters from the body\r\n"
	"    text of messages being exported to FidoNet EchoMail.\r\n"
rswindell's avatar
rswindell committed
1062
	"    This setting defaults to `No`.\r\n"
1063
1064
1065
1066
1067
1068
	"\r\n"
	"`Circular Path Detection` when `Enabled` will cause SBBSecho, during\r\n"
	"    EchoMail import, to check the PATH kludge lines for any of the\r\n"
	"    system's AKAs and if found (indicating a message loop), not import\r\n"
	"    the message.\r\n"
	"\r\n"
rswindell's avatar
rswindell committed
1069
1070
	"`Outbound Bundle Attachments` may be either `Deleted` (killed) or `Truncated`\r\n"
	"    (changed to 0-bytes in length) after being sent by your mailer.\r\n"
1071
1072
1073
1074
1075
	"\r\n"
	"`Zone Blind SEEN-BY and PATH Lines` when `Enabled` will cause SBBSecho\r\n"
	"    to assume that node numbers are not duplicated across zones and\r\n"
	"    that a net/node combination in either of these Kludge lines should\r\n"
	"    be used to identify a specific node regardless of which zone that\r\n"
rswindell's avatar
rswindell committed
1076
1077
1078
1079
1080
1081
1082
	"    node is located (thus breaking the rules of FidoNet 3D addressing).\r\n"
	"\r\n"
	"`Maximum Age of Imported EchoMail` allows you to optionally set an age\r\n"
	"    limit (in days) of EchoMail messages that may be imported.\r\n"
	"    This setting defaults to `60` (60 days).\r\n"
	;

1083
					i=0;
rswindell's avatar
rswindell committed
1084
1085
1086
1087
1088
1089
1090
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%s", "Area Manager",cfg.areamgr);
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%luK","Maximum Packet Size"
						,cfg.maxpktsize/1024UL);
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%luK","Maximum Bundle Size"
						,cfg.maxbdlsize/1024UL);
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%-3.3s","Secure Operation"
						,cfg.secure_echomail ? "Yes":"No");
1091
1092
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%-3.3s","Notify Users of Received EchoMail"
						,cfg.echomail_notify ? "Yes":"No");
rswindell's avatar
rswindell committed
1093
1094
1095
1096
1097
1098
1099
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%-3.3s","Convert Existing Tear Lines"
						,cfg.convert_tear ? "Yes":"No");
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%-3.3s","Allow Nodes to Add Areas "
						"from Area File",cfg.add_from_echolists_only ?"No":"Yes");
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%-3.3s","Strip Line Feeds "
						"from Outgoing Messages",cfg.strip_lf ? "Yes":"No");
					snprintf(opt[i++],MAX_OPLN-1,"%-45.45s%s","Circular Path Detection"
1100
						,cfg.check_path ? "Enabled" : "Disabled");
rswindell's avatar
rswindell committed
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110