From 2a7b6c25c8081461b8081b7717c83d9a763bf83c Mon Sep 17 00:00:00 2001 From: "Alexander G.M. Smith" Date: Sun, 14 Aug 2005 02:25:28 +0000 Subject: [PATCH] Source code changes so that mboxtobemail now compiles and is in the build system. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13961 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/bemail_utils/Jamfile | 23 ++++++++++++++++++++++ src/bin/bemail_utils/bemailtombox.cpp | 16 ++++++++++++--- src/bin/bemail_utils/mboxtobemail.cpp | 28 +++++++++++++++++++-------- src/bin/bemail_utils/spamdbm.cpp | 12 +++++++----- src/bin/bemail_utils/spamdbm.rdef | 1 - 5 files changed, 63 insertions(+), 17 deletions(-) diff --git a/src/bin/bemail_utils/Jamfile b/src/bin/bemail_utils/Jamfile index 488825cc6d..26cb20e2d9 100644 --- a/src/bin/bemail_utils/Jamfile +++ b/src/bin/bemail_utils/Jamfile @@ -1,7 +1,30 @@ SubDir OBOS_TOP src bin bemail_utils ; +UsePrivateHeaders mail ; + +StdBinCommands + bemailtombox.cpp + : be + : bemailtombox.rdef + ; +Package haiku-maildaemon-cvs : + bemailtombox : + boot home config bin ; + +StdBinCommands + mboxtobemail.cpp + : be libmail.so + : mboxtobemail.rdef + ; +Package haiku-maildaemon-cvs : + mboxtobemail : + boot home config bin ; + StdBinCommands spamdbm.cpp : be tracker stdc++.r4 libmail.so : spamdbm.rdef ; +Package haiku-maildaemon-cvs : + spamdbm : + boot home config bin ; diff --git a/src/bin/bemail_utils/bemailtombox.cpp b/src/bin/bemail_utils/bemailtombox.cpp index c21e353e02..0360de5ecf 100644 --- a/src/bin/bemail_utils/bemailtombox.cpp +++ b/src/bin/bemail_utils/bemailtombox.cpp @@ -8,7 +8,17 @@ * reduced. The resulting text is written to standard output. Command line * driven. * - * $Log: BeMailToMBox.cpp,v $ + * $Log: BeMailToMBox.cpp,v $ (now manually updated) + * r13960 | agmsmith | 2005-08-13 22:10:49 -0400 (Sat, 13 Aug 2005) | 3 lines + * More file movement for the BeMail utilities... Content updates later to + * avoid confusing svn. + * + * r13955 | agmsmith | 2005-08-13 19:43:41 -0400 (Sat, 13 Aug 2005) | 5 lines + * Half way through adding some more BeMail related utilities - they use + * libmail.so which isn't backwards compatibile so they need recompiling for + * Haiku - thus better to include them here. Also want spam levels of 1E-6 to + * be visible for genuine messages. + * * Revision 1.1 2002/02/24 18:16:46 agmsmith * Initial revision */ @@ -369,7 +379,7 @@ int main (int argc, char** argv) status_t ErrorCode; char InputPathName [B_PATH_NAME_LENGTH]; int MessagesDoneCount = 0; - BApplication MyApp ("application/x-vnd.agmsmith.BeMailToMBox"); + BApplication MyApp ("application/x-vnd.agmsmith.bemailtombox"); const char *StringPntr; char TempString [1024 + 256]; @@ -383,7 +393,7 @@ int main (int argc, char** argv) printf ("bemailtombox InputDirectory >OutputFile\n\n"); printf ("Public domain, by Alexander G. M. Smith.\n"); printf ("$Id:$\n"); - printf ("$HeadURL: $\n"); + printf ("$HeadURL$\n"); return -10; } diff --git a/src/bin/bemail_utils/mboxtobemail.cpp b/src/bin/bemail_utils/mboxtobemail.cpp index 511336c342..a27d78b1ee 100644 --- a/src/bin/bemail_utils/mboxtobemail.cpp +++ b/src/bin/bemail_utils/mboxtobemail.cpp @@ -19,6 +19,16 @@ * from the version history pages on BeBits) if you don't want to install MDR. * * $Log: MailboxToBeMail.cpp,v $ (manually updated now that SVN is used) + * r13960 | agmsmith | 2005-08-13 22:10:49 -0400 (Sat, 13 Aug 2005) | 3 lines + * More file movement for the BeMail utilities... Content updates later to + * avoid confusing svn. + * + * r13955 | agmsmith | 2005-08-13 19:43:41 -0400 (Sat, 13 Aug 2005) | 5 lines + * Half way through adding some more BeMail related utilities - they use + * libmail.so which isn't backwards compatibile so they need recompiling for + * Haiku - thus better to include them here. Also want spam levels of 1E-6 to + * be visible for genuine messages. + * * Revision 1.9 2003/12/31 00:37:46 agmsmith * Use the MDR date parsing routine rather than parsedate, so it * can handle newer date formats. @@ -66,7 +76,8 @@ #include /* MDR headers (get the MDR source and add the MDR include/public and -include/numail directories to the project path settings). */ +include/numail directories to the project path settings). Or just use +the Haiku build process which is already set up to include the right ones. */ #include #include @@ -392,7 +403,7 @@ status_t SaveMessage (BString &MessageText) BString HeaderValues [STD_HDR_MAX]; int i; int Length; - Zoidberg::Mail::Message MailMessage; + BEmailMessage MailMessage; BFile OutputFile; char TempString [80]; struct tm TimeFields; @@ -442,12 +453,12 @@ status_t SaveMessage (BString &MessageText) } HeaderValues[STD_HDR_THREAD] = HeaderValues[STD_HDR_SUBJECT]; - Zoidberg::Mail::SubjectToThread (HeaderValues[STD_HDR_THREAD]); + SubjectToThread (HeaderValues[STD_HDR_THREAD]); if (HeaderValues[STD_HDR_THREAD].Length() <= 0) HeaderValues[STD_HDR_THREAD] = "No Subject"; HeaderValues[STD_HDR_NAME] = HeaderValues[STD_HDR_FROM]; - Zoidberg::Mail::extract_address_name (HeaderValues[STD_HDR_NAME]); + extract_address_name (HeaderValues[STD_HDR_NAME]); // Generate a file name for the incoming message. @@ -459,7 +470,7 @@ status_t SaveMessage (BString &MessageText) // sorting by file name will give all the messages with the same subject in // order of date. - DateInSeconds = Zoidberg::Mail:: + DateInSeconds = ParseDateWithTimeZone (HeaderValues[STD_HDR_DATE].String()); if (DateInSeconds == -1) DateInSeconds = 0; /* Set it to the earliest time if date isn't known. */ @@ -552,7 +563,7 @@ int main (int argc, char** argv) bool HaveOldMessage = false; int MessagesDoneCount = 0; BString MessageText; - BApplication MyApp ("application/x-vnd.agmsmith.MailboxFileToBeMail"); + BApplication MyApp ("application/x-vnd.agmsmith.mboxtobemail"); int NextArgIndex; char OutputDirectoryPathName [B_PATH_NAME_LENGTH]; status_t ReturnCode = -1; @@ -574,9 +585,10 @@ int main (int argc, char** argv) printf ("separator text line at the top of each message, the default\n"); printf ("is to lose it.\n\n"); printf ("Usage:\n\n"); - printf ("MailboxFileToBeMail [-s] InputFile [OutputDirectory]\n\n"); + printf ("mboxtobemail [-s] InputFile [OutputDirectory]\n\n"); printf ("Public domain, by Alexander G. M. Smith.\n"); - printf ("$Header: /CommonBe/agmsmith/Programming/MailboxFileToBeMail/RCS/MailboxToBeMail.cpp,v 1.9 2003/12/31 00:37:46 agmsmith Exp $\n"); + printf ("$Id$\n"); + printf ("$HeadURL$\n"); return -10; } diff --git a/src/bin/bemail_utils/spamdbm.cpp b/src/bin/bemail_utils/spamdbm.cpp index 7b73db432b..664b952d90 100644 --- a/src/bin/bemail_utils/spamdbm.cpp +++ b/src/bin/bemail_utils/spamdbm.cpp @@ -63,11 +63,13 @@ * gets the rating back from the server, and then the rest of the mail system * rule chain can delete the message or otherwise manipulate it. * - * $Log: spamfilter.cpp,v $ - * (no longer automatic - The SVN version control system used for the Haiku - * project doesn't support the Log: keyword on philosophical grounds - and they - * assume that the file will always be in SVN, and not some other source - * control system, as if!). + * $Log: spamfilter.cpp,v $ (now manually updated due to SVN) + * r13959 | agmsmith | 2005-08-13 22:05:27 -0400 (Sat, 13 Aug 2005) | 2 lines + * Rename the directory before doing anything else, otherwise svn dies badly. + * + * r13952 | agmsmith | 2005-08-13 15:31:42 -0400 (Sat, 13 Aug 2005) | 3 lines + * Added the resources and file type associations, changed the application + * signature and otherwise made the spam detection system work properly again. * * 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. diff --git a/src/bin/bemail_utils/spamdbm.rdef b/src/bin/bemail_utils/spamdbm.rdef index f6185fb06f..1b2306064d 100644 --- a/src/bin/bemail_utils/spamdbm.rdef +++ b/src/bin/bemail_utils/spamdbm.rdef @@ -7,7 +7,6 @@ resource app_flags B_SINGLE_LAUNCH; resource app_signature "application/x-vnd.agmsmith.spamdbm"; resource app_version { - major = 3, middle = 0, minor = 0,