From d9f9a4ac416b77ae8147d624a7cf533e9216567b Mon Sep 17 00:00:00 2001 From: "Alexander G.M. Smith" Date: Sat, 13 Aug 2005 19:31:42 +0000 Subject: [PATCH] Added the resources and file type associations, changed the application signature and otherwise made the spam detection system work properly again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13952 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../inbound_filters/spam_filter/Jamfile | 4 +- .../spam_filter/SpamFilter.cpp | 45 +++--- .../inbound_filters/spam_filter/SpamFilter.h | 23 +-- .../spam_filter/SpamFilterConfig.cpp | 35 +++-- src/apps/bemail/Mail.cpp | 4 +- src/bin/spamdbm/Jamfile | 1 + src/bin/spamdbm/spamdbm.cpp | 50 ++++--- src/bin/spamdbm/spamdbm.rdef | 137 ++++++++++++++++++ src/servers/mail/install.sh | 13 +- 9 files changed, 243 insertions(+), 69 deletions(-) create mode 100644 src/bin/spamdbm/spamdbm.rdef diff --git a/src/add-ons/mail_daemon/inbound_filters/spam_filter/Jamfile b/src/add-ons/mail_daemon/inbound_filters/spam_filter/Jamfile index 9e3d51985a..9366421fc1 100644 --- a/src/add-ons/mail_daemon/inbound_filters/spam_filter/Jamfile +++ b/src/add-ons/mail_daemon/inbound_filters/spam_filter/Jamfile @@ -15,5 +15,5 @@ Package haiku-maildaemon-cvs : boot home config add-ons mail_daemon inbound_filters ; Package haiku-maildaemon-cvs : - spamfilter : - boot home config bin ; \ No newline at end of file + spamdbm : + boot home config bin ; diff --git a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.cpp b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.cpp index 7536f30886..437381ac85 100644 --- a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.cpp +++ b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.cpp @@ -1,20 +1,26 @@ /****************************************************************************** - * AGMSBayesianSpamFilter - Uses Bayesian statistics to evaluate the spaminess - * of a message. The evaluation is done by a separate server, this add-on just - * gets the text and uses scripting commands to get an evaluation from the - * server. If the server isn't running, it will be found and started up. Once - * the evaluation has been received, it is added to the message as an attribute - * and optionally as an addition to the subject. Some other add-on later in - * the pipeline will use the attribute to delete the message or move it to some + * $Id$ + * + * SpamFilter - Uses Bayesian statistics to evaluate the spaminess of a + * message. The evaluation is done by a separate server, this add-on just gets + * the text and uses scripting commands to get an evaluation from the server. + * If the server isn't running, it will be found and started up. Once the + * evaluation has been received, it is added to the message as an attribute and + * optionally as an addition to the subject. Some other add-on later in the + * pipeline will use the attribute to delete the message or move it to some * other folder. * * 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. + * $Log: SpamFilter.cpp,v $ (SVN doesn't support log messages so manually done) + * r11769 | bonefish | 2005-03-17 03:30:54 -0500 (Thu, 17 Mar 2005) | 1 line + * Move trunk into respective module. * - * Revision 1.1 2004/10/30 22:23:26 brunoga + * r9934 | nwhitehorn | 2004-11-11 21:55:05 -0500 (Thu, 11 Nov 2004) | 2 lines + * Added AGMS's excellent spam detection software. Still some weirdness with + * the configuration interface from E-mail prefs. + * + * r9669 | brunoga | 2004-10-30 18:23:26 -0400 (Sat, 30 Oct 2004) | 2 lines * AGMS Spam Filter. * * Revision 1.19 2004/09/20 15:57:30 nwhitehorn @@ -115,13 +121,12 @@ #include "SpamFilter.h" -// The names match the ones set up by AGMSBayesianSpamServer for sound effects. -static const char *kAGMSBayesBeepGenuineName = "AGMSBayes-Genuine"; -static const char *kAGMSBayesBeepSpamName = "AGMSBayes-Spam"; -static const char *kAGMSBayesBeepUncertainName = "AGMSBayes-Uncertain"; +// The names match the ones set up by spamdbm for sound effects. +static const char *kAGMSBayesBeepGenuineName = "SpamFilter-Genuine"; +static const char *kAGMSBayesBeepSpamName = "SpamFilter-Spam"; +static const char *kAGMSBayesBeepUncertainName = "SpamFilter-Uncertain"; -static const char *kServerSignature = - "application/x-vnd.agmsmith.AGMSBayesianSpamServer"; +static const char *kServerSignature = "application/x-vnd.agmsmith.spamdbm"; AGMSBayesianSpamFilter::AGMSBayesianSpamFilter (BMessage *settings) @@ -170,7 +175,7 @@ AGMSBayesianSpamFilter::InitCheck (BString* out_message) { if (out_message != NULL) out_message->SetTo ( - "AGMSBayesianSpamFilter::InitCheck is never called!"); + "SpamFilter::InitCheck is never called!"); return B_OK; } @@ -231,7 +236,7 @@ AGMSBayesianSpamFilter::ProcessMailMessage ( 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"); + path.Append("spamdbm"); if (!BEntry(path.Path()).Exists()) continue; get_ref_for_path(path.Path(),&ref); @@ -451,7 +456,7 @@ AGMSBayesianSpamFilter::ProcessMailMessage ( ErrorExit: fprintf (stderr, "Error exit from " - "AGMSBayesianSpamFilter::ProcessMailMessage, code maybe %ld (%s).\n", + "SpamFilter::ProcessMailMessage, code maybe %ld (%s).\n", errorCode, strerror (errorCode)); delete [] stringBuffer; return B_OK; // Not MD_ERROR so the message doesn't get left on server. diff --git a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.h b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.h index dbd1cf9e91..831459dd4d 100644 --- a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.h +++ b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.h @@ -1,19 +1,24 @@ #ifndef AGMS_BAYESIAN_SPAM_FILTER_H #define AGMS_BAYESIAN_SPAM_FILTER_H /****************************************************************************** - * AGMSBayesianSpamFilter - Uses Bayesian statistics to evaluate the spaminess - * of a message. The evaluation is done by a separate server, this add-on just - * gets the text and uses scripting commands to get an evaluation from the - * server. If the server isn't running, it will be found and started up. Once - * the evaluation has been received, it is added to the message as an attribute - * and optionally as an addition to the subject. Some other add-on later in - * the pipeline will use the attribute to delete the message or move it to some + * $Id$ + * + * SpamFilter - Uses Bayesian statistics to evaluate the spaminess of a + * message. The evaluation is done by a separate server, this add-on just gets + * the text and uses scripting commands to get an evaluation from the server. + * If the server isn't running, it will be found and started up. Once the + * evaluation has been received, it is added to the message as an attribute and + * optionally as an addition to the subject. Some other add-on later in the + * pipeline will use the attribute to delete the message or move it to some * other folder. * * Public Domain 2002, by Alexander G. M. Smith, no warranty. * - * $Log: SpamFilter.h,v $ - * Revision 1.1 2004/10/30 22:23:26 brunoga + * $Log: SpamFilter.cpp,v $ (SVN doesn't support log messages so manually done) + * r11769 | bonefish | 2005-03-17 03:30:54 -0500 (Thu, 17 Mar 2005) | 1 line + * Move trunk into respective module. + * + * r9669 | brunoga | 2004-10-30 18:23:26 -0400 (Sat, 30 Oct 2004) | 2 lines * AGMS Spam Filter. * * Revision 1.8 2004/09/20 15:57:30 nwhitehorn diff --git a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp index 863ae00f43..aaa5abdd4d 100644 --- a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp +++ b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp @@ -1,18 +1,24 @@ /****************************************************************************** - * AGMSBayesianSpamFilter's configuration view. Lets the user change various - * settings related to the add-on, but not the server. + * $Id$ * - * $Log: SpamFilterConfig.cpp,v $ - * Revision 1.4 2004/12/07 01:14:05 nwhitehorn + * SpamFilter's configuration view. Lets the user change various settings + * related to the add-on, but not the spamdbm server. + * + * $Log: SpamFilter.cpp,v $ (SVN doesn't support log messages so manually done) + * r11769 | bonefish | 2005-03-17 03:30:54 -0500 (Thu, 17 Mar 2005) | 1 line + * Move trunk into respective module. + * + * r10362 | nwhitehorn | 2004-12-06 20:14:05 -0500 (Mon, 06 Dec 2004) | 2 lines * Fixed the spam filter so it works correctly now. * - * Revision 1.3 2004/11/21 08:38:07 shatty + * r10097 | shatty | 2004-11-21 03:38:07 -0500 (Sun, 21 Nov 2004) | 2 lines * remove unused variables * - * 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. + * r9934 | nwhitehorn | 2004-11-11 21:55:05 -0500 (Thu, 11 Nov 2004) | 2 lines + * 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 + * r9669 | brunoga | 2004-10-30 18:23:26 -0400 (Sat, 30 Oct 2004) | 2 lines * AGMS Spam Filter. * * Revision 1.9 2004/09/20 15:57:30 nwhitehorn @@ -87,8 +93,7 @@ #include #include -static const char *kServerSignature = - "application/x-vnd.agmsmith.AGMSBayesianSpamServer"; +static const char *kServerSignature = "application/x-vnd.agmsmith.spamdbm"; class AGMSBayesianSpamFilterConfig : public BView { public: @@ -124,7 +129,7 @@ class AGMSBayesianSpamFilterConfig : public BView { AGMSBayesianSpamFilterConfig::AGMSBayesianSpamFilterConfig (BMessage *settings) - : BView (BRect (0,0,260,130), "agmsbayesianspamfilter_config", + : BView (BRect (0,0,260,130), "spamfilter_config", B_FOLLOW_LEFT | B_FOLLOW_TOP, 0), fAddSpamToSubject (false), fAddSpamToSubjectCheckBoxPntr (NULL), @@ -276,7 +281,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow () fQuitServerWhenFinishedCheckBoxPntr = new BCheckBox ( tempRect, "quitWhenFinished", - "Close AGMSBayesianSpamServer when Finished.", + "Close SpamDBM when Finished.", new BMessage (kQuitWhenFinishedPressed)); AddChild (fQuitServerWhenFinishedCheckBoxPntr); fQuitServerWhenFinishedCheckBoxPntr->ResizeToPreferred (); @@ -375,7 +380,7 @@ AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () { 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"); + path.Append("spamdbm"); if (!BEntry(path.Path()).Exists()) continue; get_ref_for_path(path.Path(),&ref); @@ -408,8 +413,8 @@ AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () { ErrorExit: (new BAlert ("SpamFilterConfig Error", "Sorry, unable to launch the " - "AGMSBayesianSpamServer program to let you edit the server " - "settings.", "Close"))->Go (); + "spamdbm program to let you edit the server settings.", + "Close"))->Go (); return; } diff --git a/src/apps/bemail/Mail.cpp b/src/apps/bemail/Mail.cpp index a967ec5f93..d7b7ac12b4 100644 --- a/src/apps/bemail/Mail.cpp +++ b/src/apps/bemail/Mail.cpp @@ -111,7 +111,7 @@ const char *kRedoStrings[] = { // Spam related globals. static bool gShowSpamGUI = true; static BMessenger gMessengerToSpamServer; -static const char *kSpamServerSignature = "application/x-vnd.agmsmith.AGMSBayesianSpamServer"; +static const char *kSpamServerSignature = "application/x-vnd.agmsmith.spamdbm"; static const char *kDraftPath = "mail/draft"; static const char *kDraftType = "text/x-vnd.Be-MailDraft"; @@ -3628,7 +3628,7 @@ TMailWindow::TrainMessageAs(const char *CommandWord) 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"); + path.Append("spamdbm"); if (!BEntry(path.Path()).Exists()) continue; get_ref_for_path(path.Path(),&ref); diff --git a/src/bin/spamdbm/Jamfile b/src/bin/spamdbm/Jamfile index a4173f8e9c..1bb08794d9 100644 --- a/src/bin/spamdbm/Jamfile +++ b/src/bin/spamdbm/Jamfile @@ -3,4 +3,5 @@ SubDir OBOS_TOP src bin spamdbm ; StdBinCommands spamdbm.cpp : be tracker stdc++.r4 libmail.so + : spamdbm.rdef ; diff --git a/src/bin/spamdbm/spamdbm.cpp b/src/bin/spamdbm/spamdbm.cpp index 708d31e813..7b73db432b 100644 --- a/src/bin/spamdbm/spamdbm.cpp +++ b/src/bin/spamdbm/spamdbm.cpp @@ -69,6 +69,21 @@ * assume that the file will always be in SVN, and not some other source * control system, as if!). * + * r13951 | agmsmith | 2005-08-13 11:40:01 -0400 (Sat, 13 Aug 2005) | 2 lines + * Had to do the file rename as a separate operation due to SVN limitations. + * + * r13950 | agmsmith | 2005-08-13 11:38:44 -0400 (Sat, 13 Aug 2005) | 3 lines + * Oops, "spamdb" is already used for a Unix package. And spamdatabase is + * already reserved by a domain name squatter. Use "spamdbm" instead. + * + * r13949 | agmsmith | 2005-08-13 11:17:52 -0400 (Sat, 13 Aug 2005) | 3 lines + * Renamed spamfilter to be the more meaningful spamdb (spam database) and + * moved it into its own source directory in preparation for adding resources. + * + * r13628 | agmsmith | 2005-07-10 20:11:29 -0400 (Sun, 10 Jul 2005) | 3 lines + * Updated keyword expansion to use SVN keywords. Also seeing if svn is + * working well enough for me to update files from BeOS R5. + * * r11909 | axeld | 2005-03-18 19:09:19 -0500 (Fri, 18 Mar 2005) | 2 lines * Moved bin/ directory out of apps/. * @@ -483,30 +498,30 @@ static float g_PopUpMenuHeight; /* Again for pop-up menus. */ static float g_TextBoxHeight; /* Ditto for editable text controls. */ static const char *g_ABSAppSignature = - "application/x-vnd.agmsmith.AGMSBayesianSpamServer"; + "application/x-vnd.agmsmith.spamdbm"; static const char *g_ABSDatabaseFileMIMEType = "text/x-vnd.agmsmith.spam_probability_database"; static const char *g_DefaultDatabaseFileName = - "AGMSBayesianSpam Database"; + "SpamDBM Database"; static const char *g_DatabaseRecognitionString = "Spam Database File"; static const char *g_AttributeNameClassification = "MAIL:classification"; static const char *g_AttributeNameSpamRatio = "MAIL:ratio_spam"; -static const char *g_BeepGenuine = "AGMSBayes-Genuine"; -static const char *g_BeepSpam = "AGMSBayes-Spam"; -static const char *g_BeepUncertain = "AGMSBayes-Uncertain"; +static const char *g_BeepGenuine = "SpamFilter-Genuine"; +static const char *g_BeepSpam = "SpamFilter-Spam"; +static const char *g_BeepUncertain = "SpamFilter-Uncertain"; static const char *g_ClassifiedSpam = "Spam"; static const char *g_ClassifiedGenuine = "Genuine"; static const char *g_DataName = "data"; static const char *g_ResultName = "result"; -static const char *g_SettingsDirectoryName = "AGMSBayesianSpam"; -static const char *g_SettingsFileName = "AGMSBayesianSpamServer Settings"; -static const uint32 g_SettingsWhatCode = 'ABSS'; +static const char *g_SettingsDirectoryName = "Mail"; +static const char *g_SettingsFileName = "SpamDBM Settings"; +static const uint32 g_SettingsWhatCode = 'SDBM'; static const char *g_BackupSuffix = ".backup %d"; static const int g_MaxBackups = 10; /* Numbered from 0 to g_MaxBackups - 1. */ static const size_t g_MaxWordLength = 50; /* Words longer than this aren't. */ @@ -606,7 +621,7 @@ static struct property_info g_ScriptingPropertyList [] = {g_PropertyNames[PN_DATABASE_FILE], {B_GET_PROPERTY, 0}, {B_DIRECT_SPECIFIER, 0}, "Get the pathname of the current database file. " "The default name is something like B_USER_SETTINGS_DIRECTORY / " - "AGMSBayesianSpam / AGMSBayesianSpamServer Database", PN_DATABASE_FILE, + "Mail / SpamDBM Database", PN_DATABASE_FILE, {}, {}, {}}, {g_PropertyNames[PN_DATABASE_FILE], {B_SET_PROPERTY, 0}, {B_DIRECT_SPECIFIER, 0}, "Change the pathname of the database file to " @@ -1416,7 +1431,7 @@ static void DisplayErrorMessage ( char ErrorBuffer [PATH_MAX + 1500]; if (TitleString == NULL) - TitleString = "AGMSBayesianSpamServer Error Message"; + TitleString = "SpamDBM Error Message"; if (MessageString == NULL) { @@ -1526,7 +1541,7 @@ ostream& PrintUsage (ostream& OutputStream) { struct property_info *PropInfoPntr; - OutputStream << "\nAGMSBayesianSpamServer - A Spam Database Server\n"; + OutputStream << "\nSpamDBM - A Spam Database Manager\n"; OutputStream << "Copyright © 2002 by Alexander G. M. Smith. "; OutputStream << "Released to the public domain.\n\n"; WrapTextToStream (OutputStream, "Compiled on " __DATE__ " at " __TIME__ @@ -1964,7 +1979,7 @@ void ABSApp::AboutRequested () BAlert *AboutAlertPntr; AboutAlertPntr = new BAlert ("About", -"AGMSBayesianSpamServer\n\n" +"SpamDBM - Spam Database Manager\n\n" "This is a BeOS program for classifying e-mail messages as spam (unwanted \ junk mail) or as genuine mail using a Bayesian statistical approach. There \ @@ -2754,15 +2769,14 @@ status_t ABSApp::EvaluateString ( /* Tell other programs about the scripting commands we support. Try this -command: "hey application/x-vnd.agmsmith.AGMSBayesianSpamServer getsuites" to +command: "hey application/x-vnd.agmsmith.spamdbm getsuites" to see it in action (this program has to be already running for it to work). */ status_t ABSApp::GetSupportedSuites (BMessage *MessagePntr) { BPropertyInfo TempPropInfo (g_ScriptingPropertyList); - MessagePntr->AddString ("suites", - "suite/x-vnd.agmsmith.AGMSBayesianSpamServer"); + MessagePntr->AddString ("suites", "suite/x-vnd.agmsmith.spamdbm"); MessagePntr->AddFlat ("messages", &TempPropInfo); return BApplication::GetSupportedSuites (MessagePntr); } @@ -3104,7 +3118,7 @@ status_t ABSApp::LoadSaveDatabase (bool DoLoad, char *ErrorMessage) { CurrentTime = time (NULL); if (fprintf (DatabaseFile, "%s V1 (word, age, genuine count, spam count)\t" - "Written by AGMSBayesianSpamServer $Revision$\t" + "Written by SpamDBM $Revision$\t" "Compiled on " __DATE__ " at " __TIME__ "\tThis file saved on %s", g_DatabaseRecognitionString, ctime (&CurrentTime)) <= 0) { @@ -4131,7 +4145,7 @@ void ABSApp::Pulse () } else if (g_QuitCountdown > 0) { - cerr << "AGMSBayesianSpamServer quitting in " << g_QuitCountdown << ".\n"; + cerr << "SpamDBM quitting in " << g_QuitCountdown << ".\n"; g_QuitCountdown--; } } @@ -7308,6 +7322,6 @@ int main (int argc, char**) snooze (100000); /* Let the CommanderLooper thread run so it quits. */ } - cerr << "AGMSBayesianSpamServer shutting down..." << endl; + cerr << "SpamDBM shutting down..." << endl; return 0; /* And implicitly destroys MyApp, which writes out the database. */ } diff --git a/src/bin/spamdbm/spamdbm.rdef b/src/bin/spamdbm/spamdbm.rdef new file mode 100644 index 0000000000..aaa532eee1 --- /dev/null +++ b/src/bin/spamdbm/spamdbm.rdef @@ -0,0 +1,137 @@ +/* Resources for the spamdbm program, mostly icons and + file type associations that make it work properly. + $Id: $ */ + +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + + major = 3, + middle = 0, + minor = 0, + variety = B_APPV_FINAL, + internal = 1, + short_info = "SpamDBM $Rev: $", + long_info = "SpamDBM - a spam analysis database manager for Haiku. $Id: $" +}; + +resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.agmsmith.spamdbm"; + +resource(1, "BEOS:FILE_TYPES") message { + "types" = "text/x-vnd.agmsmith.spam_probability_database", + "types" = "text/x-email" +}; + +resource(1, "Busy Cursor") #'CURS' array { + $"1001070707E018182084430242028279A005B9858DB180198109410A47022004" + $"181807E007E01FF83FFC7FFE7FFEFFFFFFFFFFFFFFFFFFFFFFFF7FFE7FFE3FFC" + $"1FF807E0" +}; + +resource(0, "BEOS:L:text/x-vnd.agmsmith.spam_probability_database") #'ICON' array { + $"FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFFFFFFFFFF" + $"FFFFFFFFFFFFFFFFFFFF00002A2A2A2A2A2A2A2A000000FFFFFFFFFFFFFFFFFF" + $"FFFFFFFFFFFFFFFF00002A2A2A2A2A2A2A2A2A2A2A2A2A0000FFFFFFFFFFFFFF" + $"FFFFFFFFFFFF00002A2A2A2A00000000000000002A2A2A2A2A0000FFFFFFFFFF" + $"FFFFFFFFFF002A2A2A2A0000FFFFFFFFFFFFFFFF00002A2A2A2A2A00FFFFFFFF" + $"FFFFFFFF002A2A2A0000FFFFFFFFFFFFFFFFFFFFFFFF00002A2A2A2A00FFFFFF" + $"FFFFFF002A2A2A00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF002A2A2A2A2A00FFFF" + $"FFFFFF002A2A00FF00000000FFFFFFFFFFFFFFFFFFFF002A2A2A002A2A00FFFF" + $"FFFF002A2A00FFFF0000000000FFFFFFFFFFFFFFFF002A2A2A00002A2A2A00FF" + $"FFFF002A2A00FFFF0000FFFF0000FFFFFFFFFFFF002A2A2A00FF002A2A2A00FF" + $"FF002A2A00FFFFFF0000FFFFFF0000FFFFFFFF002A2A2A00FFFFFF002A2A00FF" + $"FF002A2A00FFFFFF0000FFFFFF0000FFFFFF002A2A2A00FFFFFFFF002A2A0000" + $"002A2A2A00FFFFFF0000FFFFFF0000FFFF002A2A2A00FFFFFFFFFFFF002A2A00" + $"002A2A00FFFFFFFF0000FFFFFF0000FF002A2A2A00FFFFFFFFFFFFFF002A2A00" + $"002A2A00FFFFFFFF0000FFFF0000FF002A2A2A00FFFFFFFFFFFFFFFF002A2A00" + $"002A2A00FFFFFFFF0000000000FF002A2A2A00FFFFFFFFFFFFFFFFFF002A2A00" + $"002A2A00FFFFFFFF00000000FF002A2A2A00FFFFFFFFFFFFFFFFFFFF002A2A00" + $"002A2A00FFFFFFFFFFFFFFFF002A2A2A000000000000FFFFFFFFFFFF002A2A00" + $"002A2A00FFFFFFFFFFFFFF002A2A2A00FF000000000000FFFFFFFFFF002A2A00" + $"002A2A00FFFFFFFFFFFF002A2A2A00FFFF0000FFFF0000FFFFFFFFFF002A2A00" + $"002A2A2A00FFFFFFFF002A2A2A00FFFFFF0000FFFF0000FFFFFFFF002A2A2A00" + $"FF002A2A00FFFFFF002A2A2A00FFFFFFFF0000000000FFFFFFFFFF002A2A00FF" + $"FF002A2A2A00FF002A2A2A00FFFFFFFFFF000000000000FFFFFFFF002A2A00FF" + $"FFFF002A2A00002A2A2A00FFFFFFFFFFFF0000FFFF0000FFFFFF002A2A2A00FF" + $"FFFF002A2A2A2A2A2A00FFFFFFFFFFFFFF0000FFFF0000FFFF002A2A2A2A00FF" + $"FFFFFF002A2A2A2A00FFFFFFFFFFFFFFFF000000000000FF002A2A2A2A00FFFF" + $"FFFFFF002A2A2A2A0000FFFFFFFFFFFFFF0000000000FF002A2A2A2A00FFFFFF" + $"FFFFFFFF002A2A2A2A000000FFFFFFFFFFFFFFFFFF00002A2A2A2A00FFFFFFFF" + $"FFFFFFFFFF002A2A2A2A2A000000000000000000002A2A2A2A2A00FFFFFFFFFF" + $"FFFFFFFFFFFF00002A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A0000FFFFFFFFFF" + $"FFFFFFFFFFFFFFFF00002A2A2A2A2A2A2A2A2A2A2A2A2A0000FFFFFFFFFFFFFF" + $"FFFFFFFFFFFFFFFFFFFF00000000000000000000000000FFFFFFFFFFFFFFFFFF" +}; + +resource(1, "BEOS:L:STD_ICON") #'ICON' array { + $"FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFFFFFFFFFF" + $"FFFFFFFFFFFFFFFFFFFF00002A2A2A2A2A2A2A2A000000FFFFFFFFFFFFFFFFFF" + $"FFFFFFFFFFFFFFFF00002A2A2A2A2A2A2A2A2A2A2A2A2A0000FFFFFFFFFFFFFF" + $"FFFFFFFFFFFF00002A2A2A2A00000000000000002A2A2A2A2A0000FFFFFFFFFF" + $"FFFFFFFFFF002A2A2A2A0000FF000000FEFEFEFE00002A2A2A2A2A00FFFFFFFF" + $"FFFFFFFF002A2A2A0000000000FEFEFEFEFEFE00FEFE00002A2A2A2A00FFFFFF" + $"FFFFFF002A2A2A000000FEFEFEFEFEFEFE00FEFE000000002A2A2A2A2A00FFFF" + $"FFFFFF002A2A0000FEFEFEFEFEFEFE00FEFE00FEFEFE002A2A2A002A2A00FFFF" + $"FFFF002A2A00FEFEFEFEFEFE0000FEFE00FEFE00FE002A2A2A00002A2A2A00FF" + $"FFFF002A2A00FEFE00000000FEFE00FEFE00FE00002A2A2A00FE002A2A2A00FF" + $"FF002A2A00FEFEFEFE00FEFEFEFE00FEFE00FE002A2A2A00FEFEFE002A2A00FF" + $"FF002A2A0000FEFEFEFE00FEFE00FE00FEFE002A2A2A00FEFEFEFE002A2A0000" + $"002A2A2A00FF0000FEFE000000FEFEFE00002A2A2A00FEFEFEFEFEFE002A2A00" + $"002A2A00FFFFFF00FEFEFE00FEFEFEFE002A2A2A00FEFEFEFE00FEFE002A2A00" + $"002A2A00FFFFFFFF00FEFEFE00FE00002A2A2A00FEFE00FEFE00FEFE002A2A00" + $"002A2A00FFFFFFFFFF00FEFEFE00002A2A2A0000FEFE00FEFEFE00FE002A2A00" + $"002A2A00FFFFFFFFFF00FEFEFE002A2A2A0000FE00FE00FE00FE00FE002A2A00" + $"002A2A00FFFFFFFFFFFF00FE002A2A2A00FE00FE00FEFE000000FEFE002A2A00" + $"002A2A00FFFFFFFFFFFF00002A2A2A0000FE00FEFE00FE000000FEFE002A2A00" + $"002A2A00FFFFFFFFFFFF002A2A2A00FE00FEFE00FE00FE00FE00FE00002A2A00" + $"002A2A2A00FFFFFFFF002A2A2A00FE00FE00FE00FE00FEFEFEFEFE002A2A2A00" + $"FF002A2A00FFFFFF002A2A2A0000FE00FE00FEFE00FEFEFEFEFEFE002A2A00FF" + $"FF002A2A2A00FF002A2A2A00FEFE00FE0000FEFEFEFEFEFEFEFE00002A2A00FF" + $"FFFF002A2A00002A2A2A0000FEFE00FEFE00FEFEFEFEFEFE0000002A2A2A00FF" + $"FFFF002A2A2A2A2A2A00FF00FEFE00FEFEFEFEFEFE000000FF002A2A2A2A00FF" + $"FFFFFF002A2A2A2A00FF00FEFEFEFEFEFEFEFE0000FFFFFF002A2A2A2A00FFFF" + $"FFFFFF002A2A2A2A000000FEFEFEFEFEFE0000FFFFFFFF002A2A2A2A00FFFFFF" + $"FFFFFFFF002A2A2A2A000000FEFE000000FFFFFFFF00002A2A2A2A00FFFFFFFF" + $"FFFFFFFFFF002A2A2A2A2A000000000000000000002A2A2A2A2A00FFFFFFFFFF" + $"FFFFFFFFFFFF00002A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A0000FFFFFFFFFF" + $"FFFFFFFFFFFFFFFF00002A2A2A2A2A2A2A2A2A2A2A2A2A0000FFFFFFFFFFFFFF" + $"FFFFFFFFFFFFFFFFFFFF00000000000000000000000000FFFFFFFFFFFFFFFFFF" +}; + +resource(0, "BEOS:M:text/x-vnd.agmsmith.spam_probability_database") #'MICN' array { + $"FFFFFFFFFF0F2F2F2F2F0FFFFFFFFFFF" + $"FFFFFF0F2F2A2F2F2F2F2A2DD0FFFFFF" + $"FFFFD02A2F0FFFFFFFFF0F2F2A2DFFFF" + $"FF0F2AD00F0FFFFFFFFFFFD02A2D2FFF" + $"FF2F2FFF000F07FFFFFFD02AD02F2A0F" + $"0F2A0FFF00FF0F0FFFD02AD0FF0F2A07" + $"2F2DFFFF00FF0F0FD02AD0FFFFFF2F2F" + $"2F2FFFFF000F07D02AD0FFFFFFFF2F00" + $"2F2FFFFF0F0FD02A320F0FFFFFFF2F2F" + $"2F2FFFFFFFD02AD00F07070FFFFF2F2F" + $"D02A0FFFD02AD0FF0F0707FFFF0F2AD0" + $"FF2D2FD02AD0FFFF0F07070FFFD02A00" + $"FFD02A2AD0FFFFFF0F07070FD02A2DFF" + $"FFFF2D2A320FFFFFFF0F07D02A2DFFFF" + $"FFFFFF2F2A2D2F2F2F2F2D2A2D0FFFFF" + $"FFFFFFFF0F2F2F2F2F2F2FD0FFFFFFFF" +}; + +resource(1, "BEOS:M:STD_ICON") #'MICN' array { + $"FFFFFFFFFFFF2F2F2F2FFFFFFFFFFFFF" + $"FFFFFFFF2A2A2A2A2A2A2A2DD0FFFFFF" + $"FFFFD02A2F00FFFFFEFEFF2F2A2DFFFF" + $"FFFF2A32FFFEFEFE00FEFE322A2D2FFF" + $"FF2F2AFEFEFEFE0000FED02AD02F2AFF" + $"FF2A07FEFE00FEFEFED02AD0FEFF2AFF" + $"2F2AFFFFFE0000FE322AD0FEFEFF2A2F" + $"2A2FFFFFFEFEFE322A32FE0000FE2F2A" + $"2A2FFFFFFEFED02AD0FEFEFE00FE2F2A" + $"2F2AFFFFFF322AD000FE0000FEFE2A2F" + $"FF2A0FFFD02A32FEFEFE00FEFEFF2AFF" + $"FF2D2FD02A32FE0000FEFEFEFF322AFF" + $"FFD02A2AD0FFFEFEFEFFFFFFD02A2DFF" + $"FFFF2D2A3207FEFFFFFFFFD02A2DFFFF" + $"FFFFFF2F2A2D2F2F2F2F2D2A2D0FFFFF" + $"FFFFFFFFFF2F2A2A2A2A2FFFFFFFFFFF" +}; diff --git a/src/servers/mail/install.sh b/src/servers/mail/install.sh index 339cfbb2ae..bbc0d1264e 100755 --- a/src/servers/mail/install.sh +++ b/src/servers/mail/install.sh @@ -9,10 +9,10 @@ Choose 'Backup' if you wish to keep your old mail_daemon, E-mail preferences app if [[ $RETURN = Purge ]] then # note: we don't remove libmail.so, because it doesn't matter here, and there may be symlinks and things - query -a 'BEOS:APP_SIG == "application/x-vnd.Be-POST" || BEOS:APP_SIG == "application/x-vnd.Be-mprf" || BEOS:APP_SIG == "application/x-vnd.Be-MAIL" || BEOS:APP_SIG == "application/x-vnd.agmsmith.AGMSBayesianSpamServer"' | grep -v "`/bin/pwd`" | xargs rm -f + query -a 'BEOS:APP_SIG == "application/x-vnd.Be-POST" || BEOS:APP_SIG == "application/x-vnd.Be-mprf" || BEOS:APP_SIG == "application/x-vnd.Be-MAIL" || BEOS:APP_SIG == "application/x-vnd.agmsmith.spamdbm" || BEOS:APP_SIG == "application/x-vnd.agmsmith.AGMSBayesianSpamServer"' | grep -v "`/bin/pwd`" | xargs rm -f elif [[ $RETURN = Backup ]] then - query -a 'BEOS:APP_SIG == "application/x-vnd.Be-POST" || BEOS:APP_SIG == "application/x-vnd.Be-mprf" || BEOS:APP_SIG == "application/x-vnd.Be-MAIL" || BEOS:APP_SIG == "application/x-vnd.agmsmith.AGMSBayesianSpamServer" || name == libmail.so' | grep -v "`/bin/pwd`" | xargs zip -ym /boot/home/maildaemon.zip + query -a 'BEOS:APP_SIG == "application/x-vnd.Be-POST" || BEOS:APP_SIG == "application/x-vnd.Be-mprf" || BEOS:APP_SIG == "application/x-vnd.Be-MAIL" || BEOS:APP_SIG == "application/x-vnd.agmsmith.spamdbm" || BEOS:APP_SIG == "application/x-vnd.agmsmith.AGMSBayesianSpamServer" || name == libmail.so' | grep -v "`/bin/pwd`" | xargs zip -ym /boot/home/maildaemon.zip else alert "No backup will be done. That means it's up to YOU to purge all of your old mail_daemons and ensure that the new version is the only version." exit -1 @@ -22,6 +22,8 @@ if [ -n "$TTY" ] then quit "application/x-vnd.Be-POST" quit "application/x-vnd.Be-TSKB" + quit "application/x-vnd.agmsmith.AGMSBayesianSpamServer" + quit "application/x-vnd.agmsmith.spamdbm" unzip -d / install.zip /boot/beos/system/Deskbar > /dev/null & else @@ -30,6 +32,8 @@ else then quit "application/x-vnd.Be-POST" quit "application/x-vnd.Be-TSKB" + quit "application/x-vnd.agmsmith.AGMSBayesianSpamServer" + quit "application/x-vnd.agmsmith.spamdbm" rm /boot/home/config/add-ons/mail_daemon/inbound_filters/AGMSBayesianSpamFilter rm /boot/home/config/lib/libtextencoding.so @@ -39,7 +43,7 @@ else # Reset the relevant parts of the MIME database setmime -remove application/x-vnd.Be-POST; mimeset /system/servers/mail_daemon setmime -remove application/x-vnd.Be-MAIL; mimeset /boot/beos/apps/BeMail - mimeset ~/config/bin/AGMSBayesianSpamServer + mimeset ~/config/bin/spamdbm setmime -set text/x-email -preferredApp /boot/beos/apps/BeMail -preferredAppSig application/x-vnd.Be-MAIL setmime -set text/x-vnd.be-maildraft -preferredApp /boot/beos/apps/BeMail -preferredAppSig application/x-vnd.Be-MAIL setmime -set text/x-partial-email -preferredApp /boot/beos/system/servers/mail_daemon -preferredAppSig application/x-vnd.Be-POST @@ -64,6 +68,9 @@ if test ! -e ~/config/lib/libssl.so && test -e ~/config/lib/libssl.so.0.9.7; the ln -s ~/config/lib/libcrypto.so.0.9.7 ~/config/lib/libcrypto.so fi +# Set up the spam database manager file types and sound file names, make spam indices. +spamdbm InstallThings + # Launch prefs if this is a new install of MDR if test ! -e "/boot/home/config/settings/Mail/chains"; then /boot/beos/preferences/E-mail &