Added AGMS's excellent spam detection software. Still some weirdness with the configuration interface from E-mail prefs.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9934 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Nathan Whitehorn 2004-11-12 02:55:05 +00:00
parent 39241fe228
commit 919ccaea46
5 changed files with 7330 additions and 11 deletions

View File

@ -13,3 +13,7 @@ LinkSharedOSLibs Spam\ Filter :
Package haiku-maildaemon-cvs :
Spam\ Filter :
boot home config add-ons mail_daemon inbound_filters ;
Package haiku-maildaemon-cvs :
spamfilter :
boot home config bin ;

View File

@ -11,6 +11,9 @@
* Public Domain 2002, by Alexander G. M. Smith, no warranty.
*
* $Log: SpamFilter.cpp,v $
* Revision 1.2 2004/11/12 02:55:05 nwhitehorn
* Added AGMS's excellent spam detection software. Still some weirdness with the configuration interface from E-mail prefs.
*
* Revision 1.1 2004/10/30 22:23:26 brunoga
* AGMS Spam Filter.
*
@ -104,6 +107,8 @@
#include <Path.h>
#include <Roster.h>
#include <String.h>
#include <FindDirectory.h>
#include <Entry.h>
#include <stdlib.h>
#include <stdio.h>
@ -220,8 +225,22 @@ AGMSBayesianSpamFilter::ProcessMailMessage (
// Make sure the server is running.
if (!be_roster->IsRunning (kServerSignature)) {
errorCode = be_roster->Launch (kServerSignature);
if (errorCode != B_OK)
goto ErrorExit;
if (errorCode != B_OK) {
BPath path;
entry_ref ref;
directory_which places[] = {B_COMMON_BIN_DIRECTORY,B_BEOS_BIN_DIRECTORY};
for (int32 i = 0; i < 2; i++) {
find_directory(places[i],&path);
path.Append("spamfilter");
if (!BEntry(path.Path()).Exists())
continue;
get_ref_for_path(path.Path(),&ref);
if ((errorCode = be_roster->Launch (&ref)) == B_OK)
break;
}
if (errorCode != B_OK)
goto ErrorExit;
}
}
// Set up the messenger to the database server.

View File

@ -3,6 +3,9 @@
* settings related to the add-on, but not the server.
*
* $Log: SpamFilterConfig.cpp,v $
* Revision 1.2 2004/11/12 02:55:05 nwhitehorn
* Added AGMS's excellent spam detection software. Still some weirdness with the configuration interface from E-mail prefs.
*
* Revision 1.1 2004/10/30 22:23:26 brunoga
* AGMS Spam Filter.
*
@ -71,6 +74,9 @@
#include <Roster.h>
#include <StringView.h>
#include <TextControl.h>
#include <FindDirectory.h>
#include <Entry.h>
#include <Path.h>
#include <MailAddon.h>
#include <FileConfigView.h>
@ -359,17 +365,30 @@ AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () {
// Make sure the server is running.
if (!be_roster->IsRunning (kServerSignature)) {
errorCode = be_roster->Launch (kServerSignature);
if (errorCode != B_OK)
goto ErrorExit;
}
errorCode = be_roster->Launch (kServerSignature);
if (errorCode != B_OK) {
BPath path;
entry_ref ref;
directory_which places[] = {B_COMMON_BIN_DIRECTORY,B_BEOS_BIN_DIRECTORY};
for (int32 i = 0; i < 2; i++) {
find_directory(places[i],&path);
path.Append("spamfilter");
if (!BEntry(path.Path()).Exists())
continue;
get_ref_for_path(path.Path(),&ref);
if ((errorCode = be_roster->Launch (&ref)) == B_OK)
break;
}
if (errorCode != B_OK)
goto ErrorExit;
}
}
snooze (2000000);
// Set up the messenger to the database server.
serverTeam = be_roster->TeamFor (kServerSignature);
if (serverTeam < 0)
goto ErrorExit;
messengerToServer =
BMessenger (kServerSignature, serverTeam, &errorCode);
BMessenger (kServerSignature);
if (!messengerToServer.IsValid ())
goto ErrorExit;

View File

@ -85,6 +85,12 @@ StdBinCommands
: be libmail.so
;
# standard commands that need libbe.so, libmail.so, libtracker.so
StdBinCommands
spamfilter.cpp
: be tracker stdc++.r4 libmail.so
;
SubInclude OBOS_TOP src apps bin addattr ;
SubInclude OBOS_TOP src apps bin bash ;
SubInclude OBOS_TOP src apps bin bc ;

7271
src/apps/bin/spamfilter.cpp Normal file

File diff suppressed because it is too large Load Diff