Skip to content

feat: Add IMAP storage support and enhanced UCP widget functionality#39

Open
88fingerslukee wants to merge 3 commits intoFreePBX:release/17.0from
88fingerslukee:release/17.0
Open

feat: Add IMAP storage support and enhanced UCP widget functionality#39
88fingerslukee wants to merge 3 commits intoFreePBX:release/17.0from
88fingerslukee:release/17.0

Conversation

@88fingerslukee
Copy link

Summary

This PR adds comprehensive IMAP storage support to the UCP voicemail widget and significantly enhances the user experience with modern UI improvements.

Problem

  • UCP voicemail widget had no capability to interact with voicemails when IMAP storage was configured
  • Users with IMAP storage couldn't access their voicemails through the UCP interface
  • The existing widget lacked modern UI features like drag-and-drop, folder management, and responsive design
  • No built-in way to test IMAP connection configurations

Solution

  • IMAP Integration: Complete IMAP client implementation with support for Exchange 2019 IMAP (tested)
  • IMAP Connection Testing: Built-in connection test feature that tries multiple authentication methods and configurations
  • Enhanced UI: Modern drag-and-drop interface, folder creation/deletion, improved styling
  • Performance: Optimized message loading and caching
  • User Experience: Auto-sizing columns, visual feedback, confirmation dialogs

Changes Made

Core Functionality

  • Added ImapClient.php class for comprehensive IMAP support
  • Enhanced Voicemail.class.php with IMAP integration methods
  • Updated functions.inc.php with IMAP-related functions and connection testing
  • NEW: IMAP Connection Test Feature - Comprehensive testing of multiple authentication methods, ports, and configurations

UI/UX Improvements

  • Drag & Drop: Messages can be dragged between folders
  • Folder Management: Create, delete, and manage custom folders
  • Visual Enhancements: Better styling, responsive design, improved button positioning
  • User Feedback: Confirmation dialogs, loading states, error handling

IMAP Connection Testing Features

  • Multi-Method Testing: Tests various impersonation methods (none, separator-based, authuser)
  • Port Flexibility: Tests configured port and common alternatives
  • Authentication Types: Tests multiple auth types from secure to fallback options
  • Detailed Results: Provides comprehensive feedback on what worked and what didn't
  • Auto-Detection: Helps users find the correct configuration for their IMAP server

Files Modified

  • ucp/Voicemail.class.php - Core UCP functionality
  • ucp/assets/js/global.js - Frontend JavaScript enhancements
  • ucp/assets/less/bootstrap.less - Styling improvements
  • ucp/includes/imap/ImapClient.php - New IMAP client with connection testing (NEW FILE)
  • functions.inc.php - Backend function updates including IMAP connection test handler
  • Translation files updated (605 strings, 226 new translation calls)

Testing

  • Tested with local voicemail storage
  • Tested with Exchange 2019 IMAP storage
  • Tested IMAP connection test feature with various configurations
  • Tested drag-and-drop functionality
  • Tested folder creation/deletion
  • Tested responsive design on different screen sizes
  • Verified backward compatibility

Important Notes

  • First-time contributor: This is my first contribution to the FreePBX community
  • AI-Assisted Development: A significant portion of this code was developed with AI assistance. I would greatly appreciate feedback on coding quality, FreePBX conventions, and best practices to help improve my understanding and future contributions.
  • IMAP Testing: Currently only tested with Exchange 2019 IMAP - additional IMAP provider and configuration testing would be beneficial
  • ODBC Limitation: ODBC voicemail storage functionality has not been implemented in this PR
  • Coding Standards: Code follows PSR-1/PSR-2 standards, but I'm open to feedback on FreePBX-specific conventions
  • Documentation: All new functionality includes proper docblocks and inline documentation

Known Limitations

  • ODBC Support: This PR does not include ODBC voicemail storage support - only IMAP and local storage are supported
  • IMAP Provider Testing: Currently only tested with Exchange 2019 IMAP

Breaking Changes

None - fully backward compatible

Checklist

  • Code follows PSR-1/PSR-2 coding standards
  • All existing functionality preserved
  • New functionality is properly documented with docblocks
  • Translation files updated (605 strings)
  • No breaking changes introduced
  • Tested with Exchange 2019 IMAP
  • IMAP connection test feature implemented and tested
  • Additional IMAP provider/configuration testing (would benefit from community testing)
  • ODBC voicemail storage support (future enhancement)

Future Improvements

  • Testing with additional IMAP providers (Gmail, Outlook, etc.)
  • ODBC voicemail storage support implementation
  • Performance optimization based on community feedback
  • Additional UI/UX enhancements based on user feedback
  • Continued learning of FreePBX coding standards and best practices

@kapilgupta01
Copy link
Member

Hi @88fingerslukee

Thanks a lot for your contribution.

Could you please -

  1. Raise GitHUB jira and explain the requirement in the jira
  2. Link the jira with this git commit (preferably single commit which has jira number in the git commit message)
  3. Any documentation which I can put into https://sangomakb.atlassian.net/wiki/spaces/FCD/overview for FreePBX users to configure , use this feature effectively.

Thanks
Kapil

@88fingerslukee 88fingerslukee force-pushed the release/17.0 branch 2 times, most recently from 75063fe to 32fc181 Compare September 9, 2025 04:54
@88fingerslukee
Copy link
Author

Sorry for the messy rebase, I screwed up. Do you want me to close this and re-submit a clean PR with the single commit?

@kapilgupta01
Copy link
Member

kapilgupta01 commented Sep 9, 2025

Great I can see you did force rebase to single commit.

however , can you please replace FREEPBX-856 with Github Issue#856 in the git commit message (git commit --amend ) to properly reflect the issue number for future reference.

Thanks once again.

…unctionality

- Add comprehensive IMAP client for voicemail operations
- Implement drag-and-drop interface for message management
- Add folder creation/deletion functionality
- Include IMAP connection testing feature
- Enhance UI with modern styling and responsive design
- Add 605 translation strings for internationalization

Files modified:
- ucp/includes/imap/ImapClient.php (NEW FILE)
- ucp/Voicemail.class.php - Core UCP functionality
- ucp/assets/js/global.js - Frontend JavaScript enhancements
- ucp/assets/less/bootstrap.less - Styling improvements
- ucp/views/widget.php - Widget view updates
- ucp/views/greetings.php - Greetings view updates
- functions.inc.php - Backend function updates
- page.voicemail.php - Admin page updates
- views/ssettings.php - Settings view updates
@88fingerslukee
Copy link
Author

88fingerslukee commented Sep 9, 2025

@kguptasangoma Okay, I hope this is done correctly now. Please let me know any comments, questions or suggestions for this PR.

I'll work on the documentation, but that might take some more time.

@88fingerslukee 88fingerslukee marked this pull request as ready for review September 14, 2025 17:14
- Fix authorization logic for greeting deletion (requires both greetings permission and extension check)
- Fix delete command routing to properly fall through from authorization to deletion logic
- Fix IMAP folder path construction issue (no more double VoiceMail/VoiceMail/Greetings)
- Remove all debug logging for clean production code
- Greeting deletion now works for both IMAP and local storage

Fixes greeting deletion in UCP widget when using IMAP storage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants