Morning Ian, can you please share this script you mentioned with us?
I think some of us would like to try it on our own to see if this LSUB command works or not.
You will need to have admin rights on the Azure AD for the affected O365 mailbox/tenant (as I have) - because the script uses an Enterprise Application (PopImap) which the affected account has to be able to access. You then need to obtain the Azure AD Application ID for PopImap and add it into the script.
To be honest, even if you're in a position to do that and then run the script, you're not going to see any more than I have already detailed. It is simply a question of why LSUB commands (regardless of what type of MUA is sending them) work on some O365 mailboxes and not others, even within the same tenant.
An affected mailbox of mine gives the following log file output from the script, which are the same sorts of errors MUAs are reporting:
2022-11-23T08:40:43.3261293+00:00 C 0003 lsub "" *
2022-11-23T08:40:43.3559576+00:00 S 0003 BAD LSUB failed.
2022-11-23T08:40:43.3609600+00:00 C 0004 subscribe inbox
2022-11-23T08:40:43.3898945+00:00 S 0004 BAD SUBSCRIBE failed.
2022-11-23T08:40:43.3938976+00:00 C 0005 lsub "" *
2022-11-23T08:40:43.4234356+00:00 S 0005 BAD LSUB failed.
A mailbox which works (from both Thunderbird and Outlook 2021), also works with the identical Powershell script run against it:
2022-11-23T08:42:53.2989360+00:00 C 0003 lsub "" *
2022-11-23T08:42:53.3674494+00:00 S * LSUB (\HasNoChildren) "/" Trash
* LSUB (\HasNoChildren) "/" Sent
* LSUB (\HasNoChildren \Sent) "/" "Sent Items"
* LSUB (\HasNoChildren \Trash) "/" "Deleted Items"
* LSUB (\HasNoChildren \Drafts) "/" Drafts
* LSUB (\HasNoChildren \Junk) "/" "Junk Email"
* LSUB (\HasNoChildren) "/" Outbox
0003 OK LSUB completed.
2022-11-23T08:42:53.3766586+00:00 C 0004 subscribe inbox
2022-11-23T08:42:53.5378801+00:00 S 0004 OK SUBSCRIBE completed.
2022-11-23T08:42:53.5447857+00:00 C 0005 lsub "" *
2022-11-23T08:42:53.5826269+00:00 S * LSUB (\HasNoChildren) "/" Trash
* LSUB (\HasNoChildren) "/" Sent
* LSUB (\HasNoChildren \Sent) "/" "Sent Items"
* LSUB (\HasNoChildren \Trash) "/" "Deleted Items"
* LSUB (\HasNoChildren \Drafts) "/" Drafts
* LSUB (\HasNoChildren \Junk) "/" "Junk Email"
* LSUB (\HasNoChildren) "/" Outbox
* LSUB (\Marked \HasNoChildren) "/" inbox
0005 OK LSUB completed.