Hi all,
DSpam is a great product. Thank you!
This is my first post to the group, so please tell me if this is the
right place to post this kind of information.
[ Please remember that it's also my first look at DSpam code. I need to
implement a special log report, and my groups don't worked as expected... ]
The problem is in dspam.c:
Original code is:
if (!strcmp (user, username) || user[0] == '*' ||
(!strncmp(user, "*@", 2) && !strcmp(user+2, strchr(username,'@')
There are two problems here:
if user[0]='*' then the second line is not evaluate
On the second line, it should be:
(!strncmp(user, "*@", 2) && !strcmp(user+1, strchr(username,'@')
Fix::
if (!strcmp (user, username) ||
(!strncmp(user, "*@", 2) && !strcmp(user+1, strchr(username,'@')
However, please be aware that we will loose the option to have a catch
all users, but I think no one will care about it, since this is suppose
to work by domains (from the documentation).
2) A comment:
On this part of the code, strtok() is used to evaluate users. The
separator works with a ',' (comma). However, comma is used also to
separate group type: SHARED,MANAGED. That could lead to strange results.
In my personal build, I change the type separator to ';' and changed the
code according. (Just one line):
if (!strncasecmp (type + 6, ";MANAGED", 8))
But implementing it this way will broke documentation as well.
3) A "nice to have" feature:
When calling deliver_message() we can use some arguments, like %u
(username), %r (recipient), etc.
A "nice to have" feature, that I'm using to work with a MANAGED
quarantine, it's to have an extra argument available: '%g' that will
export the group that the user belongs.
I have implemented in a few minutes (also quick and dirty), and I'm not
sure if someone miss this feature.
If so, please tell me that I will post the code.
Stay Free!
Artur Anjos