I got an error when a user of my app try to list all the mailbox of a Microsoft mail account.
The error :
{"response":{"tag":"7","command":"BAD","attributes":[{"type":"TEXT","value":"LSUB failed."}]},"responseStatus":"BAD","responseText":"LSUB failed."}
He performed a login and get an access token and a refresh token without a problem. It is strange because he can send new mail and open some mail but every time he tries to list his boxes the error come back. If the user uses another mail software, he manages to list his mailboxes.
My code :
function getConnection() {
const ipaddr = '';
const port = '';
const isSSL = true;
const mail = '';
const mailPass = '';
return new Promise<any>((resolve, reject) => {
let client = new ImapFlow(
{
logger: true,
host: ipaddr,
port: port,
secure: isSSL,
tls: {
rejectUnauthorized: false
},
{
user: mail,
pass: mailPass
}
}
);
client.connect().then(() => {
resolve(client);
});
});
}
const imap = await getConnection();
const list = await imap.list();
// I got the error here
Node v12.14.0 Imapflow v1.0.98 Typescript v4.7.4
I checked in Azure AD if everything was ok and the user did it as well in his account. I don't know if the error comes from my configuration or that of the user's account.
If anyone has any idea why this error is appearing ?