Commit Graph

10 Commits

Author SHA1 Message Date
Javier Callico
a17dc5b95d Merge pull request #4 from nmoinvaz/fix/select-folders
Replace manual folder listing with list_selectable_folders utility
2026-01-31 08:28:07 -05:00
Nathan Moinvaziri
1fc5e13e9d Fix duplicate detection failing with iCloud IMAP
Match on Message-ID only instead of requiring both Message-ID
and exact RFC822.SIZE, which fails when servers modify messages
on storage.
2026-01-28 20:06:30 -08:00
Nathan Moinvaziri
ed52587077 Replace manual folder listing with list_selectable_folders utility
Easily exclude \NoSelect folders and folders whose status is not OK.
2026-01-28 19:12:09 -08:00
Javier Callico
927fff17c7 feat: Add delete destination functionality to sync emails between source and destination (IMAP server or local folder).
- Implemented the ability to delete orphan emails from the destination server that are not present in the local backup.
- Introduced new environment variables and command-line arguments to control the deletion behavior.
- Enhanced the restore process to check for and delete orphan emails if the DEST_DELETE option is enabled.
- Added tests to verify the correct behavior of the new deletion functionality in both backup and restore scripts.
- Updated the mock IMAP server to handle fetching of emails based on UID and improved response handling for header fields.
2026-01-28 19:48:43 -05:00
Javier Callico
965b327332 Fix print statement formatting for apply flags in main function 2026-01-28 18:34:11 -05:00
Javier Callico
c3a26c30bf Implement email restoration functionality with Gmail labels support
- Added restore_imap_emails.py for restoring emails from local backups to IMAP accounts.
- Implemented loading of labels and flags from a manifest file.
- Added functionality to upload emails while preserving original dates and applying Gmail labels.
- Introduced multithreading for efficient email uploads.
- Created unit tests for email parsing, restoration, and configuration validation.
- Enhanced existing tests for Gmail labels preservation in backup process.
2026-01-28 18:31:19 -05:00
Javier Callico
2c230dcf64 Implement Gmail labels preservation feature and update tests 2026-01-26 19:41:18 -05:00
Javier Callico
bfac175c0b Refactor error handling tests for IMAP operations to improve readability and consistency 2026-01-25 12:43:47 -05:00
Javier Callico
94ea94adc8 Add comprehensive error handling tests for IMAP email operations 2026-01-25 12:42:45 -05:00
Javier Callico
caf83d60c5 Add comprehensive tests for IMAP email counting, migration, and common functionalities
- Implement tests for counting emails in single and multiple folders, including handling of empty folders and error scenarios in `test_count_imap_emails.py`.
- Create tests for environment variable verification, IMAP connection handling, folder normalization, MIME header decoding, and message details extraction in `test_imap_common.py`.
- Develop tests for email migration, including duplicate detection, deletion from source after migration, folder creation on destination, and handling of multiple folders in `test_migrate_imap_emails.py`.
- Introduce a mock IMAP server to facilitate testing of IMAP functionalities in `tools/mock_imap_server.py`.
2026-01-25 11:59:34 -05:00