A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Hi @Umar Afzal,
Welcome to the Q&A forum, and thank you very much for reaching out.
I understand you're trying to migrate a mailbox from an IMAP source and encountered this error:
ImapAuthenticationException: The username or password is incorrect, or IMAP access is disabled. IMAP server reported: 'Authentication failed'
Just to confirm, did you follow this document to migrate the mailbox from IMAP source?
Based on my research, even though the username, password, and endpoint are correct. This issue can still occur.
please note that as a Microsoft Q&A moderator, I don’t have access to your specific environment. But rest assured, I’m here to support you with helpful resources and information that may resolve the issue.
As I checked, here are a few suggestions that may work on your environment:
- Use Full Email Address as Username: Make sure the username of the migrate mailbox is the full email address (e.g.,
user@example.com). Some IMAP servers need the complete address to authenticate. - Double-check IMAP Access: Even with a configured endpoint, IMAP might still be disabled at the mailbox level. Some providers require enabling it manually for each account, especially in security focused environments. It’s worth confirming this setting to rule it out.
- Use an App Password (if 2FA is enabled): If the account uses two-factor authentication, regular passwords may not work. You’ll need to create and use an app password for IMAP access.
- Test Server Connectivity: you can use Microsoft Test connectivity to run an IMAP test. This confirms if the server is reachable and accepting logins.
- Run PowerShell Test: you can try this command in PowerShell to check if the server is accessible for migration.
Test-MigrationServerAvailability -Imap -RemoteServer <IMAP server> -Port 993
The server is accessible for migration If the result is “Success”.
- Review Server-Level Settings (if applicable): Even with a working endpoint, issues like certificate mismatches or DNS misrouting can still block authentication. If you've already checked this, it may help to revalidate with your hosting provider or IT team.
Additionally, Microsoft has an Article that covers how to troubleshoot issues with IMAP mailbox migration. I highly recommend you check it out, as it may offer solutions that apply to your situation.
If you have any other questions or need clarification, just let me know on the comment section below. I would love to assist you further.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.