No such folder exists - When Deleting Mail

Post feedback about our hosted demo or your local install. Tell us what you love and/or what you’d like to see added in the future.
Post Reply
Ric878
Posts: 3
Joined: Tue Nov 20, 2018 2:18 pm

No such folder exists - When Deleting Mail

Post by Ric878 »

Hi,

I just installed Zimbra 8.8.10 a few days ago. After the initial install, I did some testing sending and receiving mail which worked great. Deleted the test emails and then started migrating mail from an IMAP account. After the migration of the IMAP account I started encountering an error whenever I try to delete an email. I get the following error:

Code: Select all

No such folder exists.
method:	[unknown]
msg:	no such folder id: 281
code:	mail.NO_SUCH_FOLDER
detail:	soap:Sender
trace:	qtp1286783232-19074:1542723347619:2aaca6de698e3629
request:	
Body: {
  ConvActionRequest: {
    _jsns: "urn:zimbraMail",
    action: {
      id: "-5313",
      l: "3",
      op: "trash",
      tcon: "-dtjs"
     }
   }
 },
Header: {
  context: {
    _jsns: "urn:zimbra",
    account: {
      _content: "ricardo.ortega@rso-solutions.com",
      by: "name"
     },
    authToken: "(removed)",
    change: {
      token: 10103,
      type: "new"
     },
    csrfToken: "0_7a0d726b4a9966913beb655c14cbe9bd0e0f2aba",
    notify: {
      seq: 2
     },
    session: {
      _content: 159,
      id: 159
     },
    userAgent: {
      name: "ZimbraWebClient - GC70 (Win)",
      version: "8.8.10_GA_3041"
     }
   }
 }
This happens on emails that were imported as well as new emails. Any hints as to what may be going on?

Thanks in advance, Ric.
Ric878
Posts: 3
Joined: Tue Nov 20, 2018 2:18 pm

Re: No such folder exists - When Deleting Mail

Post by Ric878 »

Any hints guys? I can't seem to find any information on anything like this anywhere.
User avatar
gabrieles
Outstanding Member
Outstanding Member
Posts: 233
Joined: Tue Feb 14, 2017 9:40 am

Re: No such folder exists - When Deleting Mail

Post by gabrieles »

What migration tool are you using?
BTW check the folder existence with
zmmailbox -z -m your_user@your_domain.tld gaf |grep 281
or
zmmailbox -z -m your_user@your_domain.tld gf 281

Have you got the mailbox.log of the day in which the problem has emerged? If yes search for the fate of that folder in mailbox.log:
cat /opt/zimbra/log/mailbox.log |grep your_user@your_domain.tld |grep 281
Ric878
Posts: 3
Joined: Tue Nov 20, 2018 2:18 pm

Re: No such folder exists - When Deleting Mail

Post by Ric878 »

Hi, thanks for the reply. I used the the migration tool found in "Tools and Migration" > "Account Migration" > "Migration Wizard"

When I run the "zmmailbox -z -m username@tld gf 281 gf 281", I get the following error:

zclient.CLIENT_ERROR (unknown folder: 281)

I of course changed the email address to the account in question.

When searching the logs for the day I "think" this happened, I see the following entry:

2018-11-18 16:35:07,560 INFO [qtp1286783232-4333:https:https://mail.server/service/soap/FolderActionRequest] [name=username@tld;mid=10;ip=107.150.xxx.xxx;port=58288;ua=ZimbraWebClient - GC70 (Win)/8.8.10_GA_3041;soapId=46cd66fb;] mailop - Deleting Folder Deleted Items (id=281).
gabrieles wrote:What migration tool are you using?
BTW check the folder existence with
zmmailbox -z -m your_user@your_domain.tld gaf |grep 281
or
zmmailbox -z -m your_user@your_domain.tld gf 281

Have you got the mailbox.log of the day in which the problem has emerged? If yes search for the fate of that folder in mailbox.log:
cat /opt/zimbra/log/mailbox.log |grep your_user@your_domain.tld |grep 281
neelabh
Posts: 1
Joined: Sat Sep 18, 2021 6:12 am

Re: No such folder exists - When Deleting Mail

Post by neelabh »

I recently faced the same issue. To resolve, try deleting the automatically created IMAP import datasource:

Code: Select all

zmprov deleteDataSource ricardo.ortega@rso-solutions.com __imap_import__
Explanation:

I followed the error stack trace and dug into the Zimbra source code.
Turns out that when deleting an item, Zimbra first looks for a trash folder in remote "datasources" and falls back to a local trash folder if one is not found.
Relevant code: com.zimbra.cs.service.mail.ItemAction#getImapTrashFolder

When doing an IMAP import, Zimbra creates a new datasource for that account, called "__imap_import__".
This datasource somehow contains a reference the the imported trash folder, in your case the folder "Deleted Items" (item ID 281).

Try out the following command:

Code: Select all

zmprov getDataSources ricardo.ortega@rso-solutions.com
It should return something like the following:

Code: Select all

# name __imap_import__
# type imap
objectClass: zimbraDataSource
objectClass: zimbraImapDataSource
...
zimbraDataSourceImapTrashFolderId: 281
zimbraDataSourceImportOnly: TRUE
zimbraDataSourceIsInternal: TRUE
zimbraDataSourceName: __imap_import__
...
I tried disabling the datasource to make Zimbra use the local trash folder:

Code: Select all

zmprov modifyDataSource <account_name> __imap_import__ zimbraDataSourceEnabled FALSE
but this did not solve the issue.

Deleting the datasource worked:

Code: Select all

zmprov deleteDataSource <account_name> __imap_import__
Hope this helps!
Post Reply