Integrating Yahoo Mail with Odoo using OAuth is feasible, even though Yahoo has removed basic password-based authentication. You can set up OAuth for Yahoo by following these steps:
1. Understand Yahoo’s OAuth Requirements
Yahoo supports OAuth 2.0 for third-party application access. To use OAuth with Yahoo in Odoo, you must:
- Register your application with Yahoo Developer Console.
- Obtain the client_id and client_secret for OAuth.
- Configure Odoo's email settings to use Yahoo's IMAP/SMTP servers with OAuth tokens.
2. Register Your Application in Yahoo Developer Console
- Create a Yahoo Developer Account:
- Create a New Application:- Click on My Apps and select Create an App.
- Provide the following:- Application Name: A name for your app (e.g., "Odoo Email Integration").
- Redirect URI: Use https://localhost for testing or provide Odoo's redirect URL in production, such as https://your-odoo-domain.com/auth_oauth/signin.
- Permissions: Select Mail, Contacts, and Calendar for access.
 
 
- Save and Obtain Credentials:- After saving, Yahoo will generate a Client ID and Client Secret. Note these for later configuration in Odoo.
 
3. Configure OAuth in Odoo
- Install OAuth2 in Odoo:- Ensure the auth_oauth module is installed in Odoo.
- Go to Settings > Integrations > OAuth Providers.
 
- Add Yahoo as an OAuth Provider:- Click Create and configure:- Provider Name: Yahoo
- Client ID: Use the Client ID from Yahoo Developer Console.
- Client Secret: Use the Client Secret.
- Redirect URI: Ensure it matches the URI registered in Yahoo.
- Scope: openid mail.
- OAuth Endpoint URLs:- Authorization URL: https://api.login.yahoo.com/oauth2/request_auth
- Token URL: https://api.login.yahoo.com/oauth2/get_token
 
 
 
- Test the Configuration:- Verify that the OAuth flow is working by testing the connection.
 
4. Configure Yahoo IMAP/SMTP in Odoo
- Yahoo IMAP/SMTP Settings with OAuth:- IMAP Server: imap.mail.yahoo.com
- IMAP Port: 993
- SMTP Server: smtp.mail.yahoo.com
- SMTP Port: 465
 
- Use OAuth Tokens in Odoo:- Go to Settings > Email > Outgoing Mail Servers (for SMTP) or Incoming Mail Servers (for IMAP).
- Add Yahoo as a mail server and use the following:- Username: Your Yahoo email address.
- Authentication Method: OAuth2.
- Access Token: Generated during the OAuth flow.
 
 
5. Troubleshoot and Test
- Ensure Yahoo’s OAuth credentials are correctly set up in both Yahoo Developer Console and Odoo.
- Test the email flow by sending a test email from Odoo.
- Verify IMAP integration by fetching emails.
Key Notes
- Yahoo’s Security Requirements: Yahoo enforces secure access, so ensure your application uses HTTPS for OAuth callbacks in production.
- Access Token Refresh: Odoo's OAuth implementation should handle token refresh automatically. Verify this during testing.
- SMTP Authentication Error: If you encounter an error, ensure the app has the correct permissions and OAuth is configured properly.