comparison src/context.cpp @ 465:79e944269c0b

SA needs original rfc5321 envelope from to do proper spf checking. Remove some debug code.
author Carl Byington <carl@five-ten-sg.com>
date Thu, 25 Apr 2019 09:35:53 -0700
parents 428de28b34b7
children f5b394bec28c
comparison
equal deleted inserted replaced
464:428de28b34b7 465:79e944269c0b
1228 uint32_t ipy = ntohl(ipx.s_addr); 1228 uint32_t ipy = ntohl(ipx.s_addr);
1229 int mask = (s) ? atoi(s+1) : 32; 1229 int mask = (s) ? atoi(s+1) : 32;
1230 if ((mask >= 14) && (mask <= 32)) { // microsoft has a /14 1230 if ((mask >= 14) && (mask <= 32)) { // microsoft has a /14
1231 uint32_t low = (1 << (32-mask)) - 1; 1231 uint32_t low = (1 << (32-mask)) - 1;
1232 ipy &= low ^ 0xffffffff; 1232 ipy &= low ^ 0xffffffff;
1233 { 1233 //{
1234 char buf[maxlen]; 1234 // char buf[maxlen];
1235 snprintf(buf, maxlen, "ip=%08x, spf=%08x/%d, mask=%08x", ip, ipy, mask, low); 1235 // snprintf(buf, maxlen, "ip=%08x, spf=%08x/%d, mask=%08x", ip, ipy, mask, low);
1236 log(priv->queueid, "spf check %s", buf); 1236 // log(priv->queueid, "spf check %s", buf);
1237 } 1237 //}
1238 if ((ipy <= ip) && (ip <= ipy + low)) { 1238 if ((ipy <= ip) && (ip <= ipy + low)) {
1239 if (s) *s = '/'; 1239 if (s) *s = '/';
1240 log(priv->queueid, "match ip4:%s", p); 1240 log(priv->queueid, "match ip4:%s", p);
1241 return true; 1241 return true;
1242 } 1242 }