From dafbba34f5352e8674b3c8977b7d1e07d9d62b90 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 22 Nov 2012 04:55:16 +0000
Subject: [PATCH] Feature for access_d: sysop netmail alias ("SYSOP") is now
 configurable with the "SYSOP_ALIAS" keyword in the sbbsecho.cfg file. e.g.
 can be set to "Net Coordinator" with the line "SYSOP_ALIAS Net Coordinator".
 The default value is "SYSOP" (case insensitive).

---
 src/sbbs3/echocfg.c  | 3 ++-
 src/sbbs3/rechocfg.c | 5 +++++
 src/sbbs3/sbbsecho.c | 2 +-
 src/sbbs3/sbbsecho.h | 3 ++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/echocfg.c b/src/sbbs3/echocfg.c
index 3ca270a06e..b1c7e0383e 100644
--- a/src/sbbs3/echocfg.c
+++ b/src/sbbs3/echocfg.c
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2012 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This program is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU General Public License				*
@@ -1180,6 +1180,7 @@ int main(int argc, char **argv)
 				if(misc&TRUNC_BUNDLES)
 					fprintf(stream,"TRUNC_BUNDLES\n");
 
+				fprintf(stream,"SYSOP_ALIAS %s\n", cfg.sysop_alias);
 				if(cfg.areafile[0])
 					fprintf(stream,"AREAFILE %s\n",cfg.areafile);
 				if(cfg.logfile[0])
diff --git a/src/sbbs3/rechocfg.c b/src/sbbs3/rechocfg.c
index 524686470e..8882b1a971 100644
--- a/src/sbbs3/rechocfg.c
+++ b/src/sbbs3/rechocfg.c
@@ -200,6 +200,7 @@ void read_echo_cfg()
 	cfg.log=LOG_DEFAULTS;
 	cfg.log_level=LOG_INFO;
 	cfg.check_path=TRUE;
+	SAFECOPY(cfg.sysop_alias,"SYSOP");
 
 	while(1) {
 		if(!fgets(str,256,stream))
@@ -219,6 +220,10 @@ void read_echo_cfg()
 		SKIPCODE(p);                       /* Skip code */
 		SKIPCTRLSP(p);                /* Skip white space */
 
+		if(!stricmp(tmp,"SYSOP_ALIAS")) {
+			SAFECOPY(cfg.sysop_alias, p);
+			continue;
+		}
 		if(!stricmp(tmp,"PACKER")) {             /* Archive Definition */
 			if((cfg.arcdef=(arcdef_t *)realloc(cfg.arcdef
 				,sizeof(arcdef_t)*(cfg.arcdefs+1)))==NULL) {
diff --git a/src/sbbs3/sbbsecho.c b/src/sbbs3/sbbsecho.c
index 7fe96964ba..aca15b0643 100644
--- a/src/sbbs3/sbbsecho.c
+++ b/src/sbbs3/sbbsecho.c
@@ -3461,7 +3461,7 @@ int import_netmail(char *path,fmsghdr_t hdr, FILE *fidomsg)
 	}
 
 	usernumber=atoi(hdr.to);
-	if(!stricmp(hdr.to,"SYSOP"))  /* NetMail to "sysop" goes to #1 */
+	if(cfg.sysop_alias[0] && stricmp(hdr.to,cfg.sysop_alias)==0)  /* NetMail to configured SYSOP_ALIAS goes to user #1 */
 		usernumber=1;
 	if(!usernumber && match<scfg.total_faddrs)
 		usernumber=matchname(hdr.to);
diff --git a/src/sbbs3/sbbsecho.h b/src/sbbs3/sbbsecho.h
index 3131772891..62f433b5ba 100644
--- a/src/sbbs3/sbbsecho.h
+++ b/src/sbbs3/sbbsecho.h
@@ -221,7 +221,8 @@ typedef struct {
 			   ,outbound[82]		/* Outbound directory */
 			   ,areafile[128]		/* AREAS.BBS path/filename */
 			   ,logfile[128]		/* LOG path/filename */
-			   ,cfgfile[128];		/* Configuration path/filename */
+			   ,cfgfile[128]		/* Configuration path/filename */
+			   ,sysop_alias[FIDO_NAME_LEN];
 	ulong		maxpktsize			/* Maximum size for packets */
 			   ,maxbdlsize			/* Maximum size for bundles */
 			   ,log					/* What do we log? */
-- 
GitLab