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 726866 - Use NAMESPACE for special folder creation
Use NAMESPACE for special folder creation
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: engine
0.6.x
Other Linux
: High major
: 0.13.0
Assigned To: Geary Maintainers
Geary Maintainers
Depends on: 768422
Blocks:
 
 
Reported: 2014-03-22 09:58 UTC by Jürg Billeter
Modified: 2017-11-09 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jürg Billeter 2014-03-22 09:58:34 UTC
When I click on trash or delete for a conversation in the inbox, nothing happens. No effect in the GUI and also no console output.

Also, geary still lists mails that are trashed (but not expunged) in Evolution. The sidebar also doesn't list a trash folder.

This is with a Dovecot IMAP server.
Comment 1 Jürg Billeter 2014-03-22 14:09:13 UTC
Enabling --debug I get the following log messages when trying to trash:

 [deb] 14:39:02 3.990096 geary-controller.vala:1963: Trashing selected messages
 [deb] 14:39:02 0.000104 imap-engine-generic-account.vala:558: Previously used Trash for special folder GEARY_SPECIAL_FOLDER_TYPE_TRASH
 [deb] 14:39:02 0.000014 imap-engine-generic-account.vala:602: Creating Trash to use as special folder GEARY_SPECIAL_FOLDER_TYPE_TRASH
 [deb] 14:39:02 0.038854 imap-client-session.vala:1017: [0002/mail.example.com/default:993 GEARY_IMAP_CLIENT_SESSION_STATE_AUTHORIZED] Received error from server: a024 NO Unknown namespace.
 [deb] 14:39:02 0.000425 geary-controller.vala:1997: Unable to archive/trash/delete messages: Server reports error creating path Trash: a024 NO Unknown namespace.

There is no physical trash folder on that server and the server configuration doesn't allow creating top-level folders for some reason. All user folders are subfolders of INBOX.

Is there a reason why geary does not use the IMAP \Deleted flag for the trash operation?

Delete without trash appears to work now without changing anything.
Comment 2 Jim Nelson 2014-03-24 23:06:11 UTC
A couple different issues here:

* Geary doesn't support IMAP namespaces at this time.  We've not seen a server that required them, actually.

* The Trash operation is designed to move messages from the folder to a Trash folder; this is done by an IMAP COPY followed by a delete.  However, if there is no Trash folder and Geary can't create one, the operation will fail.  This is what's happening according to your log.

Some questions:

* Did Delete not work before but it works now?  That's odd, I would need more logging to figure out why it didn't work at first.  Delete is pretty much what it sounds like: Geary sets the \Deleted flag and then expunges the message.

* Is there a Trash folder on the server?  Or is Evolution's trash a local-only folder?
Comment 3 Jürg Billeter 2014-03-25 03:31:07 UTC
(In reply to comment #2)
> * Geary doesn't support IMAP namespaces at this time.  We've not seen a server
> that required them, actually.

I can't control the server configuration, unfortunately. The server might be configured as described in the section 
'Backwards Compatibility: Courier IMAP' on the Dovecot wiki¹.

> * The Trash operation is designed to move messages from the folder to a Trash
> folder; this is done by an IMAP COPY followed by a delete.  However, if there
> is no Trash folder and Geary can't create one, the operation will fail.  This
> is what's happening according to your log.
> 
> Some questions:
> 
> * Did Delete not work before but it works now?  That's odd, I would need more
> logging to figure out why it didn't work at first.  Delete is pretty much what
> it sounds like: Geary sets the \Deleted flag and then expunges the message.

I didn't have logging enabled at first. If I can reproduce the issue with logging enabled, I'll come back to this. As the issue is likely independent of the trash issue, I've edited the bug title accordingly.

> * Is there a Trash folder on the server?  Or is Evolution's trash a local-only
> folder?

There is no trash folder on the server. By default, Evolution implements the trash operation by setting the \Deleted flag without expunging the message. The Evolution trash folder is a virtual folder listing all messages with the \Deleted flag. All other folders hide \Deleted messages by default.

I can easily create a trash folder on the server, of course. However, it'd have to reside in the INBOX namespace, which means that Geary won't recognize it as special folder, as far as I can tell.

If this is an uncommon server configuration, maybe provide at least some (non-prominent) way to manually configure the trash folder path. Evolution supports this when enabling 'Use Real Folder for Trash'.

¹ http://wiki2.dovecot.org/Namespaces
Comment 4 Jim Nelson 2014-03-25 18:56:26 UTC
> I can easily create a trash folder on the server, of course. However, it'd have
> to reside in the INBOX namespace, which means that Geary won't recognize it as
> special folder, as far as I can tell.

Geary looks in a number of "well-known" locations for the Trash, including Inbox.Trash, so that should work around the issue for you.  If not, please let me know.  (Also, unfortunately, Geary doesn't support create/remove/rename folders yet, so you'll need to use another client: bug #714216).

> If this is an uncommon server configuration, maybe provide at least some
> (non-prominent) way to manually configure the trash folder path. Evolution
> supports this when enabling 'Use Real Folder for Trash'.

That's ticketed as well: bug #714106.  Both are features we really wanted to get in for 0.6 but ran out of time.

I've updated this ticket's title as well to reflect the technical issue behind the problem.
Comment 5 Jürg Billeter 2014-03-25 19:06:20 UTC
(In reply to comment #4)
> Geary looks in a number of "well-known" locations for the Trash, including
> Inbox.Trash, so that should work around the issue for you.  If not, please let
> me know.  (Also, unfortunately, Geary doesn't support create/remove/rename
> folders yet, so you'll need to use another client: bug #714216).

This didn't work in my first attempt. It seems that Geary checks Inbox.Trash only at time of account setup. Creating the Inbox.Trash folder later on doesn't fix the configured path to the trash folder. However, I can confirm that trash works properly if the folder already exists when setting up the account.
Comment 6 Michael Gratton 2016-07-05 01:27:52 UTC
Jürg: You can also edit geary.ini for the account in ~/.local/share/geary/... to change Geary's idea of what the trash folder should be. If you blank out the value for the trash, then it will be updated again when restarted, assuming a trash mailbox exists or can be created.

If this still doesn't work for you, please let me know.

Not being able to delete messages when there is no trash is covered by Bug 738457, and I just filed Bug 768422 to cover adding NAMESPACE support, since it will be more broadly useful than just for this issue.

As Jim notes Geary will automatically look for a Trash folder on account creation and start up when one is not configured. It will then attempt to create it if not found — first as a top-level mailbox and then as child of INBOX. This is somewhat suboptimal when we can just use NAMESPACE to ask the server where to create it, however.

Aside from the creation problem, most of the issues above are ticketed elsewhere or have been resolved, so I'm going to re-appropriate this bug to cover using NAMESPACE to stop guessing and just folders in the right place.
Comment 7 Michael Gratton 2017-11-03 02:45:30 UTC
Adjusting summary since specials are the only mailboxes created at the moment.
Comment 8 Michael Gratton 2017-11-09 13:33:53 UTC
This was fixed in on master in commit 2af9412.