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:
@@ -13,3 +13,7 @@ LinkSharedOSLibs Spam\ Filter :
|
|||||||
Package haiku-maildaemon-cvs :
|
Package haiku-maildaemon-cvs :
|
||||||
Spam\ Filter :
|
Spam\ Filter :
|
||||||
boot home config add-ons mail_daemon inbound_filters ;
|
boot home config add-ons mail_daemon inbound_filters ;
|
||||||
|
|
||||||
|
Package haiku-maildaemon-cvs :
|
||||||
|
spamfilter :
|
||||||
|
boot home config bin ;
|
||||||
@@ -11,6 +11,9 @@
|
|||||||
* Public Domain 2002, by Alexander G. M. Smith, no warranty.
|
* Public Domain 2002, by Alexander G. M. Smith, no warranty.
|
||||||
*
|
*
|
||||||
* $Log: SpamFilter.cpp,v $
|
* $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
|
* Revision 1.1 2004/10/30 22:23:26 brunoga
|
||||||
* AGMS Spam Filter.
|
* AGMS Spam Filter.
|
||||||
*
|
*
|
||||||
@@ -104,6 +107,8 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
#include <FindDirectory.h>
|
||||||
|
#include <Entry.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -220,8 +225,22 @@ AGMSBayesianSpamFilter::ProcessMailMessage (
|
|||||||
// Make sure the server is running.
|
// Make sure the server is running.
|
||||||
if (!be_roster->IsRunning (kServerSignature)) {
|
if (!be_roster->IsRunning (kServerSignature)) {
|
||||||
errorCode = be_roster->Launch (kServerSignature);
|
errorCode = be_roster->Launch (kServerSignature);
|
||||||
if (errorCode != B_OK)
|
if (errorCode != B_OK) {
|
||||||
goto ErrorExit;
|
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.
|
// Set up the messenger to the database server.
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
* settings related to the add-on, but not the server.
|
* settings related to the add-on, but not the server.
|
||||||
*
|
*
|
||||||
* $Log: SpamFilterConfig.cpp,v $
|
* $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
|
* Revision 1.1 2004/10/30 22:23:26 brunoga
|
||||||
* AGMS Spam Filter.
|
* AGMS Spam Filter.
|
||||||
*
|
*
|
||||||
@@ -71,6 +74,9 @@
|
|||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
#include <TextControl.h>
|
#include <TextControl.h>
|
||||||
|
#include <FindDirectory.h>
|
||||||
|
#include <Entry.h>
|
||||||
|
#include <Path.h>
|
||||||
|
|
||||||
#include <MailAddon.h>
|
#include <MailAddon.h>
|
||||||
#include <FileConfigView.h>
|
#include <FileConfigView.h>
|
||||||
@@ -359,17 +365,30 @@ AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () {
|
|||||||
|
|
||||||
// Make sure the server is running.
|
// Make sure the server is running.
|
||||||
if (!be_roster->IsRunning (kServerSignature)) {
|
if (!be_roster->IsRunning (kServerSignature)) {
|
||||||
errorCode = be_roster->Launch (kServerSignature);
|
errorCode = be_roster->Launch (kServerSignature);
|
||||||
if (errorCode != B_OK)
|
if (errorCode != B_OK) {
|
||||||
goto ErrorExit;
|
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.
|
// Set up the messenger to the database server.
|
||||||
serverTeam = be_roster->TeamFor (kServerSignature);
|
|
||||||
if (serverTeam < 0)
|
|
||||||
goto ErrorExit;
|
|
||||||
messengerToServer =
|
messengerToServer =
|
||||||
BMessenger (kServerSignature, serverTeam, &errorCode);
|
BMessenger (kServerSignature);
|
||||||
if (!messengerToServer.IsValid ())
|
if (!messengerToServer.IsValid ())
|
||||||
goto ErrorExit;
|
goto ErrorExit;
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ StdBinCommands
|
|||||||
: be libmail.so
|
: 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 addattr ;
|
||||||
SubInclude OBOS_TOP src apps bin bash ;
|
SubInclude OBOS_TOP src apps bin bash ;
|
||||||
SubInclude OBOS_TOP src apps bin bc ;
|
SubInclude OBOS_TOP src apps bin bc ;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user