"now , the server team reported Microsoft not support imap for office365 in end of 2021. i.e. end of service"
Is this heard from your team or Microsoft?
I could only see "Microsoft stops supporting basic authentification for IMAP" from the link you post, and they want you to use Modern Authentication, which is based upon OAuth 2.0 for authentication and authorization.
And according to Deferred end of support date for Basic Authentication in Exchange Online, it will be defered to the second half of 2021 due to Covid-19, I suppose there will be an announcement soon.
If possible, it is recommended that you enable modern authentication as soon as possible to replace basic authentication: Authenticate an IMAP, POP or SMTP connection using OAuth
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.