-------- Original-Nachricht --------
> Datum: Fri, 1 Aug 2008 10:39:09 +0300
> Von: "Ibrahim Harrani" <[EMAIL PROTECTED]>
> An: [email protected]
> Betreff: [dspam-users] Fwd: global group is not OK in CVS build

> Hi,
> 
> I sent the following mail to dspam-dev, but it seems that it is not
> delivered.
> So I  am forwarding to this list.
> 
> 
> PS: I will forward another mail too..
> 
> 
> ---------- Forwarded message ----------
> From: Ibrahim Harrani <[EMAIL PROTECTED]>
> Date: Thu, Jul 31, 2008 at 4:01 PM
> Subject: global group is not OK in CVS build
> To: [EMAIL PROTECTED]
> 
> 
> Hi,
> 
> I am trying to configure global group in /usr/local/var/dspam/group
> file like below:
> groupname:classification:[EMAIL PROTECTED],
> 
> I compiled dspam-cvs with debug and daemon option, If I issue dspam
> --client -user [EMAIL PROTECTED] ..
> the email is marked as spam but If I try with another user, the result
> is always Innocent.
> I recognized that, in the dspam logs there is not clue about global
> configuration. I mean there is no line like :
> "adding user [EMAIL PROTECTED] to classification group groupname",
> 
> When I compare with dspam-3.8.0/src/dspam.c with dspam-cvs/src/dspam.c
> the following line was different.
> 
>  // load_agg
> @@ -2344,8 +2382,8 @@
> 
>           while (user != NULL)
>           {
> -            if (!strcmp (user, username) || user[0] == '*' ||
> -               (!strncmp(user, "*@", 2) && !strcmp(user+2,
> strchr(username,'@'))))
> +            if (!strcmp (user, username) || !strcmp(user, "*") ||
> +               (!strncmp(user, "*@", 2) && !strcmp(user+1,
> strchr(username,'@'))))
>             {
> 
> 
> When I change those two line in dspam-cvs like in dspam-3.8.0 (
>            if (!strcmp (user, username) || user[0] == '*' ||
>               (!strncmp(user, "*@", 2) && !strcmp(user+2,
> strchr(username,'@'))))
> )
> 
> Global group started working, It is marking as spam for a user it the
> mail was marked spam for global user.
> and I see the following lines in the log file.
> 
> 25012: [07/31/2008 15:43:11] adding user [EMAIL PROTECTED] to
> classification group groupname
> 
> I think those two lines should be changed to original values in 3.8.0?
> 
To illustrate that the 3.8.0 code is wrong I quickly coded an test case. This 
is the code used (file dspam-test.c):
-----
int main(int argc, char *argv[]){
        if( argc < 3 ) {
                printf("USAGE: %s <username> <user>\n", argv[0]);
                return 1;
        }
        char *username = argv[1];
        char *user = argv[2];

        printf("Username: %s\n", username);
        printf("User: %s\n\n", user);

        if (!strcmp (user, username) || user[0] == '*' ||
           (!strncmp(user, "*@", 2) && !strcmp(user+2, strchr(username,'@'))))
        {
                printf("Matching 3.8.0 code\n");
        }

        if (!strcmp (user, username) || !strcmp(user, "*") ||
           (!strncmp(user, "*@", 2) && !strcmp(user+1, strchr(username,'@'))))
        {
                printf("Matching CVS code\n");
        }
}
-----

You can compile it by executing:
gcc dspam-test.c -o dspam-test

Let's call it with some examples:

1) current user (aka DSPAM user) is [EMAIL PROTECTED] and group member is 
[EMAIL PROTECTED]:
# ./dspam-test "[EMAIL PROTECTED]" "[EMAIL PROTECTED]"
Username: [EMAIL PROTECTED]
User: [EMAIL PROTECTED]

Matching 3.8.0 code
#

--> DSPAM 3.8.0 is recognizing user [EMAIL PROTECTED] to be a group member if 
in the member list the entry [EMAIL PROTECTED] is found. That's what you like 
DSPAM to work like and from a syntactical viewpoint it is not wrong.


2) current user (aka DSPAM user) is [EMAIL PROTECTED] and group member is 
[EMAIL PROTECTED]:
# ./dspam-test "[EMAIL PROTECTED]" "[EMAIL PROTECTED]"
Username: [EMAIL PROTECTED]
User: [EMAIL PROTECTED]

Matching 3.8.0 code
#

--> DSPAM 3.8.0 is recognizing user [EMAIL PROTECTED] to be a group member if 
in the member list the entry [EMAIL PROTECTED] is found. That's totally wrong. 
In no way should [EMAIL PROTECTED] be matched by the member list entry [EMAIL 
PROTECTED]


3) current user (aka DSPAM user) is [EMAIL PROTECTED] and group member is 
[EMAIL PROTECTED]:
# ./dspam-test "[EMAIL PROTECTED]" "[EMAIL PROTECTED]"
Username: [EMAIL PROTECTED]
User: [EMAIL PROTECTED]

Matching 3.8.0 code
Matching CVS code
#

--> Perfect. Both DSPAM 3.8.0 and CVS act the same (correct) way.


4)  current user (aka DSPAM user) is [EMAIL PROTECTED] and group member is 
[EMAIL PROTECTED]:
# ./dspam-test "[EMAIL PROTECTED]" "[EMAIL PROTECTED]"
Username: [EMAIL PROTECTED]
User: [EMAIL PROTECTED]

Matching 3.8.0 code
#

--> Again! DSPAM 3.8.0 acts wrongly by thinking that [EMAIL PROTECTED] (see 
domain) is correctly identified by the member list entry [EMAIL PROTECTED] (see 
domain). EXAMPLE.COM is not DOMAIN.COM


So reverting the code back to 3.8.0 is plain simple wrong.


> Best Regards
> 
// SteveB

> 
> 

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

!DSPAM:1011,48bb05fd150926241269843!


Reply via email to