[haiku-commits] BRANCH axeld-github.imap - docs/userguide src/libs/jpeg data/artwork src/libs/png src

  • From: axeld-github.imap <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 30 Oct 2012 23:48:50 +0100 (CET)

added 7 changesets to branch 'refs/remotes/axeld-github/imap'
old head: bdcd91c38ab8312d0fb02403d9424b7f0ca59b12
new head: 0721a947e458cf92a5f7fd4d0084aefb12a4f2d4

----------------------------------------------------------------------------

bdbcdef: Adapted fortune filter to the new mail API.

4ec4b5f: Renamed a few files to better match their class names.

c4c9fe2: Moved ProtocolConfigView to headers/private/mail.
  
  * This is by no means meant as a public header.

5c37f61: Completed transition to the new mail API; ie. it compiles.
  
  * Completely untested yet. Unlikely to work yet.

18747d6: Renamed smtp.{cpp|h} to SMTP.{cpp|h}.

533a796: IMAP now compiles again with GCC 4.

0721a94: Merge branch 'github-master' into imap
  
  Conflicts:
        src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp

                                   [ Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

1855 files changed, 31037 insertions(+), 74074 deletions(-)
3rdparty/mmu_man/irc/Haiku/README.txt            |    2 +
3rdparty/mmu_man/irc/Haiku/__init__.py           |   64 +
3rdparty/mmu_man/irc/Haiku/config.py             |   50 +
3rdparty/mmu_man/irc/Haiku/errors.py             |  248 +
3rdparty/mmu_man/irc/Haiku/gen_err_list.py       |  129 +
3rdparty/mmu_man/irc/Haiku/plugin.py             |  249 +
3rdparty/mmu_man/irc/Haiku/test.py               |   47 +
3rdparty/mmu_man/scripts/dev-perso               |    3 +
build/jam/BuildSetup                             |    2 +-
build/jam/HaikuCD                                |    2 -
build/jam/HaikuImage                             |   57 +-
build/jam/ImageRules                             |   35 +-
build/jam/LocaleRules                            |    9 +-
build/jam/OptionalBuildFeatures                  |  164 +-
build/jam/OptionalLibPackages                    |  240 +-
build/jam/OptionalPackageDependencies            |    1 +
build/jam/OptionalPackages                       |  688 +--
build/jam/ReleaseBuildProfiles                   |    4 +-
build/jam/UserBuildConfig.ReadMe                 |    1 +
build/jam/board/raspberry_pi/BoardSetup          |    2 +-
build/jam/board/raspberry_pi/info.txt            |   14 +-
build/scripts/build_cross_tools                  |    2 +-
build/scripts/build_cross_tools_gcc4             |    2 +-
build/scripts/build_haiku_image                  |    6 +-
configure                                        |    2 +-
data/artwork/GET HAIKU - download box 2          |  Bin 1951529 -> 2894403 bytes
.../HAIKU logo - black on white - installer      |  Bin 199646 -> 231320 bytes
.../HAIKU logo - black on white - installer.png  |  Bin 19273 -> 19204 bytes
data/artwork/alpha-numbers-stamp                 |  Bin 47778 -> 47778 bytes
data/bin/installoptionalpackage                  |    4 +-
.../catalogs/add-ons/disk_systems/bfs/nb.catkeys |   14 +-
.../catalogs/add-ons/disk_systems/bfs/ru.catkeys |    6 +-
.../catalogs/add-ons/disk_systems/bfs/sv.catkeys |    8 +-
.../add-ons/disk_systems/intel/sv.catkeys        |    2 +-
.../input_server/devices/keyboard/nb.catkeys     |    8 +-
.../input_server/devices/keyboard/sv.catkeys     |   10 +-
.../inbound_filters/match_header/fr.catkeys      |    4 +-
.../inbound_filters/match_header/nb.catkeys      |   13 +
.../inbound_filters/match_header/sv.catkeys      |   18 +-
.../inbound_filters/match_header/zh-Hans.catkeys |    3 +-
.../inbound_filters/notifier/fr.catkeys          |    2 +-
.../inbound_filters/notifier/nb.catkeys          |   16 +
.../inbound_filters/notifier/ru.catkeys          |    8 +-
.../inbound_filters/notifier/sv.catkeys          |   16 +-
.../inbound_filters/spam_filter/fr.catkeys       |    3 +-
.../inbound_filters/spam_filter/ru.catkeys       |    9 +
.../inbound_filters/spam_filter/sv.catkeys       |   10 +-
.../inbound_protocols/imap/nb.catkeys            |    9 +
.../inbound_protocols/imap/ru.catkeys            |    8 +
.../inbound_protocols/imap/sv.catkeys            |    8 +-
.../inbound_protocols/pop3/fr.catkeys            |    9 +-
.../inbound_protocols/pop3/nb.catkeys            |   16 +
.../inbound_protocols/pop3/ru.catkeys            |   16 +
.../inbound_protocols/pop3/sv.catkeys            |   27 +-
.../outbound_filters/fortune/fr.catkeys          |    5 +-
.../outbound_filters/fortune/nb.catkeys          |    4 +
.../outbound_filters/fortune/ru.catkeys          |    2 +
.../outbound_filters/fortune/sv.catkeys          |    2 +-
.../outbound_protocols/smtp/fr.catkeys           |    9 +-
.../outbound_protocols/smtp/ja.catkeys           |    5 +-
.../outbound_protocols/smtp/nb.catkeys           |   15 +-
.../outbound_protocols/smtp/ru.catkeys           |    2 +
.../outbound_protocols/smtp/sk.catkeys           |    5 +-
.../outbound_protocols/smtp/sv.catkeys           |   19 +-
.../outbound_protocols/smtp/zh-Hans.catkeys      |    5 +-
.../add-ons/media/media-add-ons/mixer/nb.catkeys |    4 +
.../add-ons/media/media-add-ons/mixer/ru.catkeys |   27 +
.../add-ons/media/media-add-ons/mixer/sv.catkeys |   28 +-
.../media/media-add-ons/mixer/zh-Hans.catkeys    |   19 +-
.../add-ons/screen_savers/flurry/nb.catkeys      |    3 +-
.../add-ons/screen_savers/glife/be.catkeys       |   15 +
.../add-ons/screen_savers/glife/de.catkeys       |   15 +
.../add-ons/screen_savers/glife/fi.catkeys       |   15 +
.../add-ons/screen_savers/glife/fr.catkeys       |   15 +
.../add-ons/screen_savers/glife/ja.catkeys       |   15 +
.../add-ons/screen_savers/glife/nb.catkeys       |   12 +
.../add-ons/screen_savers/glife/sk.catkeys       |   15 +
.../add-ons/screen_savers/glife/sv.catkeys       |   15 +
.../add-ons/screen_savers/glife/zh-Hans.catkeys  |   15 +
.../add-ons/screen_savers/ifs/nb.catkeys         |    5 +-
.../add-ons/screen_savers/ifs/sv.catkeys         |    5 +-
.../add-ons/screen_savers/ifs/zh-Hans.catkeys    |    4 +-
.../add-ons/screen_savers/leaves/fr.catkeys      |    2 +-
.../add-ons/screen_savers/leaves/sv.catkeys      |    4 +-
.../screen_savers/slideshowsaver/ru.catkeys      |    2 +-
.../add-ons/screen_savers/spider/sv.catkeys      |   16 +-
.../add-ons/tracker/zipomatic/fr.catkeys         |    2 +-
.../add-ons/tracker/zipomatic/sv.catkeys         |   20 +-
data/catalogs/add-ons/translators/bmp/sv.catkeys |   10 +-
data/catalogs/add-ons/translators/exr/be.catkeys |    6 +-
data/catalogs/add-ons/translators/exr/de.catkeys |    6 +-
data/catalogs/add-ons/translators/exr/el.catkeys |    4 +-
data/catalogs/add-ons/translators/exr/fi.catkeys |    4 +-
data/catalogs/add-ons/translators/exr/fr.catkeys |    6 +-
data/catalogs/add-ons/translators/exr/hi.catkeys |    4 +-
data/catalogs/add-ons/translators/exr/ja.catkeys |    6 +-
data/catalogs/add-ons/translators/exr/lt.catkeys |    4 +-
data/catalogs/add-ons/translators/exr/nb.catkeys |    4 +-
data/catalogs/add-ons/translators/exr/nl.catkeys |    4 +-
[ *** stats truncated: 1756 lines dropped *** ]

############################################################################

Commit:      bdbcdefa744d2d3bd04287250f921d45aeec6d3d

Author:      Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Tue Oct 30 19:30:50 2012 UTC

Adapted fortune filter to the new mail API.

----------------------------------------------------------------------------

diff --git a/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.cpp 
b/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.cpp
index be7d4bd..03d32cf 100644
--- a/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.cpp
+++ b/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.cpp
@@ -1,17 +1,21 @@
-/* ConfigView - the configuration view for the Fortune filter
-**
-** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
-*/
+/*
+ * Copyright 2004-2012, Haiku, Inc. All rights reserved.
+ * Copyright 2001, Dr. Zoidberg Enterprises. All rights reserved.
+ *
+ * Distributed under the terms of the MIT License.
+ */
 
 
 #include "ConfigView.h"
 
 #include <Catalog.h>
-#include <TextControl.h>
-#include <String.h>
+#include <LayoutBuilder.h>
 #include <Message.h>
+#include <String.h>
+#include <TextControl.h>
+
 
-#include <FileConfigView.h>
+using namespace BPrivate;
 
 
 #undef B_TRANSLATION_CONTEXT
@@ -20,74 +24,45 @@
 
 ConfigView::ConfigView()
        :
-       BView(BRect(0, 0, 20, 20), "fortune_filter", B_FOLLOW_LEFT | 
B_FOLLOW_TOP,
-               0)
+       BView("fortune_filter", 0)
 {
        SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 
-       // determine font height
-       font_height fontHeight;
-       GetFontHeight(&fontHeight);
-       float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent
-               + fontHeight.leading) + 13;
-
-       BRect rect(5,4,250,25);
-       rect.bottom = rect.top - 2 + itemHeight;
-       BMailFileConfigView *fview = new BMailFileConfigView(
-               B_TRANSLATE("Fortune file:"), "fortune_file", false, "", 
B_FILE_NODE);
-       AddChild(fview);
-
-       rect.top = rect.bottom + 8;
-       rect.bottom = rect.top - 2 + itemHeight;
-       BTextControl * control = new BTextControl(rect, "tag_line",
-               B_TRANSLATE("Tag line:"), NULL, NULL);
-       control->SetDivider(control->StringWidth(control->Label()) + 6);
-       AddChild(control);
-
-       ResizeToPreferred();
+       fFileView = new MailFileConfigView(B_TRANSLATE("Fortune file:"),
+               "fortune_file", false, "", B_FILE_NODE);
+       fTagControl = new BTextControl("tag_line", B_TRANSLATE("Tag line:"),
+               NULL, NULL);
+
+       BLayoutBuilder::Group<>(this, B_VERTICAL)
+               .Add(fFileView)
+               .Add(fTagControl);
 }
 
 
