comparison src/dnsbl.cpp @ 55:44babba1a9b9

updates for 3.6, better documentation on removing content filtering, missing some files in cvs
author carl
date Wed, 08 Sep 2004 14:16:49 -0700
parents c2371bb6cf84
children 419e00901570
comparison
equal deleted inserted replaced
54:dca56b2de019 55:44babba1a9b9
593 return oksofar; 593 return oksofar;
594 } 594 }
595 595
596 596
597 //////////////////////////////////////////////// 597 ////////////////////////////////////////////////
598 // check the dnsbls specified for this recipient 598 // check the hosts from the body against the content dnsbl
599 // 599 //
600 static status check_hosts(mlfiPriv &priv, char *&host, int &ip); 600 static status check_hosts(mlfiPriv &priv, char *&host, int &ip);
601 static status check_hosts(mlfiPriv &priv, char *&host, int &ip) { 601 static status check_hosts(mlfiPriv &priv, char *&host, int &ip) {
602 CONFIG &dc = *priv.pc; 602 CONFIG &dc = *priv.pc;
603 if (!dc.content_suffix) return oksofar;
604 int count = 0; 603 int count = 0;
605 ns_map nameservers; 604 ns_map nameservers;
606 bool ran = priv.pc->host_random; 605 bool ran = priv.pc->host_random;
607 int lim = priv.pc->host_limit; // we should not look at more than this many hosts 606 int lim = priv.pc->host_limit; // we should not look at more than this many hosts
608 int cnt = priv.memory->hosts.size(); // number of hosts we could look at 607 int cnt = priv.memory->hosts.size(); // number of hosts we could look at
798 } 797 }
799 798
800 sfsistat mlfi_body(SMFICTX *ctx, u_char *data, size_t len) 799 sfsistat mlfi_body(SMFICTX *ctx, u_char *data, size_t len)
801 { 800 {
802 mlfiPriv &priv = *MLFIPRIV; 801 mlfiPriv &priv = *MLFIPRIV;
803 if (priv.authenticated) return SMFIS_CONTINUE; 802 if (priv.authenticated) return SMFIS_CONTINUE;
804 if (priv.only_whites) return SMFIS_CONTINUE; 803 if (priv.only_whites) return SMFIS_CONTINUE;
804 if (!priv.pc->content_suffix) return SMFIS_CONTINUE;
805 priv.scanner->scan(data, len); 805 priv.scanner->scan(data, len);
806 return SMFIS_CONTINUE; 806 return SMFIS_CONTINUE;
807 } 807 }
808 808
809 sfsistat mlfi_eom(SMFICTX *ctx) 809 sfsistat mlfi_eom(SMFICTX *ctx)
812 mlfiPriv &priv = *MLFIPRIV; 812 mlfiPriv &priv = *MLFIPRIV;
813 char *host = NULL; 813 char *host = NULL;
814 int ip; 814 int ip;
815 status st; 815 status st;
816 // process end of message 816 // process end of message
817 if (priv.authenticated || 817 if (priv.authenticated ||
818 priv.only_whites || 818 priv.only_whites ||
819 (!priv.pc->content_suffix) ||
819 ((st=check_hosts(priv, host, ip)) == oksofar)) rc = SMFIS_CONTINUE; 820 ((st=check_hosts(priv, host, ip)) == oksofar)) rc = SMFIS_CONTINUE;
820 else { 821 else {
821 if (!priv.have_whites) { 822 if (!priv.have_whites) {
822 // can reject the entire message 823 // can reject the entire message
823 char buf[2000]; 824 char buf[2000];