struct constmap maprcpthosts;
int bmfok = 0;
stralloc bmf = {0};
+int relayhostsok = 0;
+stralloc relayhosts = {0};
+struct constmap maprelayhosts;
struct constmap mapbmf;
int flagbarf; /* defined if seenmail */
if (!remotehost) remotehost = "unknown";
remoteinfo = env_get("TCPREMOTEINFO");
relayclient = env_get("RELAYCLIENT");
+ if (!relayclient && relayhostsok) {
+ int j;
+ int l = str_len(remotehost);
+ relayclient = constmap(&maprelayhosts, remotehost, l);
+ if (!relayclient) for (j = 0; j < l; ++j) {
+ if (remotehost[j] == '.' &&
+ (relayclient = constmap(&maprelayhosts,
+ remotehost + j,
+ l - j)) != 0)
+ break;
+ }
+ }
dohelo(remotehost);
}
bmfok = 1;
if (!constmap_init(&mapbmf,bmf.s,bmf.len,0)) die();
}
+ switch (control_readfile(&relayhosts, "control/relayhosts", 0)) {
+ case -1:
+ die();
+ case 1:
+ relayhostsok = 1;
+ if (!constmap_init(&maprelayhosts, relayhosts.s, relayhosts.len, 1))
+ die();
+ }
}
void main()