X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fnetwork%2Fserv_netspool.c;h=300efacb39de8f36deda13386d839dd0e7019099;hb=c4609169aa7baf208848e72c16d33a3f892353b8;hp=86cad97b4a7144f83f91963e776c09f0c9279f7c;hpb=30a4090b04dff1084df3789efe78afd1e2bf6d90;p=citadel.git diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index 86cad97b4..300efacb3 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -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 @@ -112,7 +112,7 @@ void network_bounce(struct CtdlMessage **pMsg, char *reason) if (msg == NULL) return; - snprintf(bouncesource, sizeof bouncesource, "%s@%s", BOUNCESOURCE, config.c_nodename); + snprintf(bouncesource, sizeof bouncesource, "%s@%s", BOUNCESOURCE, CtdlGetConfigStr("c_nodename")); /* * Give it a fresh message ID @@ -122,7 +122,7 @@ void network_bounce(struct CtdlMessage **pMsg, char *reason) (long)time(NULL), (long)getpid(), ++serialnum, - config.c_fqdn); + CtdlGetConfigStr("c_fqdn")); CM_SetField(msg, emessageId, buf, len); @@ -130,7 +130,9 @@ void network_bounce(struct CtdlMessage **pMsg, char *reason) * FIXME ... right now we're just sending a bounce; we really want to * include the text of the bounced message. */ - CM_SetField(msg, eMesageText, reason, strlen(reason)); + if (!IsEmptyStr(reason)) { + CM_SetField(msg, eMesageText, reason, strlen(reason)); + } msg->cm_format_type = 0; /* @@ -144,7 +146,7 @@ void network_bounce(struct CtdlMessage **pMsg, char *reason) msg->cm_fields[eNodeName]); CM_SetField(msg, eAuthor, HKEY(BOUNCESOURCE)); - CM_SetField(msg, eNodeName, CFG_KEY(c_nodename)); + CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename"))); CM_SetField(msg, eMsgSubject, HKEY("Delivery Status Notification (Failure)")); Netmap_AddMe(msg, HKEY("unknown_user")); @@ -156,13 +158,13 @@ void network_bounce(struct CtdlMessage **pMsg, char *reason) valid = NULL; } if ( (valid == NULL) || (!strcasecmp(recipient, bouncesource)) ) { - strcpy(force_room, config.c_aideroom); + strcpy(force_room, CtdlGetConfigStr("c_aideroom")); } else { strcpy(force_room, ""); } if ( (valid == NULL) && IsEmptyStr(force_room) ) { - strcpy(force_room, config.c_aideroom); + strcpy(force_room, CtdlGetConfigStr("c_aideroom")); } CtdlSubmitMsg(msg, valid, force_room, 0); @@ -248,10 +250,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 = configlen.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); @@ -387,7 +389,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 @@ -405,7 +407,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]); } @@ -455,7 +457,7 @@ void network_spoolout_room(SpoolControl *sc) else { snprintf(buf, sizeof buf, "room_%s@%s", - CCC->room.QRname, config.c_fqdn); + CCC->room.QRname, CtdlGetConfigStr("c_fqdn")); } for (i=0; buf[i]; ++i) { @@ -612,7 +614,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));