Created 01-08-2025 01:33 AM
Hi Team,
I am getting Authentication Error in ConsumeIMAP 1.23.2and ConsumePOP3 1.23.2 processor. Details are descrideb as below:
Hostname : outlook.office365.com
Port : 995( For POP3)/993 (For IMAP)
Autherization Mode : OAUTH2 (Also Manually verified using the details of autherization serverURL and clientID/Secret, it has all relevant access to generate token)
Error Details:
ConsumePOP3[id=x3603x64-5f1c-1219-xxxx-xxxx34ffc1] Processing failed: org.apache.nifi.processor.exception.ProcessException: Failed to receive messages from Email server: [javax.mail.AuthenticationFailedException - Read timed out - Caused by: javax.mail.AuthenticationFailedException: Read timed out
Created on 03-21-2025 12:16 PM - edited 03-21-2025 02:37 PM
@PriyankaMondal
Looking at your error message log, I can see you're experiencing authentication timeouts with ConsumeIMAP and ConsumePOP3 processors when connecting to Microsoft Office 365 services.
Possible Blockers
Timeout Issue
The primary error is "Read timed out" during authentication, which suggests the connection to Office 365 is being established but then timing out during the OAUTH2 handshake.
Microsoft 365 Specific Considerations
Microsoft has specific requirements for modern authentication with mail services and has been deprecating basic authentication methods.
Processor Configuration
Using OAUTH2 authentication mode, is correct for Office 365, but there may be issues with the token acquisition or timeout settings.
Possible solutions
1. Check timeout settings
2. Verify Modern Authentication settings
Ensure the account has Modern Authentication enabled in Microsoft 365 Admin Center
Verify the application registration in Azure AD has the correct permissions
3. Update NiFi Mail Libraries
NiFi's default JavaMail implementation might have compatibility issues with Office 365. Try:
4. Use a Custom SSL Context Service
Microsoft servers might require specific TLS settings
5. Alternative Approach: Use Microsoft Graph API
Since Microsoft is moving away from direct IMAP/POP3 access, consider:
6. Check Proxy Settings
If your environment uses proxies
# Add these properties
mail.imap.proxy.host=your-proxy-host
mail.imap.proxy.port=your-proxy-port
mail.pop3.proxy.host=your-proxy-host
mail.pop3.proxy.port=your-proxy-port
7. Implementation Steps
Consider implementing a token debugging flow using InvokeHTTP to validate token acquisition separately
Happy hadooping