1af4fa4ba6
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
75 lines
2.7 KiB
C++
75 lines
2.7 KiB
C++
/* Filter - the base class for all mail filters
|
|
**
|
|
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
|
|
*/
|
|
#ifndef ZOIDBERG_MAIL_ADDON_H
|
|
#define ZOIDBERG_MAIL_ADDON_H
|
|
|
|
|
|
#include "MailProtocol.h"
|
|
#include "MailSettings.h"
|
|
|
|
|
|
class BView;
|
|
|
|
//
|
|
// The addon interface: export instantiate_mailfilter()
|
|
// and instantiate_mailconfig() to create a Filter addon
|
|
//
|
|
|
|
extern "C" _EXPORT InboundProtocol* instantiate_inbound_protocol(
|
|
BMailAccountSettings* settings);
|
|
extern "C" _EXPORT OutboundProtocol* instantiate_outbound_protocol(
|
|
BMailAccountSettings* settings);
|
|
extern "C" _EXPORT BView* instantiate_config_panel(MailAddonSettings&,
|
|
BMailAccountSettings&);
|
|
// return a view that configures the MailProtocol
|
|
// returned by the functions below. BView::Archive(foo,true)
|
|
// produces this addon's settings, which are passed to the in-
|
|
// stantiate_* functions and stored persistently. This function
|
|
// should gracefully handle empty and NULL settings.
|
|
|
|
extern "C" _EXPORT BView* instantiate_filter_config_panel(AddonSettings&);
|
|
extern "C" _EXPORT MailFilter* instantiate_mailfilter(MailProtocol& protocol,
|
|
AddonSettings* settings);
|
|
|
|
extern "C" _EXPORT BString descriptive_name();
|
|
// the config panel will show this name in the chains filter
|
|
// list if this function returns B_OK.
|
|
// The buffer is as big as B_FILE_NAME_LENGTH.
|
|
|
|
// standard Filters:
|
|
//
|
|
// * Parser - does ParseRFC2822(io_message,io_headers)
|
|
// * Folder - stores the message in the specified folder,
|
|
// optionally under io_folder, returns MD_HANDLED
|
|
// * HeaderFilter(regex,Yes_fiters,No_filters) -
|
|
// Applies Nes_filters to messages that have a header
|
|
// matching regex; applies No_filters otherwise.
|
|
// * CompatabilityFilter - Invokes the standard mail_dae-
|
|
// mon filter ~/config/settings/add-ons/MailDaemon/Filter
|
|
// on the message's Entry.
|
|
// * Producer - Reads outbound messages from disk and inserts
|
|
// them into the queue.
|
|
// * SMTPSender - Sends the message, via the specified
|
|
// SMTP server, to the people in header field
|
|
// "MAIL:recipients", changes the the Entry's
|
|
// "MAIL:flags" field to no longer pending, changes the
|
|
// "MAIL:status" header field to "Sent", and adds a header
|
|
// field "MAIL:when" with the time it was sent.
|
|
// * Dumper - returns MD_DISCARD
|
|
//
|
|
//
|
|
// Standard chain types:
|
|
//
|
|
// Incoming Mail: Protocol - Parser - Notifier - Folder
|
|
// Outgoing Mail: Producer - SMTPSender
|
|
//
|
|
// "chains" are lists of addons that appear in, or can be
|
|
// added to, the "Accounts" list in the config panel, a tree-
|
|
// view ordered by the chain type and the chain's AccountName().
|
|
// Their config views should be shown, one after the other,
|
|
// in the config panel.
|
|
|
|
#endif /* ZOIDBERG_MAIL_ADDON_H */
|