IMAP: Gmail Drafts/Trash Not Working - Duplicate folder name (Failure)

I have deleted and re-created my account in emClient multiple times but cannot get rid of this error. I have other Gmail accounts that are working just fine, so it appears to be limited to only this account.

[IMAP]Creating or updating folder ‘/Trash’ failed due to the following error: Duplicate folder name (Failure)

I have enabled IMAP logging, which I will include the pertinent output, here.

09:54:34.890|01F| 01: A5 OK Success
09:54:34.891|021| >>> ListFoldersAsync(): End: 76 folders found
09:54:34.891|021| >>> Connection 1 is now spare
09:54:34.894|021| >>> Account folders synchronized
09:54:34.896|026| >>> CreateFolderAsync(folder: /Trash [Trash]): Start
09:54:34.897|021| 01: A6 CREATE "[Gmail]/Trash"
09:54:34.998|017| 01: A6 NO [ALREADYEXISTS] Duplicate folder name (Failure)
09:54:34.999|01F| 01: A7 STATUS "[Gmail]/Trash" (UIDVALIDITY)
09:54:35.101|021| 01: A7 NO [NONEXISTENT] Invalid folder: [Gmail]/Trash (Failure)
09:54:35.101|01F| >>> Connection 1 is now spare
09:54:35.101|01F| >>> CreateFolderAsync(folder: /Trash [Trash]): End: Failure
09:54:35.122|026| >>> DeleteAsync(folder: /All Mail [All], items: 355463,355470): Start
09:54:35.122|01F| 01: A8 SELECT "[Gmail]/All Mail" (CONDSTORE)
09:54:35.977|017| 01: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded $Junk $MDNSent $MailFlagBit0 $MailFlagBit1 $MailFlagBit2 $NotJunk $NotPhishing $Phishing $label1 $label3 $label4 $label5 Forwarded Junk JunkRecorded NonJunk NotJunk ae_autoextract)
09:54:35.977|017| 01: * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Forwarded $Junk $MDNSent $MailFlagBit0 $MailFlagBit1 $MailFlagBit2 $NotJunk $NotPhishing $Phishing $label1 $label3 $label4 $label5 Forwarded Junk JunkRecorded NonJunk NotJunk ae_autoextract \*)] Flags permitted.
09:54:35.977|017| 01: * OK [UIDVALIDITY 608639077] UIDs valid.
09:54:35.977|017| 01: * 150876 EXISTS
09:54:35.977|017| 01: * 0 RECENT
09:54:35.977|017| 01: * OK [UIDNEXT 355471] Predicted next UID.
09:54:35.977|017| 01: * OK [HIGHESTMODSEQ 38345898]
09:54:35.977|017| 01: A8 OK [READ-WRITE] [Gmail]/All Mail selected. (Success)
09:54:35.978|021| >>> DeleteAsync(): On Gmail move to Trash first
09:54:35.992|021| >>> MoveAsync(folder: /All Mail [All], targetFolder: [Gmail]/Trash): Start
09:54:35.993|021| >>> MoveAsync(): Server supports MOVE
09:54:35.993|021| >>> MoveAsync(folder: /All Mail [All], uids: 355463,355470): folder is not synchronized, trying to update ID-to-UID table first...
09:54:35.993|017| 01: A9 SEARCH RETURN (ALL) UID 355463,355470
09:54:36.094|021| 01: * ESEARCH (TAG "A9") ALL 150871,150876
09:54:36.094|021| 01: A9 OK SEARCH completed (Success)
09:54:36.096|019| 01: A10 UID MOVE 355463,355470 "[Gmail]/Trash"
09:54:36.195|01F| 01: A10 NO [TRYCREATE] No folder [Gmail]/Trash (Failure)
09:54:36.195|019| >>> DeleteAsync(): End: No items moved or found in Trash

[IMAP]Creating or updating folder ‘/Trash’ failed due to the following error: Duplicate folder name (Failure)

Suggest to go to your Gmail account online and delete / remove that specific folder causing the issue. Then close and re-open eM Client and that error should be gone.

If still giving you that error, “Right click” on “All Mail” under your Gmail account in eM Client and click “Properties”. Then click the “Repair Tab” at the top and finally click “Repair”. This will re-sync your Gmail acct folder / labels with your online Gmail acct. This can take time to re-sync your folder / labels as has to re-cache everything.

Lastly if the repair still makes no difference and that duplicate folder / label in question is definitely not showing in your Gmail acct online, then “Remove and Re-add” your Gmail account again via the “Automatic email wizard” in eM Client via “Menu / Accounts” if you have Windows.

Note:- If you do remove and re-add your Gmail account, backup eM Client first via “Menu / Backup”.

eM Client is the only email client having this problem. I’m hesitant to delete Gmail folders and/or account. Also, there is no “Repair Tab” at the top of my accounts menu in eM Client v 8.2.1473. I have “General,” “Quota,” and “Offline” tabs.