-void ConfigView::SetTo(const BMessage *archive)
+void
+ConfigView::SetTo(const BMessage* archive)
 {
-       BMailFileConfigView* control = (BMailFileConfigView*)FindView(
-               "fortune_file");
-       if (control != NULL)
-               control->SetTo(archive, NULL);
+       fFileView->SetTo(archive, NULL);
 
        BString path = archive->FindString("tag_line");
        if (!archive->HasString("tag_line"))
                path = B_TRANSLATE("Fortune cookie says:\n\n");
 
        path.Truncate(path.Length() - 2);
-       if (BTextControl *control = (BTextControl *)FindView("tag_line"))
-               control->SetText(path.String());
+       fTagControl->SetText(path.String());
 }
 
 
-status_t ConfigView::Archive(BMessage *into,bool) const
+status_t
+ConfigView::Archive(BMessage* into, bool /*deep*/) const
 {
-       if (BMailFileConfigView *control = (BMailFileConfigView
-               *)FindView("fortune_file"))
-       {
-               control->Archive(into);
-       }
-
-       if (BTextControl *control = (BTextControl *)FindView("tag_line"))
-       {
-               BString line = control->Text();
-               if (line != B_EMPTY_STRING)
-                       line << "\n\n";
-               if (into->ReplaceString("tag_line", line.String()) != B_OK)
-                       into->AddString("tag_line", line.String());
-       }
-       return B_OK;
-}
+       fFileView->Archive(into);
 
+       BString line = fTagControl->Text();
+       if (line != B_EMPTY_STRING)
+               line << "\n\n";
+       if (into->ReplaceString("tag_line", line.String()) != B_OK)
+               into->AddString("tag_line", line.String());
 
-void ConfigView::GetPreferredSize(float *width, float *height)
-{
-       *width = 258;
-       *height = (ChildAt(0)->Bounds().Height() + 8) * CountChildren();
+       return B_OK;
 }
-
diff --git a/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.h 
b/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.h
index 5f4d0ef..9ff3cd0 100644
--- a/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.h
+++ b/src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.h
@@ -1,22 +1,27 @@
-#ifndef CONFIG_VIEW
-#define CONFIG_VIEW
-/* ConfigView - the configuration view for the Folder filter
-**
-** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
-*/
+/*
+ * Copyright 2004-2012, Haiku, Inc. All rights reserved.
+ * Copyright 2001, Dr. Zoidberg Enterprises. All rights reserved.
+ *
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef CONFIG_VIEW_H
+#define CONFIG_VIEW_H
 
 
-#include <View.h>
+#include <FileConfigView.h>
 
 
-class ConfigView : public BView
-{
-       public:
-               ConfigView();
-               void SetTo(const BMessage *archive);
+class ConfigView : public BView {
+public:
+                                                               ConfigView();
+                       void                            SetTo(const BMessage* 
archive);
 
-               virtual status_t Archive(BMessage *into, bool deep = true) 
const;
-               virtual void GetPreferredSize(float *width, float *height);
+       virtual status_t                        Archive(BMessage* into, bool 
deep = true) const;
+
+private:
+                       BPrivate::MailFileConfigView* fFileView;
+                       BTextControl*           fTagControl;
 };
 
-#endif /* CONFIG_VIEW */
+
+#endif // CONFIG_VIEW_H
diff --git a/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile 
b/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile
index 5ece11f..37a2f24 100644
--- a/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile
+++ b/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile
@@ -1,6 +1,5 @@
 SubDir HAIKU_TOP src add-ons mail_daemon outbound_filters fortune ;
 
-
 UsePrivateHeaders mail shared ;
 UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
 
@@ -19,4 +18,5 @@ DoCatalogs Fortune :
        x-vnd.Haiku-Fortune
        :
        ConfigView.cpp
+       filter.cpp
 ;
diff --git a/src/add-ons/mail_daemon/outbound_filters/fortune/filter.cpp 
b/src/add-ons/mail_daemon/outbound_filters/fortune/filter.cpp
index e737a2e..63560bc 100644
--- a/src/add-ons/mail_daemon/outbound_filters/fortune/filter.cpp
+++ b/src/add-ons/mail_daemon/outbound_filters/fortune/filter.cpp
@@ -1,15 +1,21 @@
-/* Add Fortune - adds fortunes to your mail
-**
-** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
-*/
+/*
+ * Copyright 2004-2012, Haiku, Inc. All rights reserved.
+ * Copyright 2001, Dr. Zoidberg Enterprises. All rights reserved.
+ *
+ * Distributed under the terms of the MIT License.
+ */
+
+
+//!    Adds fortunes to your mail
 
 
 #include "ConfigView.h"
 
+#include <Catalog.h>
 #include <Message.h>
 #include <Entry.h>
 #include <String.h>
-#include <MailAddon.h>
+#include <MailFilter.h>
 #include <MailMessage.h>
 
 #include <stdio.h>
@@ -17,46 +23,59 @@
 #include "NodeMessage.h"
 
 
