History log of /haiku/src/kits/mail/MailProtocol.cpp
Revision Date Author Comments
# 109459c8 02-May-2016 Murai Takashi <tmurai01@gmail.com>

MailProtocol.cpp: fix gcc6 build

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>


# de4b1ded 20-Jan-2016 Axel Dörfler <axeld@pinc-software.de>

BMailProtocol: Removed delete/append methods.

* The mail system is file based which makes these methods pretty much
superfluous.


# 81805393 04-Jan-2016 Axel Dörfler <axeld@pinc-software.de>

IMAP: setting flags, and body fetching works now.

* The direct methods in BMailProtocol now forward the request to the
looper; it's no longer the mail_daemon's responsibility to know
anything about that protocol.
* It's in desperate need of refactoring, but it doesn't hurt to add
it to the repository as is.


# 62eec600 21-Nov-2015 Axel Dörfler <axeld@pinc-software.de>

SMTP works again.

* The message to send the mails never made it to the add-on looper.
* Mail protocol threads now have names.
* Added a "public" BOutboundMailProtocol::SendMessages() call that sends
itself a message (even the correct one this time).


# d33e4744 03-Jul-2013 Axel Dörfler <axeld@pinc-software.de>

IMAP: downloading mails is now working.

* Changed the way the attributes are written to make sure that everything
that can be written once is in fact written just once.
* The rename code in BMailProtocol::_ProcessFetchedHeader() was broken,
and caused the hang of the last commit.


# 549949b2 26-Jun-2013 Axel Dörfler <axeld@pinc-software.de>

Mail Kit: Changed how filter changes work.

* BMailFilter::HeaderFetched() now only alters the entry_ref, and returns
B_MOVE_MAIL_ACTION to move a mail.
* Instead of potentially moving the file around several times, the
BMailProtocol now takes care of carrying out the filter action just once,
including trying to make the file name unique.
* This also allows the IMAP add-on to know the final location of the mail,
and thus downloading a message actually works.
* However, with my test inbox, it currently hangs, and a current Debugger does
not work on my older system -- I guess I need to update.
* Replaced the duplicated space mechanism within the "HaikuMailFormatFilter"
that is substantially faster, and handles all whitespace, not just spaces.
It will also replace tabs with spaces.


# ca3341c7 12-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Major mail protocol/filter settings rework.

* Instead of abusing BArchive::Archive() we now use a BMailSettingsView as
a base view for all filter/protocol settings that works with
BMailAddOnSettings.
* Cleanups in E-mail which is now completely layout friendly. But also still
crashes when changing the views.


# bcf60bbb 30-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Fixed Mail build.

* The former kMsgBodyFetched (now B_MAIL_BODY_FETCHED, following the other
message constant names in AppDefs.h) must be public.


# 146357b5 30-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

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

* Completely untested yet. Unlikely to work yet.


# 715bf3d1 26-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Work in progress of mail rework.

* Not everything compiles; all protocols, and inbound filters do, though.
* Renamed a few classes to give a better idea what they are for; prefixed
public classes with the 'B' prefix.
* Moved ProtocolConfigView's classes into the BPrivate namespace.
* Moved BMailFilter into its own file.
* Added BMailFilter::DescriptiveName(). This is now used by the RuleFilter
in order to give a description of what it's doing (ie. no more dozens of
"Rule filter" entries in the preferences).
* Removed no longer used MailAddon.h.
* Renamed Addon to AddOn where found, since that is more consistent with the
rest of the API.
* Merged the former MailProtocol with the former MailProtocolThread; the
differentiation between those two was pretty messy.
* All configuration views touched so far are now using the layout kit.
* The RuleFilter is currently broken functionality wise; I have not yet decided
how to solve the stuff it uses (TriggerFileMove() does not exist anymore,
for example).
* BMailAddOnSettings (formerly known as AddonSettings) now directly subclass
BMessage; there are no Settings() and EditSettings() method anymore. The
class uses a copy of itself to determine whether or not it has been changed.
* Lots of cleanup.


# 0f11280e 26-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Minor MailNotifier cleanup.

* Renamed to BMailNotifier, as it's part of the public API.
* Renamed Notifier.{cpp|h} to DefaultNotifier.{cpp|h} as that's the class it
implements.
* Made the mail counts uint32, and the byte counts uint64.


# 0c7f804c 08-Oct-2011 Axel Dörfler <axeld@pinc-software.de>

