Commit Graph

265 Commits

Author SHA1 Message Date
Axel Dörfler
f429e4f442 IMAP: Fixed stream vs. parse exception handling.
* Protocol::HandleNextResponse() will now exit when a stream exception
  occurs.
* This should fix bug #12601.
2016-02-10 13:55:56 +01:00
Axel Dörfler
15216b261a IMAP: Retrieve on-disk folder state async.
* Messages that we don't have info for during synchronization are now
  collected, and synchronized once the folder state is available,
  instead of waiting for that particular entry to become available
  (without proper means to wait).
2016-02-10 13:55:55 +01:00
Axel Dörfler
1870a4b1f9 IMAP: Fixed sync command handling.
* The counter did not take continuation commands into account, so that
  it would never reach zero again.
* Optimized IMAPConnectionWorker::_WaitForCommands() such that it will
  always acquire all available "slots".
2016-02-10 13:55:55 +01:00
Axel Dörfler
7d6cefeb50 IMAP: Ignore \Noselect mailboxes.
* They aren't selectable, so we can just hide them from the user.
* This should fix #12369.
2016-02-10 13:55:31 +01:00
Axel Dörfler
de4b1dede1 BMailProtocol: Removed delete/append methods.
* The mail system is file based which makes these methods pretty much
  superfluous.
2016-01-26 16:01:03 +01:00
Adrien Destugues
69f2466090 IMAP: Fix exception message. 2016-01-16 18:56:40 +01:00
Rene Gollent
8028ede7db Build: Add architecture rule for libshared.a.
- As suggested by Ingo, add libshared.a to the architecture name map.
  This allows it to be linked by its short name like other frequently
  used libraries.
- Adjust all Jamfiles referencing the lib accordingly.
2016-01-15 21:12:24 -05:00
Axel Dörfler
aeaf68cf4b IMAP: Extra local messages are now deleted.
* When a message on the server is deleted, it will now be deleted
  locally, too.
2016-01-14 21:03:46 +01:00
Axel Dörfler
618cc43b64 IMAP: New folders will now adopt default mail attributes.
* Added a function CopyMailFolderAttributes() that copies the attribute
  layout from the text/x-email default query folder.
* This using the new CopyAttributes() method in libshared that is pretty
  much a copy of a similar method from copyattr. However, I did not
  replace the latter, as that one allows for more fine grained error
  reporting (and attribute filtering).
* Closes ticket #3498.
2016-01-14 21:00:38 +01:00
Axel Dörfler
4681e405ef MatchHeader: Fixed crash with action, use tooltips.
* When an action was already set, a menu item was being selected before
  the menu had been created -- must have happened on some refactoring.
* Use tooltips rather than fill the header/value text controls with some
  help texts.
2016-01-14 20:53:51 +01:00
Axel Dörfler
8180539313 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.
2016-01-05 20:12:26 +01:00
looncraz
fa19dd4470 apps: Convert to using Set*UIColor.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Patches 0045-0075, 0077-0087 from looncraz, unmodified.
2016-01-04 07:33:09 -05:00
Axel Dörfler
29871039d7 IMAP: Use BStringList instead of STL vector. 2015-12-22 19:35:09 +01:00
Axel Dörfler
184619e625 IMAP: removed superfluous files from the old implementation. 2015-12-22 19:35:08 +01:00
Axel Dörfler
62eec60079 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).
2015-11-22 11:35:17 +01:00
Axel Dörfler
d5607aa971 SMTP: properly use const, and extern "C".
* This fixes having it picked up in the mail_daemon. That shouldn't have
  worked in the last three years...
2015-11-07 17:07:06 +01:00
Jérôme Duval
9cd62a24e5 Fixed C++11 warnings.
invalid suffix on literal; C++11 requires a space between literal and string macro
[-Werror=literal-suffix]
2015-07-25 23:42:13 +02:00
Julian Harnath
f7db4635b0 POP3 mail add-on: set unread attribute on fetched mail
- ...to make the new mails show up in the "New E-Mail" query
2015-03-01 21:00:18 +01:00
Julian Harnath
3d5b1581ac POP3 mail add-on: fix fetching mail bodies without limit
* "No limit set" is signaled by a negative value in fFetchBodyLimit
  (cf. logic in POP3Protocol::SyncMessages())
