Migrated more to the new config system
authorArt Cancro <ajc@uncensored.citadel.org>
Mon, 4 May 2015 14:57:53 +0000 (10:57 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Mon, 4 May 2015 14:57:53 +0000 (10:57 -0400)
citadel/modules/network/serv_netmail.c
citadel/modules/network/serv_netspool.c

index c4038869f7613a414fad4ab8de92bbfd62cf41bc..30b92b7203c89e4e6d7b84eb726fb8754551cade 100644 (file)
@@ -2,7 +2,7 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2012 by the citadel.org team
+ * Copyright (c) 2000-2015 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License, version 3.
@@ -218,7 +218,7 @@ void network_deliver_digest(SpoolControl *sc)
 
        /* Where do we want bounces and other noise to be heard?
         * Surely not the list members! */
-       snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", config.c_fqdn);
+       snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", CtdlGetConfigStr("c_fqdn"));
 
        /* Now submit the message */
        valid = validate_recipients(ChrPtr(sc->Users[digestrecp]), NULL, 0);
@@ -366,7 +366,7 @@ void network_deliver_list(struct CtdlMessage *msg, SpoolControl *sc, const char
 
        /* Where do we want bounces and other noise to be heard?
         *  Surely not the list members! */
-       snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", config.c_fqdn);
+       snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", CtdlGetConfigStr("c_fqdn"));
 
        /* Now submit the message */
        valid = validate_recipients(ChrPtr(sc->Users[listrecp]), NULL, 0);
@@ -403,8 +403,8 @@ void network_process_participate(SpoolControl *sc, struct CtdlMessage *omsg, lon
         */
        ok_to_participate = 0;
        if (!CM_IsEmpty(msg, eNodeName)) {
-               if (!strcasecmp(msg->cm_fields[eNodeName],
-                               config.c_nodename)) {
+               if (!strcasecmp(msg->cm_fields[eNodeName], CtdlGetConfigStr("c_nodename")))
+               {
                        ok_to_participate = 1;
                }
                
index 86cffbdef50e0613d3d8319c337fedb7858ce8a0..9698c3694f1f3aceb4f3100459a539505601f4f5 100644 (file)
@@ -2,15 +2,15 @@
  * This module handles shared rooms, inter-Citadel mail, and outbound
  * mailing list processing.
  *
- * Copyright (c) 2000-2012 by the citadel.org team
+ * Copyright (c) 2000-2015 by the citadel.org team
  *
- *  This program is open source software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License, version 3.
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 3.
  *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
  * ** NOTE **   A word on the S_NETCONFIGS semaphore:
  * This is a fairly high-level type of critical section.  It ensures that no
@@ -168,10 +168,10 @@ void Netmap_AddMe(struct CtdlMessage *msg, const char *defl, long defllen)
        if (CM_IsEmpty(msg, eMessagePath)) {
                CM_SetField(msg, eMessagePath, defl, defllen);
        }
-       node_len = strlen(config.c_nodename);
+       node_len = strlen(CtdlGetConfigStr("c_nodename"));
        if (node_len >= SIZ) 
                node_len = SIZ - 1;
-       memcpy(buf, config.c_nodename, node_len);
+       memcpy(buf, CtdlGetConfigStr("c_nodename"), node_len);
        buf[node_len] = '!';
        buf[node_len + 1] = '\0';
        CM_PrependToField(msg, eMessagePath, buf, node_len + 1);
@@ -307,7 +307,7 @@ void CalcListID(SpoolControl *sc)
                StrBufAppendBufPlain(sc->ListID, HKEY("room_"), 0);
                StrBufAppendBuf(sc->ListID, RoomName, 0);
                StrBufAppendBufPlain(sc->ListID, HKEY("."), 0);
-               StrBufAppendBufPlain(sc->ListID, config.c_fqdn, -1, 0);
+               StrBufAppendBufPlain(sc->ListID, CtdlGetConfigStr("c_fqdn"), -1, 0);
                /*
                 * this used to be:
                 * roomname <Room-Number.list-id.fqdn>
@@ -325,7 +325,7 @@ void CalcListID(SpoolControl *sc)
                StrBufAppendBufPlain(sc->Users[roommailalias], HKEY("room_"), 0);
                StrBufAppendBuf(sc->Users[roommailalias], RoomName, 0);
                StrBufAppendBufPlain(sc->Users[roommailalias], HKEY("@"), 0);
-               StrBufAppendBufPlain(sc->Users[roommailalias], config.c_fqdn, -1, 0);
+               StrBufAppendBufPlain(sc->Users[roommailalias], CtdlGetConfigStr("c_fqdn"), -1, 0);
 
                StrBufLowerCase(sc->Users[roommailalias]);
        }
@@ -374,8 +374,7 @@ void network_spoolout_room(SpoolControl *sc)
        }
        else
        {
-               snprintf(buf, sizeof buf, "room_%s@%s",
-                        CCC->room.QRname, config.c_fqdn);
+               snprintf(buf, sizeof buf, "room_%s@%s", CCC->room.QRname, CtdlGetConfigStr("c_fqdn"));
        }
 
        for (i=0; buf[i]; ++i) {
@@ -485,7 +484,7 @@ void network_process_buffer(char *buffer, long size, HashList *working_ignetcfg,
 
        /* Check for message routing */
        if (!CM_IsEmpty(msg, eDestination)) {
-               if (strcasecmp(msg->cm_fields[eDestination], config.c_nodename)) {
+               if (strcasecmp(msg->cm_fields[eDestination], CtdlGetConfigStr("c_nodename"))) {
 
                        /* route the message */
                        Buf = NewStrBufPlain(CM_KEY(msg,eDestination));