comparison src/dnsbl.cpp @ 181:cb5c0d7ec451

embedded dcc filtering
author carl
date Sat, 06 Oct 2007 12:30:48 -0700
parents 8b86a894514d
children 2b06183b9b25
comparison
equal deleted inserted replaced
180:7a722f482bfb 181:cb5c0d7ec451
1177 if (priv.authenticated || priv.only_whites) rc = SMFIS_CONTINUE; 1177 if (priv.authenticated || priv.only_whites) rc = SMFIS_CONTINUE;
1178 else { 1178 else {
1179 // assert env_to not empty, it contains the 1179 // assert env_to not empty, it contains the
1180 // non-whitelisted folks that want content filtering 1180 // non-whitelisted folks that want content filtering
1181 int score = (priv.want_spamassassin) ? priv.assassin->mlfi_eom() : 0; 1181 int score = (priv.want_spamassassin) ? priv.assassin->mlfi_eom() : 0;
1182 bool greylist = false; 1182 bool grey = false;
1183 int dccbulk = 0; 1183 int bulk = 0;
1184 if (priv.want_dccgrey || priv.want_dccbulk) priv.dccifd->mlfi_eom(greylist, dccbulk); 1184 if (priv.want_dccgrey || priv.want_dccbulk) priv.dccifd->mlfi_eom(grey, bulk);
1185 1185
1186 if (priv.want_dccgrey && greylist) { 1186 if (priv.want_dccgrey && grey) {
1187 smfi_setreply(ctx, "452", "4.2.1", "temporary greylist embargoed"); 1187 smfi_setreply(ctx, "452", "4.2.1", "temporary greylist embargoed");
1188 rc = SMFIS_TEMPFAIL; 1188 rc = SMFIS_TEMPFAIL;
1189 } 1189 }
1190 else { 1190 else {
1191 char buf[maxlen]; 1191 char buf[maxlen];
1194 bool random = false; 1194 bool random = false;
1195 int limit = 0; 1195 int limit = 0;
1196 for (context_map::iterator i=priv.env_to.begin(); i!=priv.env_to.end(); i++) { 1196 for (context_map::iterator i=priv.env_to.begin(); i!=priv.env_to.end(); i++) {
1197 char *rcpt = (*i).first; 1197 char *rcpt = (*i).first;
1198 CONTEXT &con = *((*i).second); 1198 CONTEXT &con = *((*i).second);
1199 if (!con.acceptable_content(*priv.memory, score, dccbulk, msg)) { 1199 if (!con.acceptable_content(*priv.memory, score, bulk, msg)) {
1200 // bad html tags or excessive hosts or 1200 // bad html tags or excessive hosts or
1201 // high spam assassin score or dcc bulk threshold exceedeed 1201 // high spam assassin score or dcc bulk threshold exceedeed
1202 smfi_delrcpt(ctx, rcpt); 1202 smfi_delrcpt(ctx, rcpt);
1203 } 1203 }
1204 else { 1204 else {