* mail_util.h was not self-contained.
* Added a few missing breaks in MailProtocolThread::MessageReceived()!
* Minor coding style update.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42808 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cba256dc 20-Jun-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Apply a nice patch from Taos, just some smaller style fixes by myself.
Localize the mail kit.
The Japanese translation is attached to #7689. Please give a notice when it is in the translation system and the ticket can be closed.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42267 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f5a2f7b7 06-Mar-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Set progress after the body has been fetched. This fixes #7255.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40832 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8d2bbd6 03-Mar-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Partial downloaded messages are now opened by Mail and not by the mail daemon. Mail request the body fetch and get notified when the daemon is done. During this time the Mail window title is showing "Downloading: subject". This fixes #7256.
- Some cleanup in Mail.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40789 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9967dfd9 21-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Extend MarkMailAsRead to take a flag not only a bool value. Write an additional MAIL:read attribute.
- Remove some hard coded paths.
- Catch failure of FindMessage correctly. Thanks Axel.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40593 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0e657c0b 20-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Remember tracker message when downloading a partial message and open it with Mail. This is needed to get the next/previous message after downloading the body.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40575 a95241bf-73f2-0310-859d-f6bbb57e9c96


# df0ad9c1 14-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix account name in mail.
Work in progress: fetch next partial downloaded message.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40504 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1af4fa4b 08-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

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


# acb73fef 10-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

No need to iterate volumes's trash folders: we knows on which
device/volume the entry was moved, checking if it's in this volume trash folder is enough.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39807 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fda6d9ab 10-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

As suggested by Rene and Jerome, switch to BDirectory::Contains(),
which is way cleaner.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39806 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dfc6cf01 10-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Reworked TrashMonitor to watch actual trash folder(s).
It was still monitoring /boot/home/Desktop/Trash folder,
which don't exists anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39803 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08eedf6c 20-Jul-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

- Remove error reporting when we can not open the inbox directory to read the
manifest from it. This is a common condition on the first run.
- Added a comment about this.

This fixes ticket #2133.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31650 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e927a5f 30-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc.h ain't no standard header. Use stdlib.h instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eb9b1980 03-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed gcc 4(.1.2) build problems.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20320 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 37dd67fb 30-Mar-2005 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Fixed a bug that would cause messages to be redownloaded in the event of an unclean shutdown on systems with leave mail on server enabled, but bidirectional synchronization off.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12176 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3a2f393 30-Oct-2004 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Fixed a bug that would cause queued messages stored in IMAP directories not to be sent if IMAP mail was checked before queued mail was sent. This the last known bug in MDR.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9665 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7215ac8 20-Sep-2004 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Imported MDR. Some code still not entirely functional -- I haven't been able to figure out how to detect SSL, so IMAP and POP have it turned off. PPP auto-detect is also not functional at the moment. Other than that, it seems to work beautifully. Packaging will come later.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9016 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d33e4744df1542a1350f55c25ce7b691560d7345 03-Jul-2013 Axel Dörfler <axeld@pinc-software.de>

IMAP: downloading mails is now working.

* Changed the way the attributes are written to make sure that everything
that can be written once is in fact written just once.
* The rename code in BMailProtocol::_ProcessFetchedHeader() was broken,
and caused the hang of the last commit.


# 549949b26f4df07ba280792c18a515553f489388 26-Jun-2013 Axel Dörfler <axeld@pinc-software.de>

Mail Kit: Changed how filter changes work.

* BMailFilter::HeaderFetched() now only alters the entry_ref, and returns
B_MOVE_MAIL_ACTION to move a mail.
* Instead of potentially moving the file around several times, the
BMailProtocol now takes care of carrying out the filter action just once,
including trying to make the file name unique.
* This also allows the IMAP add-on to know the final location of the mail,
and thus downloading a message actually works.
* However, with my test inbox, it currently hangs, and a current Debugger does
not work on my older system -- I guess I need to update.
* Replaced the duplicated space mechanism within the "HaikuMailFormatFilter"
that is substantially faster, and handles all whitespace, not just spaces.
It will also replace tabs with spaces.


# ca3341c7b430ae9c6a1e7ec22f9aa83d46910814 12-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Major mail protocol/filter settings rework.

* Instead of abusing BArchive::Archive() we now use a BMailSettingsView as
a base view for all filter/protocol settings that works with
BMailAddOnSettings.
* Cleanups in E-mail which is now completely layout friendly. But also still
crashes when changing the views.


# bcf60bbb83484e8a2715daae55bce55d60457853 30-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Fixed Mail build.

* The former kMsgBodyFetched (now B_MAIL_BODY_FETCHED, following the other
message constant names in AppDefs.h) must be public.


# 146357b547221dd608cdb63feadd8b6bbc5988da 30-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

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

* Completely untested yet. Unlikely to work yet.


# 715bf3d17a81353ae5d1fa6867587cc0f5c32ce1 26-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Work in progress of mail rework.