-class FortuneFilter : public MailFilter
-{
+#undef B_TRANSLATION_CONTEXT
+#define B_TRANSLATION_CONTEXT "FortuneFilter"
+
+
+class FortuneFilter : public BMailFilter {
 public:
-                                                               
FortuneFilter(MailProtocol& protocol,
-                                                                       
AddonSettings* settings);
-                       void                            
MessageReadyToSend(const entry_ref& ref,
+                                                               
FortuneFilter(BMailProtocol& protocol,
+                                                                       
BMailAddOnSettings* settings);
+
+       virtual BString                         DescriptiveName() const;
+
+       virtual void                            MessageReadyToSend(const 
entry_ref& ref,
                                                                        BFile* 
file);
 };
 
 
-FortuneFilter::FortuneFilter(MailProtocol& protocol, AddonSettings* settings)
+FortuneFilter::FortuneFilter(BMailProtocol& protocol,
+       BMailAddOnSettings* settings)
        :
-       MailFilter(protocol, settings)
+       BMailFilter(protocol, settings)
 {
 
 }
 
 
+BString
+FortuneFilter::DescriptiveName() const
+{
+       return filter_name();
+}
+
+
 void
 FortuneFilter::MessageReadyToSend(const entry_ref& ref, BFile* file)
 {
        // What we want to do here is to change the message body. To do that we 
use the
        // framework we already have by creating a new BEmailMessage based on 
the
        // BPositionIO, changing the message body and rendering it back to 
disk. Of course
-       // this method ends up not being super-efficient, but it works. Ideas 
on how to 
+       // this method ends up not being super-efficient, but it works. Ideas 
on how to
        // improve this are welcome.
        BString fortuneFile;
        BString tagLine;
 
-       const BMessage* settings = &fAddonSettings->Settings();
        // Obtain relevant settings
-       settings->FindString("fortune_file", &fortuneFile);
-       settings->FindString("tag_line", &tagLine);
-       
+       fSettings->FindString("fortune_file", &fortuneFile);
+       fSettings->FindString("tag_line", &tagLine);
+
        // Add command to be executed
        fortuneFile.Prepend("/bin/fortune ");
-       
+
        char buffer[768];
        FILE *fd;
-       
+
        fd = popen(fortuneFile.String(), "r");
        if (!fd) {
                printf("Could not open pipe to fortune!\n");
@@ -83,18 +102,28 @@ FortuneFilter::MessageReadyToSend(const entry_ref& ref, 
BFile* file)
 }
 
 
-MailFilter*
-instantiate_mailfilter(MailProtocol& protocol, AddonSettings* settings)
+// #pragma mark -
+
+
+BString
+filter_name()
+{
+       return B_TRANSLATE("Fortune");
+}
+
+
+BMailFilter*
+instantiate_filter(BMailProtocol& protocol, BMailAddOnSettings* settings)
 {
        return new FortuneFilter(protocol, settings);
 }
 
 
 BView*
-instantiate_filter_config_panel(AddonSettings& settings)
+instantiate_filter_config_panel(BMailAddOnSettings& settings)
 {
-       ConfigView *view = new ConfigView();
-       view->SetTo(&settings.Settings());
+       ConfigView* view = new ConfigView();
+       view->SetTo(&settings);
 
        return view;
 }

############################################################################

Commit:      4ec4b5f62116d5f7c57f9f2ab2a6cf157afc0899

Author:      Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Tue Oct 30 19:37:51 2012 UTC

Renamed a few files to better match their class names.

----------------------------------------------------------------------------

diff --git a/src/add-ons/mail_daemon/inbound_filters/notifier/Jamfile 
b/src/add-ons/mail_daemon/inbound_filters/notifier/Jamfile
index ffef889..74fd2c5 100644
--- a/src/add-ons/mail_daemon/inbound_filters/notifier/Jamfile
+++ b/src/add-ons/mail_daemon/inbound_filters/notifier/Jamfile
@@ -5,11 +5,11 @@ UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
 
 SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
 
-AddResources NewMailNotification : NewMailNotification.rdef ;
+AddResources NewMailNotification : NotifierFilter.rdef ;
 
 Addon NewMailNotification :
-       filter.cpp
-       ConfigView.cpp
+       NotifierFilter.cpp
+       NotifierConfigView.cpp
        :
        be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
        ;
@@ -17,6 +17,6 @@ Addon NewMailNotification :
 DoCatalogs NewMailNotification :
        x-vnd.Haiku-NewMailNotification
        :
-       ConfigView.cpp
-       filter.cpp
+       NotifierFilter.cpp
+       NotifierConfigView.cpp
 ;
diff --git a/src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.cpp 
b/src/add-ons/mail_daemon/inbound_filters/notifier/NotifierConfigView.cpp
similarity index 87%
rename from src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.cpp
rename to 
src/add-ons/mail_daemon/inbound_filters/notifier/NotifierConfigView.cpp
index 0f48672..3827514 100644
--- a/src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.cpp
+++ b/src/add-ons/mail_daemon/inbound_filters/notifier/NotifierConfigView.cpp
@@ -6,7 +6,7 @@
  */
 
 
-#include "ConfigView.h"
+#include "NotifierConfigView.h"
 
 #include <Catalog.h>
 #include <CheckBox.h>
@@ -22,13 +22,13 @@
 
 
 #undef B_TRANSLATION_CONTEXT
-#define B_TRANSLATION_CONTEXT "ConfigView"
+#define B_TRANSLATION_CONTEXT "NotifierConfigView"
 
 
 const uint32 kMsgNotifyMethod = 'nomt';
 
 
-ConfigView::ConfigView()
+NotifierConfigView::NotifierConfigView()
        :
        BView("notifier_config", 0)
 {
@@ -55,7 +55,7 @@ ConfigView::ConfigView()
 
 
 void
-ConfigView::AttachedToWindow()
+NotifierConfigView::AttachedToWindow()
 {
        if (BMenuField *field = dynamic_cast<BMenuField *>(FindView("notify")))
                field->Menu()->SetTargetForItems(this);
@@ -63,7 +63,7 @@ ConfigView::AttachedToWindow()
 
 
 void
-ConfigView::SetTo(const BMessage *archive)
+NotifierConfigView::SetTo(const BMessage *archive)
 {
        int32 method = archive->FindInt32("notification_method");
        if (method < 0)
@@ -82,7 +82,7 @@ ConfigView::SetTo(const BMessage *archive)
 
 
 void
-ConfigView::UpdateNotifyText()
+NotifierConfigView::UpdateNotifyText()
 {
        BMenuField *field;
        if ((field = dynamic_cast<BMenuField *>(FindView("notify"))) == NULL)
@@ -105,7 +105,7 @@ ConfigView::UpdateNotifyText()
 
 
 void
-ConfigView::MessageReceived(BMessage *msg)
+NotifierConfigView::MessageReceived(BMessage *msg)
 {
        switch (msg->what) {
                case kMsgNotifyMethod:
@@ -125,7 +125,7 @@ ConfigView::MessageReceived(BMessage *msg)
 
 
 status_t
-ConfigView::Archive(BMessage *into, bool /*deep*/) const
+NotifierConfigView::Archive(BMessage *into, bool /*deep*/) const
 {
        int32 method = 0;
 
@@ -151,7 +151,7 @@ ConfigView::Archive(BMessage *into, bool /*deep*/) const
 BView*
 instantiate_filter_config_panel(BMailAddOnSettings& settings)
 {
-       ConfigView *view = new ConfigView();
+       NotifierConfigView *view = new NotifierConfigView();
        view->SetTo(&settings);
        return view;
 }
diff --git a/src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.h 
b/src/add-ons/mail_daemon/inbound_filters/notifier/NotifierConfigView.h
similarity index 78%
rename from src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.h
rename to src/add-ons/mail_daemon/inbound_filters/notifier/NotifierConfigView.h
index db95ef0..d5b353b 100644
--- a/src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.h
+++ b/src/add-ons/mail_daemon/inbound_filters/notifier/NotifierConfigView.h
@@ -4,8 +4,8 @@
  *
  * Distributed under the terms of the MIT License.
  */
-#ifndef CONFIG_VIEW_H
-#define CONFIG_VIEW_H
+#ifndef NOTIFIER_CONFIG_VIEW_H
+#define NOTIFIER_CONFIG_VIEW_H
 
 
 #include <View.h>
@@ -21,9 +21,9 @@ enum {
 };
 
 
-class ConfigView : public BView {
+class NotifierConfigView : public BView {
 public:
-                                                               ConfigView();
+                                                               
NotifierConfigView();
 
                        void                            SetTo(const BMessage 
*archive);
 
@@ -36,4 +36,4 @@ public:
 };
 
 
-#endif // CONFIG_VIEW_H
+#endif // NOTIFIER_CONFIG_VIEW_H
diff --git a/src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp 
b/src/add-ons/mail_daemon/inbound_filters/notifier/NotifierFilter.cpp
similarity index 97%
rename from src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp
rename to src/add-ons/mail_daemon/inbound_filters/notifier/NotifierFilter.cpp
index 82cc6ff..2643432 100644
--- a/src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp
+++ b/src/add-ons/mail_daemon/inbound_filters/notifier/NotifierFilter.cpp
@@ -20,11 +20,11 @@
 
 #include <MailFilter.h>
 
-#include "ConfigView.h"
+#include "NotifierConfigView.h"
 
 
 #undef B_TRANSLATION_CONTEXT
-#define B_TRANSLATION_CONTEXT "filter"
+#define B_TRANSLATION_CONTEXT "NotifierFilter"
 
 
 class NotifyFilter : public BMailFilter {
diff --git 
a/src/add-ons/mail_daemon/inbound_filters/notifier/NewMailNotification.rdef 
b/src/add-ons/mail_daemon/inbound_filters/notifier/NotifierFilter.rdef
similarity index 100%
rename from 
src/add-ons/mail_daemon/inbound_filters/notifier/NewMailNotification.rdef
rename to src/add-ons/mail_daemon/inbound_filters/notifier/NotifierFilter.rdef
diff --git a/src/add-ons/mail_daemon/outbound_filters/fortune/filter.cpp 
b/src/add-ons/mail_daemon/outbound_filters/fortune/FortuneFilter.cpp
similarity index 100%
rename from src/add-ons/mail_daemon/outbound_filters/fortune/filter.cpp
rename to src/add-ons/mail_daemon/outbound_filters/fortune/FortuneFilter.cpp
diff --git a/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile 
b/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile
index 37a2f24..c5a2ace 100644
--- a/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile
+++ b/src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile
@@ -9,7 +9,7 @@ AddResources Fortune : Fortune.rdef ;
 
 Addon Fortune :
        ConfigView.cpp
-       filter.cpp
+       FortuneFilter.cpp
        :
        be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
 ;
@@ -18,5 +18,5 @@ DoCatalogs Fortune :
        x-vnd.Haiku-Fortune
        :
        ConfigView.cpp
-       filter.cpp
+       FortuneFilter.cpp
 ;

############################################################################

Commit:      c4c9fe21079927254fabe2f2289fb2d0439b1888

Author:      Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Tue Oct 30 19:42:13 2012 UTC

Moved ProtocolConfigView to headers/private/mail.

* This is by no means meant as a public header.

----------------------------------------------------------------------------

diff --git a/headers/os/add-ons/mail_daemon/ProtocolConfigView.h 
b/headers/private/mail/ProtocolConfigView.h
similarity index 100%
rename from headers/os/add-ons/mail_daemon/ProtocolConfigView.h
rename to headers/private/mail/ProtocolConfigView.h

############################################################################

Commit:      5c37f61eaa2b19ba5354597b73cbb7add469ae04

Author:      Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Tue Oct 30 21:45:54 2012 UTC

Completed transition to the new mail API; ie. it compiles.

* Completely untested yet. Unlikely to work yet.

----------------------------------------------------------------------------

diff --git a/headers/os/add-ons/mail_daemon/MailFilter.h 
b/headers/os/add-ons/mail_daemon/MailFilter.h
index 69b9f73..00c66ea 100644
--- a/headers/os/add-ons/mail_daemon/MailFilter.h
+++ b/headers/os/add-ons/mail_daemon/MailFilter.h
@@ -2,8 +2,8 @@
  * Copyright 2011-2012, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  */
-#ifndef MAIL_FILTER_H
-#define MAIL_FILTER_H
+#ifndef _MAIL_FILTER_H
+#define _MAIL_FILTER_H
 
 
 #include "MailProtocol.h"
@@ -47,4 +47,4 @@ extern "C" BMailFilter* instantiate_filter(BMailProtocol& 
protocol,
 extern "C" BString filter_name();
 
 
-#endif // MAIL_FILTER_H
+#endif // _MAIL_FILTER_H
diff --git a/headers/os/add-ons/mail_daemon/MailProtocol.h 
b/headers/os/add-ons/mail_daemon/MailProtocol.h
index 85f9965..299ca8e 100644
--- a/headers/os/add-ons/mail_daemon/MailProtocol.h
+++ b/headers/os/add-ons/mail_daemon/MailProtocol.h
@@ -1,16 +1,16 @@
-/* Protocol - the base class for protocol filters
- *
+/*
+ * Copyright 2004-2012, Haiku, Inc. All Rights Reserved.
  * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
  * Copyright 2011 Clemens Zeidler. All rights reserved.
-*/
-#ifndef MAIL_PROTOCOL_H
-#define MAIL_PROTOCOL_H
+ *
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _MAIL_PROTOCOL_H
+#define _MAIL_PROTOCOL_H
 
 
 #include <map>
-#include <vector>
 
-#include <Handler.h>
 #include <Looper.h>
 #include <OS.h>
 #include <ObjectList.h>
@@ -22,6 +22,7 @@
 
 
 class BMailFilter;
+class BView;
 
 
 class BMailNotifier {
@@ -41,7 +42,7 @@ public:
 };
 
 
-class BMailProtocol : BLooper {
+class BMailProtocol : public BLooper {
 public:
                                                                BMailProtocol(
                                                                        const 
BMailAccountSettings& settings);
@@ -74,6 +75,12 @@ public:
                        void                            ShowError(const char* 
error);
                        void                            ShowMessage(const char* 
message);
 
+#if __GNUC__ > 2
+                       // Unhide virtual base methods
+                       using BHandler::AddFilter;
+                       using BHandler::RemoveFilter;
+#endif
+
 protected:
                        void                            SetTotalItems(uint32 
items);
                        void                            
SetTotalItemsSize(uint64 size);
@@ -136,9 +143,8 @@ public:
 
        virtual void                            MessageReceived(BMessage* 
message);
 
-       virtual status_t                        SendMessages(
-                                                                       const 
std::vector<entry_ref>& mails,
-                                                                       size_t 
totalBytes) = 0;
+       virtual status_t                        SendMessages(const BMessage& 
message,
+                                                                       off_t 
totalBytes) = 0;
 };
 
 
@@ -151,4 +157,4 @@ extern "C" _EXPORT BView* instantiate_protocol_config_panel(
        BMailAccountSettings& settings);
 
 
-#endif // MAIL_PROTOCOL_H
+#endif // _MAIL_PROTOCOL_H
diff --git a/headers/os/mail/MailDaemon.h b/headers/os/mail/MailDaemon.h
index 4cef96a..66e8ccb 100644
--- a/headers/os/mail/MailDaemon.h
+++ b/headers/os/mail/MailDaemon.h
@@ -1,45 +1,40 @@
-#ifndef MAIL_DAEMON_H
-#define MAIL_DAEMON_H
-/* Daemon - talking to the mail daemon
- *
- * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
- * Copyright 2011, Clemens Zeidler <haiku@xxxxxxxxxxxxxxxxxx>
-*/
+/*
+ * Copyright 2012, Haiku Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _MAIL_DAEMON_H
+#define _MAIL_DAEMON_H
 
 
 #include <E-mail.h>
+#include <Messenger.h>
 
 
-#define B_MAIL_DAEMON_SIGNATURE "application/x-vnd.Be-POST"
-
-const uint32 kMsgCheckAndSend = 'mbth';
-const uint32 kMsgCheckMessage = 'mnow';
-const uint32 kMsgSendMessages = 'msnd';
-const uint32 kMsgSettingsUpdated = 'mrrs';
-const uint32 kMsgAccountsChanged = 'macc';
-const uint32 kMsgSetStatusWindowMode = 'shst';
-const uint32 kMsgCountNewMessages = 'mnum';
-const uint32 kMsgMarkMessageAsRead = 'mmar';
-const uint32 kMsgFetchBody = 'mfeb';
-const uint32 kMsgBodyFetched = 'mbfe';
+class BMailDaemon {
+public:
+                                                               BMailDaemon();
+       virtual                                         ~BMailDaemon();
 
+                       bool                            IsRunning();
 
-class BMessenger;
+                       status_t                        CheckMail(int32 
accountID = -1);
+                       status_t                        
CheckAndSendQueuedMail(int32 accountID = -1);
 
+                       status_t                        SendQueuedMail();
 
-class BMailDaemon {
-public:
-       //! accountID = -1 means check all accounts
-       static status_t                         CheckMail(int32 accountID = -1);
-       static status_t                         CheckAndSendQueuedMail(int32 
accountID = -1);
-       static status_t                         SendQueuedMail();
-       static int32                            CountNewMessages(
+                       int32                           CountNewMessages(
                                                                        bool 
waitForFetchCompletion = false);
-       static status_t                         MarkAsRead(int32 account, const 
entry_ref& ref,
+                       status_t                        MarkAsRead(int32 
account, const entry_ref& ref,
                                                                        
read_flags flag = B_READ);
-       static status_t                         FetchBody(const entry_ref& ref,
+                       status_t                        FetchBody(const 
entry_ref& ref,
                                                                        
BMessenger* listener = NULL);
-       static status_t                         Quit();
+
+                       status_t                        Quit();
+                       status_t                        Launch();
+
+private:
+                       BMessenger                      fDaemon;
 };
 
-#endif // MAIL_DAEMON_H
+
+#endif // _MAIL_DAEMON_H
diff --git a/headers/private/mail/MailPrivate.h 
b/headers/private/mail/MailPrivate.h
index 74b8afa..03bb2bc 100644
--- a/headers/private/mail/MailPrivate.h
+++ b/headers/private/mail/MailPrivate.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011, Haiku Inc. All Rights Reserved.
+ * Copyright 2011-2012, Haiku Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  */
 #ifndef MAIL_PRIVATE_H
@@ -12,13 +12,33 @@
 
 namespace BPrivate {
 
+
+#define B_MAIL_DAEMON_SIGNATURE "application/x-vnd.Be-POST"
+
+
+// mail daemon & protocol message constants
+const uint32 kMsgCheckAndSend = 'mbth';
+const uint32 kMsgCheckMessage = 'mnow';
+const uint32 kMsgSendMessages = 'msnd';
+const uint32 kMsgSettingsUpdated = 'mrrs';
+const uint32 kMsgAccountsChanged = 'macc';
+const uint32 kMsgSetStatusWindowMode = 'shst';
+const uint32 kMsgCountNewMessages = 'mnum';
+const uint32 kMsgMarkMessageAsRead = 'mmar';
+const uint32 kMsgFetchBody = 'mfeb';
+const uint32 kMsgBodyFetched = 'mbfe';
+const uint32 kMsgSyncMessages = '&SyM';
+
+
 BPath default_mail_directory();
 BPath default_mail_in_directory();
 BPath default_mail_out_directory();
 
+
 status_t WriteMessageFile(const BMessage& archive, const BPath& path,
        const char* name);
 
+
 }      // namespace BPrivate
 
 
diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp 
b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp
index 109b2d8..84e4685 100644
--- a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp
+++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp
@@ -329,29 +329,33 @@ SMTPProtocol::Disconnect()
 
 //! Process EMail to be sent
 status_t
-SMTPProtocol::SendMessages(const std::vector<entry_ref>& mails,
-       size_t totalBytes)
+SMTPProtocol::SendMessages(const BMessage& message, off_t totalBytes)
 {
-       status_t status = Connect();
+       type_code type;
+       int32 count;
+       status_t status = message.GetInfo("ref", &type, &count);
        if (status != B_OK)
                return status;
 
-       for (unsigned int i = 0; i < mails.size(); i++) {
-               status = _SendMessage(mails[i]);
+       SetTotalItems(count);
+       SetTotalItemsSize(totalBytes);
 
+       status = Connect();
+       if (status != B_OK)
+               return status;
+
+       entry_ref ref;
+       for (int32 i = 0; message.FindRef("ref", i++, &ref) == B_OK;) {
+               status = _SendMessage(ref);
                if (status != B_OK) {
                        BString error;
-                       error << "An error occurred while sending the message " 
<<
-                               mails[i].name << ":\n" << fLog;
+                       error << "An error occurred while sending the message "
+                               << ref.name << ":\n" << fLog;
                        ShowError(error.String());
 
                        ResetProgress();
                        break;
                }
-               off_t size = 0;
-               const entry_ref& ref = mails[i];
-               BNode(&ref).GetSize(&size);
-               ReportProgress(size, 1);
        }
 
        Disconnect();
@@ -521,10 +525,10 @@ SMTPProtocol::Open(const char *address, int port, bool 
esmtp)
 
 
 status_t
-SMTPProtocol::_SendMessage(const entry_ref& mail)
+SMTPProtocol::_SendMessage(const entry_ref& ref)
 {
        // open read write to be able to manipulate in MessageReadyToSend hook
-       BFile file(&mail, B_READ_WRITE);
+       BFile file(&ref, B_READ_WRITE);
        status_t status = file.InitCheck();
        if (status != B_OK)
                return status;
@@ -534,7 +538,7 @@ SMTPProtocol::_SendMessage(const entry_ref& mail)
 
        const char *from = header.FindString("MAIL:from");
        const char *to = header.FindString("MAIL:recipients");
-       if (!to)
+       if (to == NULL)
                to = header.FindString("MAIL:to");
 
        if (to == NULL || from == NULL) {
@@ -542,11 +546,16 @@ SMTPProtocol::_SendMessage(const entry_ref& mail)
                return B_ERROR;
        }
 
-       NotifyMessageReadyToSend(mail, &file);
+       NotifyMessageReadyToSend(ref, &file);
        status = Send(to, from, &file);
        if (status != B_OK)
                return status;
-       NotifyMessageSent(mail, &file);
+       NotifyMessageSent(ref, &file);
+
+       off_t size = 0;
+       file.GetSize(&size);
+       ReportProgress(size, 1);
+
        return B_OK;
 }
 
diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.h 
b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.h
index ba6ae90..243511d 100644
--- a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.h
+++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.h
@@ -24,13 +24,13 @@
 class SMTPProtocol : public BOutboundMailProtocol {
 public:
                                                                
SMTPProtocol(BMailAccountSettings& settings);
-                                                               ~SMTPProtocol();
+       virtual                                         ~SMTPProtocol();
 
                        status_t                        Connect();
                        void                            Disconnect();
 
-                       status_t                        SendMessages(const 
std::vector<entry_ref>&
-                                                                       mails, 
size_t totalBytes);
+       virtual status_t                        SendMessages(const BMessage& 
message,
+                                                                       off_t 
totalBytes);
 
                        status_t                        Open(const char 
*server, int port, bool esmtp);
                        void                            Close();
@@ -42,7 +42,7 @@ public:
                        status_t                        SendCommand(const char 
*cmd);
 
 private:
-                       status_t                        _SendMessage(const 
entry_ref& mail);
+                       status_t                        _SendMessage(const 
entry_ref& ref);
                        status_t                        _POP3Authentication();
 
                        int                                     fSocket;
diff --git a/src/kits/mail/MailDaemon.cpp b/src/kits/mail/MailDaemon.cpp
index 6e73b9f..21722fe 100644
--- a/src/kits/mail/MailDaemon.cpp
+++ b/src/kits/mail/MailDaemon.cpp
@@ -1,71 +1,92 @@
-/* Daemon - talking to the mail daemon
-**
-** Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
-*/
+/*
+ * Copyright 2004-2012, Haiku Inc. All Rights Reserved.
+ * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
+ *
+ * Distributed under the terms of the MIT License.
+ */
 
 
+#include <MailDaemon.h>
+
+#include <List.h>
+#include <MailSettings.h>
 #include <Messenger.h>
 #include <Message.h>
-#include <List.h>
+#include <Roster.h>
+
+#include <MailPrivate.h>
 
-#include <MailDaemon.h>
-#include <MailSettings.h>
 
-#include <string.h>
+using namespace BPrivate;
+
+
+BMailDaemon::BMailDaemon()
+       :
+       fDaemon(B_MAIL_DAEMON_SIGNATURE)
+{
+}
+
+
+BMailDaemon::~BMailDaemon()
+{
+}
+
+
+bool
+BMailDaemon::IsRunning()
+{
+       return fDaemon.IsValid();
+}
 
 
 status_t
 BMailDaemon::CheckMail(int32 accountID)
 {
-       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
-       if (!daemon.IsValid())
+       if (!fDaemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
        BMessage message(kMsgCheckMessage);
        message.AddInt32("account", accountID);
-       return daemon.SendMessage(&message);
+       return fDaemon.SendMessage(&message);
 }
 
 
 status_t
 BMailDaemon::CheckAndSendQueuedMail(int32 accountID)
 {
-       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
-       if (!daemon.IsValid())
+       if (!fDaemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
        BMessage message(kMsgCheckAndSend);
        message.AddInt32("account", accountID);
-       return daemon.SendMessage(&message);
+       return fDaemon.SendMessage(&message);
 }
 
 
 status_t
 BMailDaemon::SendQueuedMail()
 {
-       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
-       if (!daemon.IsValid())
+       if (!fDaemon.IsValid())
                return B_MAIL_NO_DAEMON;
-       
-       return daemon.SendMessage(kMsgSendMessages);
+
+       return fDaemon.SendMessage(kMsgSendMessages);
 }
 
 
 int32
-BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
+BMailDaemon::CountNewMessages(bool waitForFetchCompletion)
 {
-       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
-       if (!daemon.IsValid())
+       if (!fDaemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
        BMessage reply;
        BMessage first(kMsgCountNewMessages);
 
-       if (wait_for_fetch_completion)
+       if (waitForFetchCompletion)
                first.AddBool("wait_for_fetch_done",true);
-               
-       daemon.SendMessage(&first, &reply);     
-               
+
+       fDaemon.SendMessage(&first, &reply);
+
        return reply.FindInt32("num_new_messages");
 }
 
@@ -73,8 +94,7 @@ BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
 status_t
 BMailDaemon::MarkAsRead(int32 account, const entry_ref& ref, read_flags flag)
 {
-       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
-       if (!daemon.IsValid())
+       if (!fDaemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
        BMessage message(kMsgMarkMessageAsRead);
@@ -82,15 +102,14 @@ BMailDaemon::MarkAsRead(int32 account, const entry_ref& 
ref, read_flags flag)
        message.AddRef("ref", &ref);
        message.AddInt32("read", flag);
 
-       return daemon.SendMessage(&message);
+       return fDaemon.SendMessage(&message);
 }
 
 
 status_t
 BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* listener)
 {
-       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
-       if (!daemon.IsValid())
+       if (!fDaemon.IsValid())
                return B_MAIL_NO_DAEMON;
 
        BMessage message(kMsgFetchBody);
@@ -99,16 +118,22 @@ BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* 
listener)
                message.AddMessenger("target", *listener);
 
        BMessage reply;
-       return daemon.SendMessage(&message, &reply);
+       return fDaemon.SendMessage(&message, &reply);
 }
 
 
 status_t
 BMailDaemon::Quit()
 {
-       BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
-       if (!daemon.IsValid())
+       if (!fDaemon.IsValid())
                return B_MAIL_NO_DAEMON;
-       
-       return daemon.SendMessage(B_QUIT_REQUESTED);
+
+       return fDaemon.SendMessage(B_QUIT_REQUESTED);
+}
+
+
+status_t
+BMailDaemon::Launch()
+{
+       return be_roster->Launch(B_MAIL_DAEMON_SIGNATURE);
 }
diff --git a/src/kits/mail/MailMessage.cpp b/src/kits/mail/MailMessage.cpp
index 09a8ae9..73916f1 100644
--- a/src/kits/mail/MailMessage.cpp
+++ b/src/kits/mail/MailMessage.cpp
@@ -35,6 +35,8 @@
 #include <mail_util.h>
 #include <StringList.h>
 
+#include <MailPrivate.h>
+
 
 //-------Change the following!----------------------
 #define mime_boundary "----------Zoidberg-BeMail-temp--------"
diff --git a/src/kits/mail/MailProtocol.cpp b/src/kits/mail/MailProtocol.cpp
index d78e911..4229c5d 100644
--- a/src/kits/mail/MailProtocol.cpp
+++ b/src/kits/mail/MailProtocol.cpp
@@ -31,14 +31,14 @@
 #include <MailSettings.h>
 
 #include <mail_util.h>
+#include <MailPrivate.h>
 
 #include "HaikuMailFormatFilter.h"
 
 
-using std::map;
+using namespace BPrivate;
 
 
-const uint32 kMsgSyncMessages = '&SyM';
 const uint32 kMsgDeleteMessage = '&DeM';
 const uint32 kMsgAppendMessage = '&ApM';
 
@@ -67,7 +67,7 @@ BMailProtocol::~BMailProtocol()
        for (int i = 0; i < fFilterList.CountItems(); i++)
                delete fFilterList.ItemAt(i);
 
-       map<entry_ref, image_id>::iterator it = fFilterImages.begin();
+       std::map<entry_ref, image_id>::iterator it = fFilterImages.begin();
        for (; it != fFilterImages.end(); it++)
                unload_add_on(it->second);
 }
@@ -316,7 +316,7 @@ BMailFilter*
 BMailProtocol::_LoadFilter(BMailAddOnSettings* filterSettings)
 {
        const entry_ref& ref = filterSettings->AddOnRef();
-       map<entry_ref, image_id>::iterator it = fFilterImages.find(ref);
+       std::map<entry_ref, image_id>::iterator it = fFilterImages.find(ref);
        image_id image;
        if (it != fFilterImages.end())
                image = it->second;
@@ -461,18 +461,8 @@ BOutboundMailProtocol::MessageReceived(BMessage* message)
 {
        switch (message->what) {
                case kMsgSendMessage:
-               {
-                       std::vector<entry_ref> mails;
-                       for (int32 i = 0; ;i++) {
-                               entry_ref ref;
-                               if (message->FindRef("ref", i, &ref) != B_OK)
-                                       break;
-                               mails.push_back(ref);
-                       }
-                       size_t size = message->FindInt32("size");
-                       SendMessages(mails, size);
+                       SendMessages(*message, message->FindInt64("bytes"));
                        break;
-               }
 
                default:
                        BMailProtocol::MessageReceived(message);
diff --git a/src/kits/mail/c_mail_api.cpp b/src/kits/mail/c_mail_api.cpp
index 8b619c2..59facf9 100644
--- a/src/kits/mail/c_mail_api.cpp
+++ b/src/kits/mail/c_mail_api.cpp
@@ -1,8 +1,13 @@
-/* C-mail API - compatibility function (stubs) for the old mail kit
-**
-** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
-** Copyright 2011 Clemens Zeidler. All rights reserved.
-*/
+/*
+ * Copyright 2004-2012, Haiku, Inc. All rights reserved.
+ * Copyright 2001, Dr. Zoidberg Enterprises. All rights reserved.
+ * Copyright 2011, Clemens Zeidler. All rights reserved.
+ *
+ * Distributed under the terms of the MIT License.
+ */
+
+
+//!    C-mail API - compatibility function (stubs) for the old mail kit
 
 
 #include <stdlib.h>
@@ -22,14 +27,14 @@
 
 
 _EXPORT status_t
-check_for_mail(int32 * incoming_count)
+check_for_mail(int32* _incomingCount)
 {
-       status_t err = BMailDaemon::CheckMail(true);
-       if (err < B_OK)
-               return err;
+       status_t status = BMailDaemon().CheckMail();
+       if (status != B_OK)
+               return status;
 
-       if (incoming_count != NULL)
-               *incoming_count = BMailDaemon::CountNewMessages(true);
+       if (_incomingCount != NULL)
+               *_incomingCount = BMailDaemon().CountNewMessages(true);
 
        return B_OK;
 }
@@ -38,7 +43,7 @@ check_for_mail(int32 * incoming_count)
 _EXPORT status_t
 send_queued_mail(void)
 {
-       return BMailDaemon::SendQueuedMail();
+       return BMailDaemon().SendQueuedMail();
 }
 
 
diff --git a/src/servers/mail/DefaultNotifier.cpp 
b/src/servers/mail/DefaultNotifier.cpp
index 4418de2..018472f 100644
--- a/src/servers/mail/DefaultNotifier.cpp
+++ b/src/servers/mail/DefaultNotifier.cpp
@@ -1,6 +1,7 @@
 /*
  * Copyright 2011-2012, Haiku, Inc. All rights reserved.
  * Copyright 2011, Clemens Zeidler <haiku@xxxxxxxxxxxxxxxxxx>
+ *
  * Distributed under the terms of the MIT License.
  */
 
@@ -12,6 +13,8 @@
 #include <MailDaemon.h>
 #include <Roster.h>
 
+#include <MailPrivate.h>
+
 
 #undef B_TRANSLATION_CONTEXT
 #define B_TRANSLATION_CONTEXT "Notifier"
diff --git a/src/servers/mail/DeskbarView.cpp b/src/servers/mail/DeskbarView.cpp
index 22618bf..39b7ecf 100644
--- a/src/servers/mail/DeskbarView.cpp
+++ b/src/servers/mail/DeskbarView.cpp
@@ -1,9 +1,14 @@
-/* DeskbarView - mail_daemon's deskbar menu and view
- *
+/*
+ * Copyright 2004-2012, Haiku Inc. All Rights Reserved.
  * Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
+ *
+ * Distributed under the terms of the MIT License.
  */
 
 
+//!    mail_daemon's deskbar menu and view
+
+
 #include "DeskbarView.h"
 
 #include <stdio.h>
@@ -38,6 +43,8 @@
 #include <MailDaemon.h>
 #include <MailSettings.h>
 
+#include <MailPrivate.h>
+
 #include "DeskbarViewIcons.h"
 
 
@@ -208,7 +215,8 @@ status_t DeskbarView::Archive(BMessage *data,bool deep) 
const
 }
 
 
-void DeskbarView::Draw(BRect /*updateRect*/)
+void
+DeskbarView::Draw(BRect /*updateRect*/)
 {
        if (fBitmaps[fStatus] == NULL)
                return;
@@ -222,18 +230,17 @@ void DeskbarView::Draw(BRect /*updateRect*/)
 void
 DeskbarView::MessageReceived(BMessage* message)
 {
-       switch(message->what)
-       {
+       switch (message->what) {
                case MD_CHECK_SEND_NOW:
                        // also happens in DeskbarView::MouseUp() with
                        // B_TERTIARY_MOUSE_BUTTON pressed
-                       BMailDaemon::CheckAndSendQueuedMail();
+                       BMailDaemon().CheckAndSendQueuedMail();
                        break;
                case MD_CHECK_FOR_MAILS:
-                       BMailDaemon::CheckMail(message->FindInt32("account"));
+                       BMailDaemon().CheckMail(message->FindInt32("account"));
                        break;
                case MD_SEND_MAILS:
-                       BMailDaemon::SendQueuedMail();
+                       BMailDaemon().SendQueuedMail();
                        break;
 
                case MD_OPEN_NEW:
@@ -281,12 +288,12 @@ DeskbarView::MessageReceived(BMessage* message)
                                                fNewMessages--;
                                        break;
                        }
-                       fStatus = (fNewMessages > 0) ? kStatusNewMail : 
kStatusNoMail;
+                       fStatus = fNewMessages > 0 ? kStatusNewMail : 
kStatusNoMail;
                        Invalidate();
                        break;
                }
                case B_QUIT_REQUESTED:
-                       BMailDaemon::Quit();
+                       BMailDaemon().Quit();
                        break;
 
                // open received files in the standard mail application
@@ -363,38 +370,34 @@ DeskbarView::Pulse()
 void
 DeskbarView::MouseUp(BPoint pos)
 {
-       if (fLastButtons & B_PRIMARY_MOUSE_BUTTON) {
-               if (OpenWithTracker(B_USER_SETTINGS_DIRECTORY, "Mail/mailbox")
-                       != B_OK) {
-                       entry_ref ref;
-                       _GetNewQueryRef(ref);
+       if ((fLastButtons & B_PRIMARY_MOUSE_BUTTON) !=0
+               && OpenWithTracker(B_USER_SETTINGS_DIRECTORY, "Mail/mailbox") 
!= B_OK) {
+               entry_ref ref;
+               _GetNewQueryRef(ref);
 
-                       BMessenger trackerMessenger(kTrackerSignature);
-                       BMessage message(B_REFS_RECEIVED);
-                       message.AddRef("refs", &ref);
+               BMessenger trackerMessenger(kTrackerSignature);
+               BMessage message(B_REFS_RECEIVED);
+               message.AddRef("refs", &ref);
 
-                       trackerMessenger.SendMessage(&message);
-               }
+               trackerMessenger.SendMessage(&message);
        }
 
-       if (fLastButtons & B_TERTIARY_MOUSE_BUTTON)
-               BMailDaemon::CheckMail();
+       if ((fLastButtons & B_TERTIARY_MOUSE_BUTTON) != 0)
+               BMailDaemon().CheckMail();
 }
 
 
 void
 DeskbarView::MouseDown(BPoint pos)
 {
-       Looper()->CurrentMessage()->FindInt32("buttons",&fLastButtons);
+       Looper()->CurrentMessage()->FindInt32("buttons", &fLastButtons);
 
-       if (fLastButtons & B_SECONDARY_MOUSE_BUTTON) {
+       if ((fLastButtons & B_SECONDARY_MOUSE_BUTTON) != 0) {
                ConvertToScreen(&pos);
 
                BPopUpMenu* menu = _BuildMenu();
-               if (menu) {
-                       menu->Go(pos, true, true, BRect(pos.x - 2, pos.y - 2,
-                               pos.x + 2, pos.y + 2), true);
-               }
+               menu->Go(pos, true, true, BRect(pos.x - 2, pos.y - 2,
+                       pos.x + 2, pos.y + 2), true);
        }
 }
 
@@ -559,15 +562,14 @@ DeskbarView::_BuildMenu()
                navMenu->SetNavDir(&ref);
 
                menu->AddItem(item);
-       }
-       else {
+       } else {
                menu->AddItem(item = new BMenuItem(B_TRANSLATE("No new 
messages"),
                        NULL));
                item->SetEnabled(false);
        }
 
        BMailAccounts accounts;
-       if (modifiers() & B_SHIFT_KEY) {
+       if ((modifiers() & B_SHIFT_KEY) != 0) {
                BMenu *accountMenu = new BMenu(B_TRANSLATE("Check for mails 
only"));
                BFont font;
                menu->GetFont(&font);
@@ -615,7 +617,7 @@ DeskbarView::_BuildMenu()
 
        for (int32 i = menu->CountItems(); i-- > 0;) {
                item = menu->ItemAt(i);
-               if (item && (msg = item->Message()) != NULL) {
+               if (item != NULL && (msg = item->Message()) != NULL) {
                        if (msg->what == B_REFS_RECEIVED)
                                item->SetTarget(tracker);
                        else
diff --git a/src/servers/mail/MailDaemon.cpp b/src/servers/mail/MailDaemon.cpp
index 3f2a158..2f16ed1 100644
--- a/src/servers/mail/MailDaemon.cpp
+++ b/src/servers/mail/MailDaemon.cpp
@@ -32,23 +32,75 @@
 #include <MailMessage.h>
 #include <MailSettings.h>
 
+#include <MailPrivate.h>
+
 
 #undef B_TRANSLATION_CONTEXT
 #define B_TRANSLATION_CONTEXT "MailDaemon"
 
 
-using std::map;
-using std::vector;
-
-
 struct send_mails_info {
        send_mails_info()
        {
-               totalSize = 0;
+               bytes = 0;
+       }
+
+       BMessage        files;
+       off_t           bytes;
+};
+
+
+class InboundMessenger : public BMessenger {
+public:
+       InboundMessenger(BInboundMailProtocol* protocol)
+               :
+               BMessenger(protocol)
+       {
+       }
+
+       status_t FetchBody(const entry_ref& ref, BMessenger* replyTo)
+       {
+               BMessage message(kMsgFetchBody);
+               message.AddRef("ref", &ref);
+               if (replyTo != NULL)
+                       message.AddMessenger("target", *replyTo);
+
+               return SendMessage(&message);
+       }
+
+       status_t MarkAsRead(const entry_ref& ref, read_flags flag)
+       {
+               BMessage message(kMsgMarkMessageAsRead);
+               message.AddRef("ref", &ref);
+               message.AddInt32("read", flag);
+
+               return SendMessage(&message);
+       }
+
+       status_t SynchronizeMessages()
+       {
+               BMessage message(kMsgSyncMessages);
+               return SendMessage(&message);
        }
+};
+
+
+class OutboundMessenger : public BMessenger {
+public:
+       OutboundMessenger(BOutboundMailProtocol* protocol)
+               :
+               BMessenger(protocol)
+       {
+       }
+
+       status_t SendMessages(const BMessage& files, off_t totalBytes)
+       {
+               BMessage message(kMsgSendMessages);
+               message.Append(files);
+               message.AddInt64("bytes", totalBytes);
 
-       vector<entry_ref>       files;
-       off_t                           totalSize;
+               return SendMessage(&message);
+       }
 };
 
 
@@ -102,7 +154,20 @@ addAttribute(BMessage& msg, const char* name, const char* 
publicName,
 }
 
 
-//     #pragma mark -
+// #pragma mark -
+
+
+account_protocols::account_protocols()
+       :
+       inboundImage(-1),
+       inboundProtocol(NULL),
+       outboundImage(-1),
+       outboundProtocol(NULL)
+{
+}
+
+
+// #pragma mark -
 
 
 MailDaemonApp::MailDaemonApp()
@@ -128,12 +193,13 @@ MailDaemonApp::~MailDaemonApp()
        for (int32 i = 0; i < fQueries.CountItems(); i++)
                delete fQueries.ItemAt(i);
 
+       while (!fAccounts.empty()) {
+               _RemoveAccount(fAccounts.begin()->second);
+               fAccounts.erase(fAccounts.begin());
+       }
+
        delete fLEDAnimation;
        delete fNotification;
-
-       AccountMap::const_iterator it = fAccounts.begin();
-       for (; it != fAccounts.end(); it++)
-               _RemoveAccount(it);
 }
 
 
@@ -220,15 +286,16 @@ MailDaemonApp::RefsReceived(BMessage* message)
                                sizeof(account)) < 0)
                        continue;
 
-               InboundProtocolThread* protocolThread = 
_FindInboundProtocol(account);
-               if (protocolThread == NULL)
+               BInboundMailProtocol* protocol = _InboundProtocol(account);
+               if (protocol == NULL)
                        continue;
 
                BMessenger target;
-               BMessenger* messenger = &target;
+               BMessenger* replyTo = &target;
                if (message->FindMessenger("target", &target) != B_OK)
-                       messenger = NULL;
-               protocolThread->FetchBody(ref, messenger);
+                       replyTo = NULL;
+
+               InboundMessenger(protocol).FetchBody(ref, replyTo);
        }
 }
 
@@ -278,11 +345,10 @@ MailDaemonApp::MessageReceived(BMessage* msg)
                        if (msg->FindRef("ref", &ref) != B_OK)
                                break;
                        read_flags read = (read_flags)msg->FindInt32("read");
-                       AccountMap::iterator it = fAccounts.find(account);
-                       if (it == fAccounts.end())
-                               break;
-                       InboundProtocolThread* inboundThread = 
it->second.inboundThread;
-                       inboundThread->MarkMessageAsRead(ref, read);
+
+                       BInboundMailProtocol* protocol = 
_InboundProtocol(account);
+                       if (protocol != NULL)
+                               InboundMessenger(protocol).MarkAsRead(ref, 
read);
                        break;
                }
 
@@ -457,18 +523,20 @@ MailDaemonApp::GetNewMessages(BMessage* msg)
 {
        int32 account = -1;
        if (msg->FindInt32("account", &account) == B_OK && account >= 0) {
-               InboundProtocolThread* protocol = _FindInboundProtocol(account);
+               // Check the single requested account
+               BInboundMailProtocol* protocol = _InboundProtocol(account);
                if (protocol != NULL)
-                       protocol->SyncMessages();
+                       InboundMessenger(protocol).SynchronizeMessages();
                return;
        }
 
-       // else check all accounts
-       AccountMap::const_iterator it = fAccounts.begin();
-       for (; it != fAccounts.end(); it++) {
-               InboundProtocolThread* protocol = it->second.inboundThread;
+       // Check all accounts
+
+       AccountMap::const_iterator iterator = fAccounts.begin();
+       for (; iterator != fAccounts.end(); iterator++) {
+               BInboundMailProtocol* protocol = 
iterator->second.inboundProtocol;
                if (protocol != NULL)
-                       protocol->SyncMessages();
+                       InboundMessenger(protocol).SynchronizeMessages();
        }
 }
 
@@ -479,7 +547,7 @@ MailDaemonApp::SendPendingMessages(BMessage* msg)
        BVolumeRoster roster;
        BVolume volume;
 
-       map<int32, send_mails_info> messages;
+       std::map<int32, send_mails_info> messages;
 
        int32 account = -1;
        if (msg->FindInt32("account", &account) != B_OK)
@@ -517,55 +585,34 @@ MailDaemonApp::SendPendingMessages(BMessage* msg)
                                if (!_IsPending(node))
                                        continue;
 
-                               int32 messageAccount;
                                if (node.ReadAttr(B_MAIL_ATTR_ACCOUNT_ID, 
B_INT32_TYPE, 0,
-                                       &messageAccount, sizeof(int32)) < 0)
-                                       messageAccount = -1;
-
-                               off_t size = 0;
-                               node.GetSize(&size);
-                               entry_ref ref;
-                               entry.GetRef(&ref);
+                                               &account, sizeof(int32)) < 0)
+                                       account = -1;
 
-                               messages[messageAccount].files.push_back(ref);
-                               messages[messageAccount].totalSize += size;
+                               _AddMessage(messages[account], entry, node);
                        }
                }
        } else {
+               // Send the requested message only
                const char* path;
                if (msg->FindString("message_path", &path) != B_OK)
                        return;
 
-               off_t size = 0;
-               if (BNode(path).GetSize(&size) != B_OK)
-                       return;
                BEntry entry(path);
-               entry_ref ref;
-               entry.GetRef(&ref);
-
-               messages[account].files.push_back(ref);
-               messages[account].totalSize += size;
+               _AddMessage(messages[account], entry, BNode(&entry));
        }
 
-       map<int32, send_mails_info>::iterator iter = messages.begin();
-       for (; iter != messages.end(); iter++) {
-               OutboundProtocolThread* protocolThread = _FindOutboundProtocol(
-                       iter->first);
-               if (!protocolThread)
+       std::map<int32, send_mails_info>::iterator iterator = messages.begin();
+       for (; iterator != messages.end(); iterator++) {
+               BOutboundMailProtocol* protocol = 
_OutboundProtocol(iterator->first);
+               if (protocol == NULL)
                        continue;
 
-               send_mails_info& info = iter->second;
-               if (info.files.size() == 0)
+               send_mails_info& info = iterator->second;
+               if (info.bytes == 0)
                        continue;
 
-               MailProtocol* protocol = protocolThread->Protocol();
-
-               protocolThread->Lock();
-               protocol->SetTotalItems(info.files.size());
-               protocol->SetTotalItemsSize(info.totalSize);
-               protocolThread->Unlock();
-
-               protocolThread->SendMessages(iter->second.files, 
info.totalSize);
+               OutboundMessenger(protocol).SendMessages(info.files, 
info.bytes);
        }
 }
 
@@ -640,48 +687,38 @@ void
 MailDaemonApp::_InitAccount(BMailAccountSettings& settings)
 {
        account_protocols account;
+
        // inbound
        if (settings.IsInboundEnabled()) {
                account.inboundProtocol = _CreateInboundProtocol(settings,
                        account.inboundImage);
-       } else {
-               account.inboundProtocol = NULL;
        }
-       if (account.inboundProtocol) {
+       if (account.inboundProtocol != NULL) {
                DefaultNotifier* notifier = new 
DefaultNotifier(settings.Name(), true,
                        fErrorLogWindow, fNotifyMode);
                account.inboundProtocol->SetMailNotifier(notifier);
-
-               account.inboundThread = new InboundProtocolThread(
-                       account.inboundProtocol);
-               account.inboundThread->Run();
+               account.inboundProtocol->Run();
        }
 
        // outbound
        if (settings.IsOutboundEnabled()) {
                account.outboundProtocol = _CreateOutboundProtocol(settings,
                        account.outboundImage);
-       } else {
-               account.outboundProtocol = NULL;
        }
-       if (account.outboundProtocol) {
+       if (account.outboundProtocol != NULL) {
                DefaultNotifier* notifier = new 
DefaultNotifier(settings.Name(), false,
                        fErrorLogWindow, fNotifyMode);
                account.outboundProtocol->SetMailNotifier(notifier);
-
-               account.outboundThread = new OutboundProtocolThread(
-                       account.outboundProtocol);
-               account.outboundThread->Run();
+               account.outboundProtocol->Run();
        }
 
        printf("account name %s, id %i, in %p, out %p\n", settings.Name(),
                (int)settings.AccountID(), account.inboundProtocol,
                account.outboundProtocol);
-       if (!account.inboundProtocol && !account.outboundProtocol)
-               return;
-       fAccounts[settings.AccountID()] = account;
-}
 
+       if (account.inboundProtocol != NULL || account.outboundProtocol != NULL)
+               fAccounts[settings.AccountID()] = account;
+}
 
 
 void
@@ -698,9 +735,12 @@ MailDaemonApp::_ReloadAccounts(BMessage* message)
 
        for (int i = 0; i < countFound; i++) {
                int32 account = message->FindInt32("account", i);
-               AccountMap::const_iterator it = fAccounts.find(account);
-               if (it != fAccounts.end())
-                       _RemoveAccount(it);
+               AccountMap::iterator found = fAccounts.find(account);
+               if (found != fAccounts.end()) {
+                       _RemoveAccount(found->second);
+                       fAccounts.erase(found);
+               }
+
                BMailAccountSettings* settings = accounts.AccountByID(account);
                if (settings != NULL)
                        _InitAccount(*settings);
@@ -709,89 +749,88 @@ MailDaemonApp::_ReloadAccounts(BMessage* message)
 
 
 void
-MailDaemonApp::_RemoveAccount(AccountMap::const_iterator it)
+MailDaemonApp::_RemoveAccount(const account_protocols& account)
 {
-       BMessage reply;
-       if (it->second.inboundThread) {
-               it->second.inboundThread->SetStopNow();
-               
BMessenger(it->second.inboundThread).SendMessage(B_QUIT_REQUESTED,
-                       &reply);
+       if (account.inboundProtocol != NULL) {
+               account.inboundProtocol->Lock();
+               account.inboundProtocol->Quit();
+
+               unload_add_on(account.inboundImage);
        }
-       if (it->second.outboundThread) {
-               it->second.outboundThread->SetStopNow();
-               
BMessenger(it->second.outboundThread).SendMessage(B_QUIT_REQUESTED,
-                       &reply);
+
+       if (account.outboundProtocol != NULL) {
+               account.outboundProtocol->Lock();
+               account.outboundProtocol->Quit();
+
+               unload_add_on(account.outboundImage);
        }
-       delete it->second.inboundProtocol;
-       delete it->second.outboundProtocol;
-       unload_add_on(it->second.inboundImage);
-       unload_add_on(it->second.outboundImage);
-       fAccounts.erase(it->first);
 }
 
 
-InboundProtocol*
+BInboundMailProtocol*
 MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings,
        image_id& image)
 {
-       const entry_ref& entry = settings.InboundPath();
-       InboundProtocol* (*instantiate_protocol)(BMailAccountSettings*);
+       const entry_ref& entry = settings.InboundAddOnRef();
+       BInboundMailProtocol* (*instantiateProtocol)(BMailAccountSettings*);
 
        BPath path(&entry);
        image = load_add_on(path.Path());
        if (image < 0)
                return NULL;
+
        if (get_image_symbol(image, "instantiate_inbound_protocol",
-                       B_SYMBOL_TYPE_TEXT, (void**)&instantiate_protocol) != 
B_OK) {
+                       B_SYMBOL_TYPE_TEXT, (void**)&instantiateProtocol) != 
B_OK) {
                unload_add_on(image);
                image = -1;
                return NULL;
        }
-       return (*instantiate_protocol)(&settings);
+       return instantiateProtocol(&settings);
 }
 
 
-OutboundProtocol*
+BOutboundMailProtocol*
 MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings,
        image_id& image)
 {
-       const entry_ref& entry = settings.OutboundPath();
-       OutboundProtocol* (*instantiate_protocol)(BMailAccountSettings*);
+       const entry_ref& entry = settings.OutboundAddOnRef();
+       BOutboundMailProtocol* (*instantiateProtocol)(BMailAccountSettings*);
 
        BPath path(&entry);
        image = load_add_on(path.Path());
        if (image < 0)
                return NULL;
+
        if (get_image_symbol(image, "instantiate_outbound_protocol",
-                       B_SYMBOL_TYPE_TEXT, (void**)&instantiate_protocol) != 
B_OK) {
+                       B_SYMBOL_TYPE_TEXT, (void**)&instantiateProtocol) != 
B_OK) {
                unload_add_on(image);
                image = -1;
                return NULL;
        }
-       return (*instantiate_protocol)(&settings);
+       return instantiateProtocol(&settings);
 }
 
 
-InboundProtocolThread*
-MailDaemonApp::_FindInboundProtocol(int32 account)
+BInboundMailProtocol*
+MailDaemonApp::_InboundProtocol(int32 account)
 {
-       AccountMap::iterator it = fAccounts.find(account);
-       if (it == fAccounts.end())
+       AccountMap::iterator found = fAccounts.find(account);
+       if (found == fAccounts.end())
                return NULL;
-       return it->second.inboundThread;
+       return found->second.inboundProtocol;
 }
 
 
-OutboundProtocolThread*
-MailDaemonApp::_FindOutboundProtocol(int32 account)
+BOutboundMailProtocol*
+MailDaemonApp::_OutboundProtocol(int32 account)
 {
        if (account < 0)
                account = BMailSettings().DefaultOutboundAccount();
 
-       AccountMap::iterator it = fAccounts.find(account);
-       if (it == fAccounts.end())
+       AccountMap::iterator found = fAccounts.find(account);
+       if (found == fAccounts.end())
                return NULL;
-       return it->second.outboundThread;
+       return found->second.outboundProtocol;
 }
 
 
@@ -813,6 +852,19 @@ MailDaemonApp::_UpdateAutoCheck(bigtime_t interval)
 }
 
 
+void
+MailDaemonApp::_AddMessage(send_mails_info& info, const BEntry& entry,
+       const BNode& node)
+{
+       entry_ref ref;
+       off_t size;
+       if (node.GetSize(&size) == B_OK && entry.GetRef(&ref) == B_OK) {
+               info.files.AddRef("ref", &ref);
+               info.bytes += size;
+       }
+}
+
+
 /*!    Work-around for a broken index that contains out-of-date information.
 */
 /*static*/ bool
diff --git a/src/servers/mail/MailDaemon.h b/src/servers/mail/MailDaemon.h
index a740cd5..d5111ed 100644
--- a/src/servers/mail/MailDaemon.h
+++ b/src/servers/mail/MailDaemon.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2011, Haiku, Inc. All rights reserved.
+ * Copyright 2007-2012, Haiku, Inc. All rights reserved.
  * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
  * Copyright 2011, Clemens Zeidler <haiku@xxxxxxxxxxxxxxxxxx>
  * Distributed under the terms of the MIT License.
@@ -21,27 +21,20 @@
 #include <MailProtocol.h>
 
 #include "LEDAnimation.h"
-#include "Notifier.h"
+#include "DefaultNotifier.h"
 
 
 class BNotification;
+struct send_mails_info;
 
 
 struct account_protocols {
-       account_protocols() {
-               inboundImage = -1;
-               inboundThread = NULL;
-               inboundProtocol = NULL;
-               outboundImage = -1;
-               outboundThread = NULL;
-               outboundProtocol = NULL;
-       }
+       account_protocols();
+
        image_id                                inboundImage;
-       InboundProtocolThread*  inboundThread;
-       InboundProtocol*                inboundProtocol;
+       BInboundMailProtocol*   inboundProtocol;
        image_id                                outboundImage;
-       OutboundProtocolThread* outboundThread;
-       OutboundProtocol*               outboundProtocol;
+       BOutboundMailProtocol*  outboundProtocol;
 };
 
 
@@ -72,20 +65,24 @@ private:
                        void                            _InitAccounts();
                        void                            
_InitAccount(BMailAccountSettings& settings);
                        void                            
_ReloadAccounts(BMessage* message);
-                       void                            
_RemoveAccount(AccountMap::const_iterator it);
+                       void                            _RemoveAccount(
+                                                                       const 
account_protocols& account);
 
-                       InboundProtocol*        _CreateInboundProtocol(
+                       BInboundMailProtocol* _CreateInboundProtocol(
                                                                        
BMailAccountSettings& settings,
                                                                        
image_id& image);
-                       OutboundProtocol*       _CreateOutboundProtocol(
+                       BOutboundMailProtocol* _CreateOutboundProtocol(
                                                                        
BMailAccountSettings& settings,
                                                                        
image_id& image);
 
-                       InboundProtocolThread*  _FindInboundProtocol(int32 
account);
-                       OutboundProtocolThread* _FindOutboundProtocol(int32 
account);
+                       BInboundMailProtocol* _InboundProtocol(int32 account);
+                       BOutboundMailProtocol* _OutboundProtocol(int32 account);
 
                        void                            
_UpdateAutoCheck(bigtime_t interval);
 
+                       void                            
_AddMessage(send_mails_info& info,
+                                                                       const 
BEntry& entry, const BNode& node);
+
        static  bool                            _IsPending(BNode& node);
        static  bool                            _IsEntryInTrash(BEntry& entry);
 

############################################################################

Commit:      18747d61edcecc593bd76b2b8a8a600f939393c4

Author:      Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Tue Oct 30 21:47:57 2012 UTC

Renamed smtp.{cpp|h} to SMTP.{cpp|h}.

----------------------------------------------------------------------------

diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile 
b/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile
index 91e2bf4..7f989e3 100644
--- a/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile
+++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile
@@ -8,7 +8,7 @@ SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons 
mail_daemon ] ;
 
 local sources =
        ConfigView.cpp
-       smtp.cpp
+       SMTP.cpp
        md5c.c
 ;
 
@@ -36,5 +36,5 @@ DoCatalogs SMTP :
        x-vnd.Haiku-SMTP
        :
        ConfigView.cpp
-       smtp.cpp
+       SMTP.cpp
 ;
diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp 
b/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
similarity index 99%
rename from src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp
rename to src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
index 84e4685..0d98809 100644
--- a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp
+++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
@@ -10,7 +10,7 @@
 //!    Implementation of the SMTP protocol
 
 
-#include "smtp.h"
+#include "SMTP.h"
 
 #include <map>
 
diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.h 
b/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.h
similarity index 100%
rename from src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.h
rename to src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.h

############################################################################

Commit:      533a7960c20dde9b5ee74be29ffbf53739254cf7

Author:      Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Tue Oct 30 21:50:18 2012 UTC

IMAP now compiles again with GCC 4.

----------------------------------------------------------------------------

diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h 
b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h
index 75d2982..9742fef 100644
--- a/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h
+++ b/src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolder.h
@@ -10,6 +10,7 @@
 #include <sys/stat.h>
 
 #include <Entry.h>
+#include <Node.h>
 #include <Handler.h>
 #include <String.h>
 
diff --git 
a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/Response.cpp 
b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/Response.cpp
index 46d83f3..101e6ff 100644
--- a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/Response.cpp
+++ b/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/Response.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011, Axel DÃrfler, axeld@xxxxxxxxxxxxxxxxx
+ * Copyright 2011-2012, Axel DÃrfler, axeld@xxxxxxxxxxxxxxxxx
  * Distributed under the terms of the MIT License.
  */
 
@@ -39,7 +39,7 @@ RFC3501Encoding::RFC3501Encoding()
        if (!kInverseBase64Initialized) {
                // This is not thread safe, but it's not harmful
                for (size_t i = 0; i < sizeof(kBase64Alphabet); i++)
-                       kInverseBase64Alphabet[kBase64Alphabet[i]] = i + 1;
+                       kInverseBase64Alphabet[(int)kBase64Alphabet[i]] = i + 1;
                kInverseBase64Initialized = true;
        }
 }

############################################################################

Commit:      0721a947e458cf92a5f7fd4d0084aefb12a4f2d4

Author:      Axel DÃrfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Tue Oct 30 22:14:30 2012 UTC

Merge branch 'github-master' into imap

Conflicts:
        src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp

----------------------------------------------------------------------------


Other related posts:

  • » [haiku-commits] BRANCH axeld-github.imap - docs/userguide src/libs/jpeg data/artwork src/libs/png src - axeld-github . imap