2015-03-01 21:00:13 +01:00
Jérôme Duval
80c3a060f9 POP3: link against libstdc++ for debug build 2015-02-07 17:37:02 +01:00
Jérôme Duval
b9962ceac2 IMAP,POP3,NewMailNotification: fixed x86_64 build.
* Notifier::HeaderFetched(): fixed the method signature (go figure how it could
build on x86).
* POP3: fSizes type is now std::vector<size_t> instead of BList. Please review.
off_t might be a better choice.
* added the mail_daemon add-ons to the Haiku package again.
2015-01-08 22:31:43 +01:00
Axel Dörfler
4fe2002b47 IMAP: fixed GCC4 build. 2015-01-08 15:36:47 +01:00
Axel Dörfler
4601929263 IMAP: let mail retrieval scale better.
* We now also maintain a mail index -> UID array in IMAPMailbox.
* Instead of fetching the message entries by a fixed range of UIDs, we use the
  message count, and get the entries by index.
* Likewise, in FetchHeadersCommand, we now get a list of UIDs rather than a
  range. This makes it possible to only download exactly the headers we want.
* Extended FetchCommand to be able to dynamically build a sequence list from
  a list of UIDs.
* Besides the suboptimal body fetching (one at a time, due to holes in the
  IMAP specification), we should now be able to retrieve the messages with
  pretty much optimal performance, while retaining an acceptable responsiveness
  to user requests.
2015-01-06 15:26:51 +01:00
Axel Dörfler
d33e4744df 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.
2015-01-06 15:26:47 +01:00
Axel Dörfler
cf14e7f21f Build fixes.
* Never built a complete image from the IMAP branch before.
2015-01-06 15:26:42 +01:00
Axel Dörfler
549949b26f 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.
2015-01-06 15:26:37 +01:00
Axel Dörfler
c1f779e350 IMAP: FetchMessageEntriesCommand now also works without UIDs
* This will be used to solve the TODO in CheckMailboxesCommand::Process()
  when the initial message sizes/flags are retrieved.
* Also fixed imap_tester build.
2015-01-06 15:26:33 +01:00
Axel Dörfler
1052525dc5 IMAP: work in progress of downloading the mail body.
* Most things are in place now, we just try to download the body to the
  wrong file, as the final location is currently unknown.
* Added local only kPartialMessage flag for mails, but it's not being
  used yet.
2015-01-06 15:26:28 +01:00
Axel Dörfler
dcb85ffa51 IMAP: if connecting fails, try again a few times.
* Also documented SyncCommand.
2015-01-06 15:26:24 +01:00
Axel Dörfler
e9a197ffff IMAP: make the body fetch limit setting available.
* This is set by the ProtocolConfigView -- there should really be
  some constant for this.
2015-01-06 15:26:19 +01:00
Axel Dörfler
29e5da6f20 IMAP: allow only one sync at a time, divided header fetching.
* CheckMailboxesCommand, and FetchHeadersCommand now inherit from SyncCommand
  which will prevent new CheckMailboxesCommand to be enqueued.
* FetchHeadersCommand now only retrieves up to kMaxFetchEntries headers at
  once. This gets the same TODO about scaling as the limit in
  CheckMailboxesCommand when fetching the flags/UIDs. Since we already read
  all new UIDs at that point, we could easily do better there, though.
2015-01-06 15:26:10 +01:00
Axel Dörfler
aebdd0c14b IMAP: call the folder's handler like the mailbox. 2015-01-06 15:26:05 +01:00
Axel Dörfler
4b2c5571c0 IMAP: sync when requested. 2015-01-06 15:26:00 +01:00
Axel Dörfler
47b68f5806 IMAP: IMAPFolder now stores the last UID.
* So mails are no longer downloaded every time.
2015-01-06 15:25:56 +01:00
Axel Dörfler
28ee6c2839 IMAP: Use useful default without destination.
* We now use the account name as destination directory.
* Turns out that an empty string is written as destination which worked
  around the GetString() solution.
