Re: 3.9.1-rc1: issue with classification user
Stevan Bajić <[email protected]>
| Newsgroups | gmane.mail.spam.dspam.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 08 Aug 2010 15:52:58 +0200 Tom Hendrikx <[email protected]> wrote: [...] > > > > # cat /var/spool/dspam/group.away > > groupname:classification:*classicifation_user > > > >> Could you post the output of "select * from dspam_virtual_uids where username = 'classification_user'"? > > > > vmail=# select * from dspam_virtual_uids; > > uid | username > > -----+------------------------ > > 1 | classification_user > > 2 | [email protected] > > (2 rows) > > > > And a few minutes after sending the mail, I thought that I might have > made a typo. And I did: classification_user != classicifation_user > Good catch. > Sorry for the noise. However, I still think that an error message > explaining the issue would help a lot. > > Error: processing message for user [email protected] failed: unable > to find user 'classicifation_user' for peer classification. > > looks so much better than: > > bailing on error -2 > process_message returned error -5. delivering. > You are right. The error message could be better. However... it's not that simple. I anyway need to change the whole code for better error handling in case of non existing users. Could you try the attached patch? It will not print out the error message you requested but should work better in cases when ensure_confident_result() is returning a wrong result. Could you send me a new debug output with the applied patch? > >> Do you have more lines from the log? I mean: Could you post more lines from the log from above? How can "_pgsql_drv_getpwnam(classicifation_user)" return NULL if the user exists/existed in dspam_virtual_uids? > >> > > > > I created a new debug file, see attachment for complete output. > > > > > > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by > > > > Make an app they can't live without > > Enter the BlackBerry Developer Challenge > > http://p.sf.net/sfu/RIM-dev2dev > > > > > > > > _______________________________________________ > > Dspam-devel mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/dspam-devel > > > -- > Regards, > Tom > ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Dspam-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dspam-devel
tom.patch
(application/octet-stream, 1.7 KB)
diff --git a/src/dspam.c b/src/dspam.c
index 1f580c9..6eca27b 100644
--- a/src/dspam.c
+++ b/src/dspam.c
@@ -1,4 +1,4 @@
-/* $Id: dspam.c,v 1.403 2010/08/06 23:36:36 sbajic Exp $ */
+/* $Id: dspam.c,v 1.404 2010/08/08 16:28:45 sbajic Exp $ */
/*
DSPAM
@@ -2881,6 +2881,7 @@ int retrain_message(DSPAM_CTX *CTX, AGENT_CTX *ATX) {
int ensure_confident_result(DSPAM_CTX *CTX, AGENT_CTX *ATX, int result) {
int was_spam = 0;
+ int ret = result;
/* Exit if no users available for global group or classification network */
if (ATX->classify_users && ATX->classify_users->items == 0)
@@ -2907,8 +2908,9 @@ int ensure_confident_result(DSPAM_CTX *CTX, AGENT_CTX *ATX, int result) {
{
if (result == DSR_ISSPAM) {
was_spam = 1;
- CTX->result = DSR_ISINNOCENT;
result = DSR_ISINNOCENT;
+ ret = result;
+ CTX->result = result;
}
CTX->confidence = 0.60f;
}
@@ -2926,10 +2928,13 @@ int ensure_confident_result(DSPAM_CTX *CTX, AGENT_CTX *ATX, int result) {
node_int = c_nt_first (ATX->classify_users, &c_i);
while (node_int != NULL && result != DSR_ISSPAM) {
LOGDEBUG ("checking result for user %s", (const char *) node_int->ptr);
- result = user_classify (ATX, (const char *) node_int->ptr, CTX->signature, NULL);
- if (result == DSR_ISSPAM) {
+ ret = user_classify (ATX, (const char *) node_int->ptr, CTX->signature, NULL);
+ if (ret == DSR_ISSPAM) {
LOGDEBUG ("CLASSIFY CATCH: %s", (const char *) node_int->ptr);
+ result = ret;
CTX->result = result;
+ } else if (ret == DSR_ISINNOCENT || ret == DSR_NONE) {
+ result = ret;
}
node_int = c_nt_next (ATX->classify_users, &c_i);
}