* Not everything compiles; all protocols, and inbound filters do, though.
* Renamed a few classes to give a better idea what they are for; prefixed
public classes with the 'B' prefix.
* Moved ProtocolConfigView's classes into the BPrivate namespace.
* Moved BMailFilter into its own file.
* Added BMailFilter::DescriptiveName(). This is now used by the RuleFilter
in order to give a description of what it's doing (ie. no more dozens of
"Rule filter" entries in the preferences).
* Removed no longer used MailAddon.h.
* Renamed Addon to AddOn where found, since that is more consistent with the
rest of the API.
* Merged the former MailProtocol with the former MailProtocolThread; the
differentiation between those two was pretty messy.
* All configuration views touched so far are now using the layout kit.
* The RuleFilter is currently broken functionality wise; I have not yet decided
how to solve the stuff it uses (TriggerFileMove() does not exist anymore,
for example).
* BMailAddOnSettings (formerly known as AddonSettings) now directly subclass
BMessage; there are no Settings() and EditSettings() method anymore. The
class uses a copy of itself to determine whether or not it has been changed.
* Lots of cleanup.


# 0f11280e6d43c1d497b20d76759ae8b653876654 26-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Minor MailNotifier cleanup.

* Renamed to BMailNotifier, as it's part of the public API.
* Renamed Notifier.{cpp|h} to DefaultNotifier.{cpp|h} as that's the class it
implements.
* Made the mail counts uint32, and the byte counts uint64.


# 0c7f804cec9077746a5b0b99d9fbc66b47c9c2af 08-Oct-2011 Axel Dörfler <axeld@pinc-software.de>

* mail_util.h was not self-contained.
* Added a few missing breaks in MailProtocolThread::MessageReceived()!
* Minor coding style update.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42808 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cba256dc5bb18ebbe7622174cf9e87100422421e 20-Jun-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Apply a nice patch from Taos, just some smaller style fixes by myself.
Localize the mail kit.
The Japanese translation is attached to #7689. Please give a notice when it is in the translation system and the ticket can be closed.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42267 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f5a2f7b79d4ca4da51bdbe8f1717ce0dedb41f71 06-Mar-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Set progress after the body has been fetched. This fixes #7255.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40832 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8d2bbd6167a4b751f67b2a171d770695f5055ca 03-Mar-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Partial downloaded messages are now opened by Mail and not by the mail daemon. Mail request the body fetch and get notified when the daemon is done. During this time the Mail window title is showing "Downloading: subject". This fixes #7256.
- Some cleanup in Mail.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40789 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9967dfd9243396f9bed5f7b357451cda8cd48f26 21-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Extend MarkMailAsRead to take a flag not only a bool value. Write an additional MAIL:read attribute.
- Remove some hard coded paths.
- Catch failure of FindMessage correctly. Thanks Axel.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40593 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0e657c0b6c38084d9aa684515ec505a212b96bc9 20-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Remember tracker message when downloading a partial message and open it with Mail. This is needed to get the next/previous message after downloading the body.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40575 a95241bf-73f2-0310-859d-f6bbb57e9c96


# df0ad9c12a92a83718b4442e87034a8a2951efff 14-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix account name in mail.
Work in progress: fetch next partial downloaded message.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40504 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1af4fa4ba62ba7e49fc47d60a3a89083b6f51c6f 08-Feb-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

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


# acb73fef473ecfdfe4121b0f36234302cb03025c 10-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

No need to iterate volumes's trash folders: we knows on which
device/volume the entry was moved, checking if it's in this volume trash folder is enough.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39807 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fda6d9ab6f89cadee02edfe70cb577c62cc981f9 10-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

As suggested by Rene and Jerome, switch to BDirectory::Contains(),
which is way cleaner.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39806 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dfc6cf0159ce2ad08dd99641b875c2f72a0ca21e 10-Dec-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Reworked TrashMonitor to watch actual trash folder(s).
It was still monitoring /boot/home/Desktop/Trash folder,
which don't exists anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39803 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08eedf6c5bcc94548c888d68bec6bc058b0df8f1 20-Jul-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

- Remove error reporting when we can not open the inbox directory to read the
manifest from it. This is a common condition on the first run.
- Added a comment about this.

This fixes ticket #2133.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31650 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e927a5fc080cb934e7584454f472cacf4c3e361 30-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc.h ain't no standard header. Use stdlib.h instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eb9b19800b63d6384fe0937791cb8dd087373e13 03-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed gcc 4(.1.2) build problems.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20320 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 37dd67fbd17cd89eb1ad015a399cb52a7912a7a6 30-Mar-2005 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Fixed a bug that would cause messages to be redownloaded in the event of an unclean shutdown on systems with leave mail on server enabled, but bidirectional synchronization off.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12176 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3a2f3930fd7a4df138d0e6462ad19c3799e46a8 30-Oct-2004 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Fixed a bug that would cause queued messages stored in IMAP directories not to be sent if IMAP mail was checked before queued mail was sent. This the last known bug in MDR.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9665 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7215ac853ab5fda385dffd3e3dc0e1f74662ce9 20-Sep-2004 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Imported MDR. Some code still not entirely functional -- I haven't been able to figure out how to detect SSL, so IMAP and POP have it turned off. PPP auto-detect is also not functional at the moment. Other than that, it seems to work beautifully. Packaging will come later.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9016 a95241bf-73f2-0310-859d-f6bbb57e9c96