0

I am trying to open the children mailboxes of my main mailbox but it doesn't work. I get the following error in the debug mode.

'A5 NO [NONEXISTENT] Unknown Mailbox: INBOX/[Gmail] (Failure)'

But when I am listing of the mailboxes i can see that [Gmail] box exists so I don't understand what's wrong.

<= '* LIST (\\HasNoChildren) "/" "INBOX"'
<= '* LIST (\\HasChildren \\Noselect) "/" "[Gmail]"'

Here is the code that creates the error (I am using imap-simple) :

const connection = await imaps.connect(this.imapConfig);
const inbox = await connection.openBox('INBOX/[Gmail]');

Could you help me, please?

arnt
  • 8,949
  • 5
  • 24
  • 32

1 Answers1

0

The mailbox name in the second LIST response is "[Gmail]", it is not "INBOX/[Gmail]". LIST responses contain the full and correct name; if there's a heirarchy the server will tell you the full name of everything, so you don't need to concatenate anything.

(You've probably heard or read that everything is under INBOX, which it is on some servers, but not on all.)

arnt
  • 8,949
  • 5
  • 24
  • 32
  • It doesn't work anymore. I got : [NONEXISTENT] Unknown Mailbox: [Gmail] (Failure)' – Arthur Kalman Feb 18 '21 at 10:28
  • Most people don't get just "[Gmail]" as a response, but rather a longer string, which depends on language and perhaps other settings. Might want to doublecheck that you aren't accidentally deleting part of the string you receive. [Here is an example](https://stackoverflow.com/questions/52506476) of what most people see. – arnt Feb 18 '21 at 10:51
  • `[Gmail]` itself is not a folder, it is a folder-of-folders (this is the `\HasChildren` flag) and can’t be selected itself (this is the `\NoSelect` flag). If you want the INBOX, it’s just `INBOX`. – Max Feb 18 '21 at 15:24
  • Ouch, why didn't I catch the \noselect. Sorry. – arnt Feb 19 '21 at 20:48