After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 713986 - Support Archive special folder
Support Archive special folder
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: server-support
master
Other All
: High normal
: 0.11.0
Assigned To: Geary Maintainers
Geary Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-16 10:27 UTC by Jim Nelson
Modified: 2016-05-15 07:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds Archive support for all IMAP accounts (9.88 KB, patch)
2015-05-03 09:42 UTC, Emersion
none Details | Review
Adds Archive support for all IMAP accounts (8.82 KB, patch)
2015-05-12 15:34 UTC, Emersion
none Details | Review
Adds Archive support for all IMAP accounts (9.23 KB, patch)
2015-05-24 15:56 UTC, Emersion
accepted-commit_now Details | Review

Description Charles Lindsay 2013-11-21 20:23:55 UTC


---- Reported by jim@yorba.org 2013-09-16 15:27:00 -0700 ----

Original Redmine bug id: 7492
Original URL: http://redmine.yorba.org/issues/7492
Searchable id: yorba-bug-7492
Original author: Jim Nelson
Original description:

Some services (i.e. Outlook.com, see #7479) support the notion of an "Archive"
folder. This is different than All Mail in that it's not a virtual folder of
every message, but rather a catch-bin for the user to drop everything they
want to keep once they're done with it in their Inbox. Thunderbird has [some
support for this](http://kb.mozillazine.org/Archiving_your_e-mail), although
it's complicated by their notion of local-only versus remote folders, as well
as an optional date hierarchy that the client automatically generates.

For Geary, it's probably sufficient to simply offer support for an Archive
folder that the Archive button moves email into. There's an \Archive SPECIAL-
USE attribute (#6070), so that should be supported, as well as allowing the
user to specify their Archive folder in the Account preferences (#6066).

Related issues:
related to geary - Feature #7479: Support Outlook.com IMAP (Fixed)
related to geary - Feature #6070: Support SPECIAL-USE extension (Open)
related to geary - Feature #6066: Geary has no interface for selecting default
IMAP Junk/Se... (Open)
related to geary - Feature #5338: Archive for non-Gmail servers (Open)



--- Bug imported by chaz@yorba.org 2013-11-21 20:24 UTC  ---

This bug was previously known as _bug_ 7492 at http://redmine.yorba.org/show_bug.cgi?id=7492

Unknown milestone "unknown in product geary. 
   Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
Resolution set on an open status.
   Dropping resolution 

Comment 1 Federico Bruni 2014-10-10 23:14:41 UTC
I'm trying to retrieve the bugzilla issue number of redmine issue #6070. The following search doesn't work:
https://bugzilla.gnome.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__all__&product=geary&content=yorba-bug-6070

Please help
Comment 2 Jim Nelson 2014-10-10 23:20:13 UTC
That's bug #714103.
Comment 3 Emersion 2015-05-03 09:42:02 UTC
Created attachment 302793 [details] [review]
Adds Archive support for all IMAP accounts

Need to detect if the account has a special "Archive" folder to hide/show archive button for Geary.ImapEngine.OtherAccount.
Comment 4 Robert Schroll 2015-05-03 22:36:55 UTC
Thanks for the patch!

I notice some commented-out code in there.  Is this a work-in-progress, or is that just some remnant from testing?
Comment 5 Emersion 2015-05-04 05:51:13 UTC
It's a test to detect if there is an "Archive" folder available or not. But I don't even know if it's relevant to do this test, since we create the folder if it doesn't exist. What do you think?
Comment 6 Emersion 2015-05-12 15:34:55 UTC
Created attachment 303271 [details] [review]
Adds Archive support for all IMAP accounts

Ready for review
Comment 7 Robert Schroll 2015-05-12 18:22:18 UTC
Review of attachment 303271 [details] [review]:

The accounts system is not my area of expertise.  I've asked Jim Nelson to take a look at the substance of your patch.  In the meantime, I can offer a few style pointers.  Feel free to wait for Jim's review before addressing anything.

::: src/engine/imap-engine/other/imap-engine-other-folder.vala
@@ +15,3 @@
+        // Use move_email_async("Archive") here; Gmail will do the right thing and report
+        // it was copied with the pre-existing All Mail UID (in other words, no actual copy is
+        // performed). This allows for undoing an archive with the same code path as a move.

I think this comment was mistakenly carried over from the Gmail implementation.

@@ +18,3 @@
+        Geary.Folder? archive_folder = null;
+        try {
+            archive_folder = yield account.get_required_special_folder_async (Geary.SpecialFolderType.ARCHIVE, cancellable);

Yorba style is no space between function name and opening paren.

@@ +26,3 @@
+            debug("Can't archive email because no archive folder was found in %s", account.to_string());
+        } else {
+            stderr.printf (archive_folder.path.get_fullpath (null));

I assume this is a debugging line that can be removed.
Comment 8 Emersion 2015-05-24 15:56:30 UTC
Created attachment 303880 [details] [review]
Adds Archive support for all IMAP accounts

Fixed, now ready for review :-)
Comment 9 Jim Nelson 2015-05-24 21:30:20 UTC
Review of attachment 303880 [details] [review]:

Unfortunately, I don't have access to an IMAP account that supports Archive to test this.  I'm going to assume you do and have tested this out.

If so, this looks good to me.
Comment 10 Federico Bruni 2015-05-25 09:02:04 UTC
Emersion, thanks for your work!

I'm testing your patch on an imap account using dovecot on the server and AFAICS it works perfect. Archiving in Geary worked immediately, while I had to reconfigure the special folder on the server: I think that Geary created an ARCHIVE folder on the server, but I had to manually make it visible and configure it as special folder (I used to use a regular folder for the archive action on the webmail).
Comment 11 Federico Bruni 2015-05-25 14:27:53 UTC
I noticed only one minor issue: Geary displays initially an Archive folder under Labels, while getting updates from the server. Then the Archive folder disappears and it appears a new special folder called Archivio (italian locale), right below Outgoing folder.

This happens every time Geary is launched and it takes from 30 seconds to 1 minute or more.

I've just realized that this happens also with the Spam special folder.
I can send you a screenshot of my webmail configuration for special folders. Or maybe some logs privately?
Comment 12 Federico Bruni 2015-05-28 11:28:49 UTC
Forget my last comment: I guess it was just a network/sync problem.
Today, the sync is fast and the special folders are immediately in the right place.

I hope this patch will be merged soon.
Thanks
Comment 13 Robert Schroll 2015-05-28 16:24:18 UTC
Pushed as 51ecfe0d9.  Thanks for seeing this through!