- report 10*probability if dspam determines the message to be spam,
and report that it is spam
- always set the points required to 0
+ - setuid() to the user given in the User: header line in the protocol
+ - set the dspam mode to the mode given as in the User: header line
+ (for these two, the User: header line looks like this:
+ User: username mode
+ where the mode is optional)
-Hence, you probably never want to use the spam/not-spam verdict of this tool
-to make an automatic decision but rather go from the points.
+Due to the way the points are calculated, you probably never want to use the
+spam/not-spam verdict of this tool to make an automatic decision but rather
+go from the points.
It only handles messages smaller than 5mb!
char buf[200];
char cmd[50];
char version[50];
- char user[50], userarg[60];
+ char user[50], userarg[60], mode[50], modearg[60];
char *message;
int length;
int fork_result;
if (strlen(buf) > 50)
ERROR(EX_PROTOCOL, "line too long");
- if (sscanf(buf, "User: %s", user) != 1)
+ mode[0] = '\0';
+ if (sscanf(buf, "User: %s %s", user, mode) < 1)
ERROR(EX_PROTOCOL, "invalid input line (user)");
if (strcmp(id, user) && strcmp(id, "root") && strcmp(id, "Debian-exim"))
dup2(dspam_out[1], 1);
dup2(dspam_err[1], 2);
sprintf(userarg, "--user=%s", user);
- execl("/usr/bin/dspam", "/usr/bin/dspam", "--mode=toe",
+ sprintf(modearg, "--mode=%s", mode[0] ? mode : "notrain");
+ execl("/usr/bin/dspam", "/usr/bin/dspam", modearg,
"--deliver=innocent,spam", "--stdout", userarg, NULL);
return 1;
}