chatwoot/spec/factories/channel
João Santos 202403873d
feat: Ability to specify the authentication type for imap server (#12306)
# Pull Request Template

## Description

This PR adds IMAP authentication mechanism selection to Chatwoot's email
inbox configuration. Users can now choose between 'plain', 'login', and
'cram-md5' authentication methods when configuring IMAP settings,
providing flexibility for different email providers that require
specific authentication types.

https://github.com/chatwoot/chatwoot/issues/8867

The implementation includes:
- Frontend dropdown with numeric keys (1, 2, 3) matching SMTP auth style
- Backend API validation for allowed authentication mechanisms
- Consistent 'cram-md5' format throughout the codebase
- Updated IMAP service to handle different auth types properly

This feature maintains consistency with existing SMTP authentication
options and follows the established UI/UX patterns in the application.

## Type of change

Please delete options that are not relevant.

- [x] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or feature that would cause existing
functionality not to work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

### Manual Testing:
- Tested in Docker environment
- Verified IMAP auth dropdown appears in inbox settings
- Confirmed all three auth mechanisms (plain, login, cram-md5) can be
selected and saved
- Tested API validation by attempting to save invalid auth mechanisms

### Automated Testing:
- Updated existing IMAP service tests to use consistent lowercase values
- Updated API controller tests for authentication parameter handling
- All tests pass locally with the new changes

### Test Configuration:
- Tested with both new and existing inbox configurations

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream
modules

## Additional Notes

- This feature is backward compatible and doesn't break existing IMAP
configurations
- The 'cram-md5' format is used consistently throughout (UI, API,
storage, services)
- Net::IMAP compatibility is maintained by converting to 'CRAM-MD5'
internally
- Follows the same pattern established by SMTP authentication
configuration

---------

Co-authored-by: João Santos <joao.santos@madigital.eu>
Co-authored-by: Sony Mathew <sony@chatwoot.com>
2026-05-08 16:40:15 +05:30
..
channel_api.rb Feature: API Channel (#1052) 2020-07-21 12:15:24 +05:30
channel_email.rb feat: Ability to specify the authentication type for imap server (#12306) 2026-05-08 16:40:15 +05:30
channel_instagram.rb feat: Added the ability to create Instagram channel (#11182) 2025-04-03 13:57:14 +05:30
channel_line.rb feat: Line Channel (#2904) 2021-09-11 01:31:17 +05:30
channel_sms.rb chore: Provider APIs for SMS Channel - Bandwidth (#3889) 2022-02-03 15:22:13 -08:00
channel_telegram.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
channel_tiktok.rb feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
channel_whatsapp.rb fix: Setup webhooks for manual WhatsApp Cloud channel creation (#13278) 2026-01-19 14:12:36 +04:00
channel_widget.rb Chore: Web widget Inbox Tech Debts (#738) 2020-04-19 23:40:28 +05:30
facebook_pages.rb Chore: Web widget Inbox Tech Debts (#738) 2020-04-19 23:40:28 +05:30
instagram_channel.rb fix: Automatically remove expired story mention (#5300) 2022-12-08 15:55:24 +03:00
twilio_sms.rb feat: Add voice calling as a capability on Twilio SMS channel(Enterprise) (#13963) 2026-04-29 11:32:19 +04:00
twitter_profiles.rb Chore: Web widget Inbox Tech Debts (#738) 2020-04-19 23:40:28 +05:30