On January 12, 2007 11:16:50 AM +0530 D SPAM <[EMAIL PROTECTED]> wrote:
For certain messages that get passed through DSPAM, the headers are
missing
"X-DSPAM-User" headers. Any suggestions?

I don't understand why, but that is by design.  Try the attached patch.

-frank
Make spam@ and notspam@ work correctly.
- always add x-dspam-user, not just in certain narrow cases, because
  we need it to find an address when processing errors via spam@ or notspam@
  (as opposed to spam-user@ or notspam-user@ where the address is available)
- in error mode, always check for x-dspam-user, not just for fp
  (ie, do this for fn also)
- don't deliver in error mode

diff -urp dspam-3.6.8.orig/src/daemon.c dspam-3.6.8/src/daemon.c
--- dspam-3.6.8.orig/src/daemon.c       2006-05-13 05:17:30.000000000 -0700
+++ dspam-3.6.8/src/daemon.c    2006-07-20 00:02:48.841692000 -0700
@@ -907,10 +907,9 @@ buffer * read_sock(THREAD_CTX *TTX, AGEN
       }
     }
 
-    /* Use the original user id if we are reversing a false positive */
+    /* Use the original user id if we are reversing */
     if (!strncasecmp (buf, "X-DSPAM-User: ", 14) && 
         ATX->operating_mode == DSM_PROCESS    &&
-        ATX->classification == DSR_ISINNOCENT &&
         ATX->source         == DSS_ERROR)
     {
       char user[MAX_USERNAME_LENGTH];
diff -urp dspam-3.6.8.orig/src/dspam.c dspam-3.6.8/src/dspam.c
--- dspam-3.6.8.orig/src/dspam.c        2006-05-30 08:03:55.000000000 -0700
+++ dspam-3.6.8/src/dspam.c     2006-07-20 09:01:47.405526000 -0700
@@ -1814,6 +1814,9 @@ int process_users(AGENT_CTX *ATX, buffer
        * Classify and Process 
        */
 
+      if (ATX->source == DSS_ERROR)
+        goto RSET;
+
       /* Innocent */
 
       if (result != DSR_ISSPAM)
@@ -1982,9 +1985,7 @@ int process_users(AGENT_CTX *ATX, buffer
       }
     }
 
-#ifdef CLAMAV
 RSET:
-#endif
     _ds_pref_free(ATX->PTX);
     free(ATX->PTX);
     ATX->PTX = NULL;
@@ -3044,7 +3045,6 @@ int add_xdspam_headers(DSPAM_CTX *CTX, A
             LOG (LOG_CRIT, ERR_MEM_ALLOC);
         }
 
-        if (CTX->result == DSR_ISSPAM && (ATX->managed_group[0] || 
(_ds_pref_val(ATX->PTX, "localStore")[0])))
         {
           snprintf(data, sizeof(data), "X-DSPAM-User: %s", CTX->username);
           head = _ds_create_header_field(data);

Reply via email to