From f939babe728318ce0dcaac4fe0868ddfbfff9c66 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 9 Jan 2018 20:48:47 -0700 Subject: [PATCH] Updates and isNetmail=isPrivate --- core/scanner_tossers/ftn_bso.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index 123c0b7a..bba0c313 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -399,7 +399,11 @@ function FTNMessageScanTossModule() { // export that failed to finish // if(!message.meta.FtnKludge.MSGID) { - message.meta.FtnKludge.MSGID = ftnUtil.getMessageIdentifier(message, localAddress); + message.meta.FtnKludge.MSGID = ftnUtil.getMessageIdentifier( + message, + localAddress, + message.isPrivate() // true = isNetMail + ); } message.meta.FtnKludge.TZUTC = ftnUtil.getUTCTimeZoneOffset(); @@ -819,32 +823,29 @@ function FTNMessageScanTossModule() { // lookup order (most to least explicit config): // // 1) Routes: messageNetworks.ftn.netMail.routes{} -> scannerTossers.ftn_bso.nodes{} -> config - // - Where we send may not be where dstAddress is (it's routed!); use network found in route - // for local address + // - Where we send may not be where dstAddress is (it's routed!) // 2) Direct to nodes: scannerTossers.ftn_bso.nodes{} -> config - // - Where we send is direct to dstAddr; - // - Attempt to match address in messageNetworks.ftn.networks{}, else - // use scannerTossers.ftn_bso.defaultNetwork to for local address - // 3) Nodelist DB lookup (use default config) // - Where we send is direct to dstAddr // - //const routeAddress = this.getNetMailRouteAddress(dstAddr) || dstAddr; + // In both cases, attempt to look up Zone:Net/* to discover local "from" network/address + // falling back to Config.scannerTossers.ftn_bso.defaultNetwork + // const route = this.getNetMailRoute(dstAddr); let routeAddress; let networkName; if(route) { routeAddress = Address.fromString(route.address); - networkName = route.network || Config.scannerTossers.ftn_bso.defaultNetwork; + networkName = route.network; } else { routeAddress = dstAddr; - - networkName = this.getNetworkNameByAddressPattern(`${dstAddr.zone}:${dstAddr.net}/*`); - if(!networkName) { - networkName = Config.scannerTossers.ftn_bso.defaultNetwork; - } } + networkName = networkName || + this.getNetworkNameByAddressPattern(`${routeAddress.zone}:${routeAddress.net}/*`) || + Config.scannerTossers.ftn_bso.defaultNetwork + ; + const config = _.find(this.moduleConfig.nodes, (node, nodeAddrWildcard) => { return routeAddress.isPatternMatch(nodeAddrWildcard); }) || {