Email Sending Failed : SMTP connect failed ()
What causes the 'SMTP connect failed' error when setting up XOAUTH2 in FileCloud?
The 'Email Sending Failed : SMTP connect failed ()' error occurs when configuring XOAUTH2 SMTP authentication in the FileCloud Admin Portal and is caused by a Microsoft account authentication issue. The fix is to regenerate the oAuth token using a private browser session logged in as the superadmin user, ensuring the correct Microsoft mailbox account is selected during the login prompt.
Original question or issue
Receiving an 'Email Sending Failed : SMTP connect failed ()' error in the Admin Portal while setting up XOAUTH2 for Email.
Environment:
- Product - FileCloud Server
- Version - 23.1 and later
- Platform - Any
Steps to Reproduce:
From the Admin Portal > Settings > Email page:
- Set 'Email type' as SMTP
- Set 'SMTP AUTH Type' to XOAUTH2
- Fill in the required fields using FileCloud's Email Settings support documentation below:
https://docs.filecloud.com/fcdoc/latest/server/filecloud-administrator-guide/filecloud-site-setup/email-settings
Error or Log Message:
Email Sending Failed : SMTP connect failed ()
Defect or Enhancement Number:
Cause:
Confirmed as a Microsoft-related issue in this particular scenario
How do you resolve the 'SMTP connect failed' error for XOAUTH2?
- Open a private or incognito browser window.
- Log into the Admin Portal as the superadmin user, and not an elevated admin user.
- (NOTE: If the superadmin password was forgotten, it can be reset via the FileCloud Admin Portal login page or by following the password reset procedure in the FileCloud administrator documentation.)
- Open Developer Tools in the browser (F12) > Network tab > Record Network Log.
- Navigate to Settings > Email and click the Generate oAuth Token button.
- In the Microsoft login prompt, verify that the account displayed is the mailbox configured in all FileCloud email fields and the account that Azure has granted SMTP permissions to.
- If the wrong Microsoft account appears in the login prompt, sign out of that account in the browser session and sign in with the correct account before proceeding.
- Enter the correct credentials and complete the login flow.
How do you collect logs if the issue persists?
- If the issue persists after completing the steps above, download the associated HAR file from the web browser for further diagnostics.
- To collect FileCloud Server logs in DEV mode:
- In the Admin Portal, navigate to Settings > Server and set Log Level to DEV.
- Reproduce the issue.
- Navigate to System > Checks and click the Generate Logs button to download the newest logs.
- The FileCloud Server logs will also be available in these locations:
- Windows: C:\xampp\htdocs\scratch\logs\log_YYYY-MM-DD.txt
- Linux: /var/www/html/scratch/logs/log_YYYY-MM-DD.txt
- Email Settings Support Documentation:
https://docs.filecloud.com/fcdoc/latest/server/filecloud-administrator-guide/filecloud-site-setup/email-settings