In Gmail, I have the following Tags – all created by eM Client:

  • [Gmail]/Drafts
  • [Gmail]/Trash
  • [Imap]/Drafts

I will delete these Tags as they will have no impact to my Gmail account.

@jblaty

I’m hesitant to delete Gmail folders and/or account.

Did you go to Gmail (online) via webmail to see if that “Duplicate” folder name exits ?

I did. I deleted:

  • [Gmail]/Drafts
  • [Gmail]/Trash
  • [Imap]/Drafts

Then stopped and restarted eM Client. After the initial sync completed, I saw no error message and the folders were still gone on Gmail online.

Now, I deleted a single email in eM Client. The email was not deleted (or moved to the Trash folder), and the Tag [Gmail]/Trash was added to the email itself in eM Client.

Back in Gmail online, the Tag I deleted [Gmail]/Trash has now reappeared. So all that eM Client did was add the Tag and that created the same in Gmail online. I see that the email I deleted in eM Client is on Gmail online in the [Gmail]/Trash tag, so the email isn’t going into Gmail’s Trash folder, which I believe where a deleted email belongs.

The Duplicate folder error hasn’t reappeared after the restart, so I restarted again just to check.

In addition, I’m seeing the following in the log for my 2 other accounts:

10:40:37 AM [email protected] IMAP Synchronizing folder '/Trash'
10:40:37 AM [email protected] IMAP Synchronizing folder '/Trash'

…BUT there is no similar log message for my primary account (the one with this issue).

Now I have both [Gmail]/Trash and [Imap]/Drafts again. These were created by eM Client.

Can you please go to Menu > Accounts and remove the Gmail account. The click on Add Account, enter your email address in the Automatic Setup and let eM Client setup the account. No need to change any setting afterwards either.

When that is done, are you still having the same issue?

If that does not resolve the issue, remove the account again from eM Client.

Open the Gmail web interface. Go to Settings and Labels.

Scroll down to Labels. So not System Labels. But Labels.
If you see any named Drafts or Trash, remove them.

Back in eM Client, add the Gmail account again.

When that is done, are you still having the same issue?

I did this. I removed the account and shut down eM Client. I removed any Labels (Tags) with Trash or Drafts in the name. One can’t remove system folders Trash and Drafts from Gmail.

Of course, once I recreated the account it had to sync all 121,645 emails – which takes a while. Once it had finished, I closed and reopened eM Client. Everything looked good.

Then I simply deleted an email. The email didn’t go into the Trash folder. eM Client created a new [imap]/Trash Tag – which is what I got rid of when I started. There are no emails under that tag.

I’m not getting the duplicate error, but email is still not moving to the Trash.

In eM Client the deleted emails appear in that Trash bin. I empty the trash, they disappear for a second, and then reappear. Again, the email isn’t being deleted. I can’t even see the deleted email in a Trash bin on Gmail online.

Any other ideas without having to delete my Gmail account? Or is it time to move to a different email client?

I have removed the account again, removed all of the labels, re-created the account (without changing parameters). Then tried to move an email to the trash – not working, still.

@jblaty As you still have the same issue and nothing is working, it sounds like your actual Google Gmail account folder / label structure has some eg: underling problem somewhere.

eM Client merely just mirrors your online Gmail account using an IMAP setup & from what you have already done “in your Gmail online acct” with removing that duplicate trash folder & adjusting labels etc, as well as removing and re-adding your acct in eM Client multiple times & repairing your acct, should have fixed it by now.

So I would suggest to put “your Gmail IMAP error post” either on the “Google Gmail Community forum” or if you are a “Google One / Business customer”, contact them by phone.

[IMAP]Creating or updating folder ‘/Trash’ failed due to the following error: Duplicate folder name (Failure)

Gmail Community (google.com)

Gmail’s system Trash label is mapped in IMAP to [Gmail]/Trash. Some IMAP programs show it that way, as a sub-folder of [Gmail], but others show it at the top level. If your IMAP program tried to create a different top-level Trash folder, Gmail creates the [Imap]/Trash label for it, to avoid conflicts with the system label.

So, the solution is to ensure that each IMAP program uses the [Gmail]/Trash folder for trash, and remove the [Imap]/Trash label in Gmail.

So how can I force eM Client to use [Gmail]/Trash?

I turned off automatic configuration in the account settings for iMap. Then I forced [Gmail]/Trash. Stopped and restarted eM Client. Checked to make sure there were no extraneous labels on Gmail. Then deleted an email in eM Client. It didn’t go to Gmail trash. It created a new label called “[Gmail]/Trash” and tagged the email I deleted with that tag.

[IMAP]Creating or updating folder ‘/Trash’ failed due to the following error: Duplicate folder name (Failure)