From 74d7704b2f1c42d891c013f5ef3ec9dea380851e Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 27 Jan 2014 14:30:00 +0100 Subject: check for possible smtproutes in realrcptto --- realrcptto.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'realrcptto.c') diff --git a/realrcptto.c b/realrcptto.c index 98dc6e6..b419847 100644 --- a/realrcptto.c +++ b/realrcptto.c @@ -28,9 +28,11 @@ static stralloc envnoathost = {0}; static stralloc percenthack = {0}; static stralloc locals = {0}; static stralloc vdoms = {0}; +static stralloc smtproutes = {0}; static struct constmap mappercenthack; static struct constmap maplocals; static struct constmap mapvdoms; +static struct constmap mapsmtproutes; static char *dash; static char *extension; @@ -67,6 +69,11 @@ void realrcptto_init() case 0: if (!constmap_init(&mapvdoms,"",0,1)) die_nomem(); case 1: if (!constmap_init(&mapvdoms,vdoms.s,vdoms.len,1)) die_nomem(); } + switch(control_readfile(&smtproutes,"control/smtproutes",0)) { + case -1: die_control(); + case 0: if (!constmap_init(&mapsmtproutes,"",0,1)) die_nomem(); + case 1: if (!constmap_init(&mapsmtproutes,smtproutes.s,smtproutes.len,1)) die_nomem(); + } str_copy(pidbuf + fmt_ulong(pidbuf,getpid())," "); x=env_get("PROTO"); @@ -273,6 +280,7 @@ int depth; } } if (x) break; + if (constmap(&mapsmtproutes,localpart.s + i,localpart.len - i)) return 1; } } if (!*x) return 1; -- cgit v1.2.3