Major restructuring of the mail server:

Accounts are now stored in a separate file. Previously they where somehow magically assembled from the chain ids. Now its possible to remove a account temporary by removing the account file form the account folder.

Each account could have an inbound protocol, an outbound protocol and some filters.

Mails are now associated with an account and not with a chain. This required to replace the chain id attribute by an account attribute.

Replace BMailFilter and BMailChain by a less general approach. Basically the chain had a list of filters and call the ProcessMailMessage for each filter. This made it sometime difficult to understand what is going on, e.g. sometimes a filter used information gathered by another filters. The new MailProtocol and MailFilter classes are calling more dedicated hook functions, e.g. HeaderFetched or MessageReadyToSend.

As before all MailProtocol's (plus their filters) are running in their own thread.

Cleaned up the error and status window a bit. Abstracted the interface to these windows. Should be easy to write a BNotification api back-end now.

Parsing of mail headers is much faster now. Fetching the headers of a large mailbox takes ~min and not ~hour now! Initial checkout time is in the same order like Opera. The problem was the massive use of fgets in parse_header (mail_util.cpp) now the complete header is read in one go. Furthermore, only interesting fields are extracted.

Remove some unused files, BeOS relicts... Feel free to translate the mail server and remove the own language system (headers/private/mail/MDRLanguage.h).

Sorry for the remaining old (and new) coding style issues, sometime just ignore them, to many :(



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40397 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler
2011-02-09 01:49:01 +00:00
parent f9ac5fc8f5
commit 1af4fa4ba6
42 changed files with 3498 additions and 3956 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ class BMailFileConfigView : public BFileControl
public:
BMailFileConfigView(const char *label,const char *name,bool useMeta = false,const char *defaultPath = NULL,uint32 flavors = B_DIRECTORY_NODE);
void SetTo(BMessage *archive,BMessage *metadata);
virtual status_t Archive(BMessage *into,bool deep = true) const;
void SetTo(const BMessage *archive, BMessage *metadata);
virtual status_t Archive(BMessage *into, bool deep = true) const;
private:
BMessage *fMeta;
+1 -1
View File
@@ -9,7 +9,7 @@
#define PASSWORD_LENGTH 32
char *get_passwd(BMessage *msg,const char *name);
char *get_passwd(const BMessage *msg,const char *name);
bool set_passwd(BMessage *msg,const char *name,const char *password);
void passwd_crypt(char *in,char *out,int length);
+2
View File
@@ -72,6 +72,8 @@ ssize_t readfoldedline(BPositionIO &in, char **buffer, size_t *buflen);
// start with a buffer of size *buflen
status_t parse_header(BMessage &headers, BPositionIO &input);
status_t extract_from_header(const BString& header, const BString& field,
BString& target);
void extract_address(BString &address);
// retrieves the mail address only from an address header formatted field
-89
View File
@@ -1,89 +0,0 @@
/*
* Copyright 2001-2003 Dr. Zoidberg Enterprises. All rights reserved.
* Copyright 2004-2007, Haiku Inc. All rights reserved.
*
* Distributed under the terms of the MIT License.
*/
#ifndef ZOIDBERG_STATUS_WINDOW_H
#define ZOIDBERG_STATUS_WINDOW_H
#include <Alert.h>
#include <Box.h>
#include <List.h>
#include <Node.h>
#include <Window.h>
class BStatusBar;
class BStringView;
class BMailStatusView;
class BMailStatusWindow : public BWindow {
public:
BMailStatusWindow(BRect rect, const char *name, uint32 showMode);
~BMailStatusWindow();
virtual void FrameMoved(BPoint origin);
virtual void WorkspaceActivated(int32 workspace, bool active);
virtual void MessageReceived(BMessage *msg);
BMailStatusView *NewStatusView(const char *description, bool upstream);
void RemoveView(BMailStatusView *view);
int32 CountVisibleItems();
bool HasItems(void);
void SetShowCriterion(uint32);
void SetDefaultMessage(const BString &message);
private:
friend class BMailStatusView;
void _CheckChains();
void SetBorderStyle(int32 look);
void ActuallyAddStatusView(BMailStatusView *status);
node_ref fChainDirectory;
BButton* fCheckNowButton;
BList fStatusViews;
uint32 fShowMode;
BView *fDefaultView;
BStringView *fMessageView;
float fMinWidth;
float fMinHeight;
int32 fWindowMoved;
int32 fLastWorkspace;
BRect fFrame;
uint32 _reserved[5];
};
class BMailStatusView : public BBox {
public:
void AddProgress(int32 how_much);
void SetMessage(const char *msg);
void SetMaximum(int32 max_bytes);
int32 CountTotalItems();
void SetTotalItems(int32 items);
void AddItem(void);
void Reset(bool hide = true);
virtual ~BMailStatusView();
private:
friend class BMailStatusWindow;
BMailStatusView(BRect rect,const char *description,bool upstream);
void AddSelfToWindow();
BStatusBar *status;
BMailStatusWindow *window;
int32 items_now;
int32 total_items;
bool is_upstream;
bool by_bytes;
char pre_text[255];
uint32 _reserved[5];
};
#endif /* ZOIDBERG_STATUS_WINDOW_H */