comparison src/dnsbl.cpp @ 321:e172dc10fe24

add dkim white/black listing
author Carl Byington <carl@five-ten-sg.com>
date Sat, 17 Dec 2016 13:47:28 -0800
parents f5547e7b3a09
children 9f8411f3919c
comparison
equal deleted inserted replaced
320:e27c24c1974a 321:e172dc10fe24
518 ctx = NULL; 518 ctx = NULL;
519 eom = false; 519 eom = false;
520 ip = 0; 520 ip = 0;
521 helo = NULL; 521 helo = NULL;
522 mailaddr = NULL; 522 mailaddr = NULL;
523 fromaddr = NULL;
524 header_count = 0;
523 queueid = NULL; 525 queueid = NULL;
524 authenticated = NULL; 526 authenticated = NULL;
525 client_name = NULL; 527 client_name = NULL;
526 client_dns_name = NULL; 528 client_dns_name = NULL;
527 client_dns_forged = false; 529 client_dns_forged = false;
565 if (loto) free((void*)loto); 567 if (loto) free((void*)loto);
566 delete dwp; 568 delete dwp;
567 delayer.pop_front(); 569 delayer.pop_front();
568 } 570 }
569 if (mailaddr) free((void*)mailaddr); 571 if (mailaddr) free((void*)mailaddr);
572 if (fromaddr) free((void*)fromaddr);
570 if (queueid) free((void*)queueid); 573 if (queueid) free((void*)queueid);
571 if (authenticated) free((void*)authenticated); 574 if (authenticated) free((void*)authenticated);
572 if (client_name) free((void*)client_name); 575 if (client_name) free((void*)client_name);
573 if (client_dns_name) free((void*)client_dns_name); 576 if (client_dns_name) free((void*)client_dns_name);
574 discard(hosts_uribl); 577 discard(hosts_uribl);
580 if (dccifd) delete dccifd; 583 if (dccifd) delete dccifd;
581 if (!final) { 584 if (!final) {
582 ctx = NULL; 585 ctx = NULL;
583 eom = false; 586 eom = false;
584 mailaddr = NULL; 587 mailaddr = NULL;
588 fromaddr = NULL;
589 header_count = 0;
585 queueid = NULL; 590 queueid = NULL;
586 authenticated = NULL; 591 authenticated = NULL;
587 client_name = NULL; 592 client_name = NULL;
588 client_dns_name = NULL; 593 client_dns_name = NULL;
589 host_uribl = NULL; 594 host_uribl = NULL;
1442 } 1447 }
1443 1448
1444 sfsistat mlfi_header(SMFICTX* ctx, char* headerf, char* headerv) 1449 sfsistat mlfi_header(SMFICTX* ctx, char* headerf, char* headerv)
1445 { 1450 {
1446 mlfiPriv &priv = *MLFIPRIV; 1451 mlfiPriv &priv = *MLFIPRIV;
1452 priv.header_count++;
1453 if ((priv.header_count < 4) || (strcasecmp(headerf, "from") == 0)) {
1454 char msg[maxlen];
1455 snprintf(msg, sizeof(msg), "header %s: %s", headerf, headerv);
1456 for (int i=0; i<strlen(msg); i++) {
1457 if (msg[i] < 0x20) msg[i] = ' ';
1458 }
1459 my_syslog(&priv, msg);
1460 }
1461
1447 // headers that avoid autowhitelisting 1462 // headers that avoid autowhitelisting
1448 if (((strcasecmp(headerf, "precedence") == 0) && (strcasecmp(headerv, "bulk") == 0)) || 1463 if (((strcasecmp(headerf, "precedence") == 0) && (strcasecmp(headerv, "bulk") == 0)) ||
1449 ((strcasecmp(headerf, "content-type") == 0) && (strncasecmp(headerv, "multipart/report", 16) == 0))) { 1464 ((strcasecmp(headerf, "content-type") == 0) && (strncasecmp(headerv, "multipart/report", 16) == 0))) {
1450 priv.allow_autowhitelisting = false; 1465 priv.allow_autowhitelisting = false;
1451 } 1466 }