2015-01-06 15:25:51 +01:00
Axel Dörfler
eba458b940 imap: Fetching headers is now working.
* No state is stored yet, though, so that all messages will be downloaded
  over and over again.
2015-01-06 15:25:47 +01:00
Axel Dörfler
3302df142e imap: WIP of getting fetching headers to work.
* Changed the FetchListener mechanism quite a bit.
* Doesn't seem to work correctly yet, although most pieces are in
  place now.
2015-01-06 15:25:33 +01:00
Axel Dörfler
9234fd439e imap: Implemented encoding RFC3501 strings.
* Was completely missing so far.
* Fixed bug in decoding that handled the "&-" sequence incorrectly.
* Added small test application that should easily be convertible to
  a unit test.
2015-01-06 15:25:28 +01:00
Axel Dörfler
229c777323 imap: Testing for new messages is now working.
* There is now a CheckSubscribedFoldersCommand that is issued on the main
  connection that triggers everything.
* The new CheckMailboxesCommand divides the new mail check into several
  portions, and requeues itself until the next step, ie. the
  FetchHeadersCommand.
* The headers of the new mails are downloaded, but nothing is done with
  them yet.
* The actual check for the new mails doesn't scale that well yet, not sure
  how to properly do this without having to rely on the mail indices. Might
  be sensible to solve this via some simple heuristic.
2015-01-06 15:25:24 +01:00
Axel Dörfler
7993ddfaba imap: Fleshed out command processing.
* Still doesn't do anything useful, though.
2015-01-06 15:25:14 +01:00
Axel Dörfler
a4bdd26d61 imap: Work in progress of connection setup.
* SelectCommand now correctly encodes the mailbox name again.
* Hierarchy separators from the LIST/LSUB commands are now properly parsed,
  and taken into account.
* Folders in the file system are now created for mailboxes on the server,
  supporting hierarchical mailbox names.
* A connection worker now has an IMAPFolder that handles the local side of the
  mailbox, and an IMAPMailbox that handles the server side.
* Connection workers are now created/deleted, and setup correctly. They will
  now also wait in case they don't have a mailbox until they get some.
2015-01-06 15:25:10 +01:00
Axel Dörfler
adbe8fc944 IMAP: The connection workers are now started.
* On SyncMessages(), the main connection worker is started if it is not already
  running (it may only run already in idle mode).
* This will then list the subscribed folders, and create as many more connection
  workers as allowed and make sense.
* Finally, it will distribute the folders to the workers which don't do anything
  further yet.
2015-01-06 15:25:05 +01:00
Axel Dörfler
c67313f3c3 imap: added Settings::MaxConnections()/IdleMode().
* Also made use of the new BMessage API for the existing methods.
2015-01-06 15:24:51 +01:00
Axel Dörfler
186c96d50c IMAP: Early work in progress of main protocol class. 2015-01-06 15:24:42 +01:00
Axel Dörfler
3ab3f57ad2 IMAP: FolderList is supposed to be an interface.
* Made its methods pure virtual.
2015-01-06 15:24:37 +01:00
Axel Dörfler
edf77456f2 IMAP: close folder config window on error, show message. 2015-01-06 15:24:33 +01:00
Axel Dörfler
c9fb410e42 IMAP: fixed folder configuration.
* Store the settings, don't archive the view; removed leftovers of the
  old settings API.
2015-01-06 15:24:28 +01:00
Axel Dörfler
d6ce6060b9 pop3: minor cleanup. 2015-01-06 15:24:24 +01:00
Axel Dörfler
a9de7ece6b pop3: Fixed maintaining fSizes list, and more.
* The list was filled, but never emptied.
* If SyncMessages() was called more than once for the same POP3 instance,
  this could garble the mails retrieved in the second run.
* Maintain the total size of mails in fSizes to be able to report progress
  in more detail.
* Also adapted progress reporting to the argument changes made in MailProtocol
  earlier.
* Minor cleanup.
2015-01-06 15:24:19 +01:00
Axel Dörfler
fa587d2956 The protocol config view now adds some glue at the bottom.
* This makes all boxes fill the complete height of the window.
* The SMTP add-on did that itself which makes no sense.
2015-01-06 15:23:51 +01:00