Updates and isNetmail=isPrivate

This commit is contained in:
Bryan Ashby 2018-01-09 20:48:47 -07:00
parent d225d78fa9
commit f939babe72
1 changed files with 15 additions and 14 deletions

View File

@ -399,7 +399,11 @@ function FTNMessageScanTossModule() {
// export that failed to finish // export that failed to finish
// //
if(!message.meta.FtnKludge.MSGID) { 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(); message.meta.FtnKludge.TZUTC = ftnUtil.getUTCTimeZoneOffset();
@ -819,32 +823,29 @@ function FTNMessageScanTossModule() {
// lookup order (most to least explicit config): // lookup order (most to least explicit config):
// //
// 1) Routes: messageNetworks.ftn.netMail.routes{} -> scannerTossers.ftn_bso.nodes{} -> 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 // - Where we send may not be where dstAddress is (it's routed!)
// for local address
// 2) Direct to nodes: scannerTossers.ftn_bso.nodes{} -> config // 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 // - 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); const route = this.getNetMailRoute(dstAddr);
let routeAddress; let routeAddress;
let networkName; let networkName;
if(route) { if(route) {
routeAddress = Address.fromString(route.address); routeAddress = Address.fromString(route.address);
networkName = route.network || Config.scannerTossers.ftn_bso.defaultNetwork; networkName = route.network;
} else { } else {
routeAddress = dstAddr; 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) => { const config = _.find(this.moduleConfig.nodes, (node, nodeAddrWildcard) => {
return routeAddress.isPatternMatch(nodeAddrWildcard); return routeAddress.isPatternMatch(nodeAddrWildcard);
}) || { }) || {