{"id":23408555,"url":"https://github.com/clement-berard/go-imap-backup","last_synced_at":"2025-09-14T16:50:24.757Z","repository":{"id":268614315,"uuid":"904148575","full_name":"clement-berard/go-imap-backup","owner":"clement-berard","description":"A collection of Go tools for managing IMAP emails, featuring backup capabilities and duplicate detection/cleanup.","archived":false,"fork":false,"pushed_at":"2024-12-21T12:46:40.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T01:35:48.963Z","etag":null,"topics":["backup","duplicates","golang","imap"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clement-berard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-16T10:44:36.000Z","updated_at":"2024-12-21T12:46:43.000Z","dependencies_parsed_at":"2024-12-17T21:35:10.475Z","dependency_job_id":"43de7989-cdde-4600-bc2e-fe13d7df0889","html_url":"https://github.com/clement-berard/go-imap-backup","commit_stats":null,"previous_names":["clement-berard/go-imap-backup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clement-berard/go-imap-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clement-berard%2Fgo-imap-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clement-berard%2Fgo-imap-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clement-berard%2Fgo-imap-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clement-berard%2Fgo-imap-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clement-berard","download_url":"https://codeload.github.com/clement-berard/go-imap-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clement-berard%2Fgo-imap-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275136555,"owners_count":25411707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","duplicates","golang","imap"],"created_at":"2024-12-22T15:15:40.252Z","updated_at":"2025-09-14T16:50:24.733Z","avatar_url":"https://github.com/clement-berard.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IMAP Email Management Tools\n\nA collection of Go tools for managing IMAP emails, featuring backup capabilities and duplicate detection/cleanup.\n\n## Features\n\n- **Email Backup**\n    - Full mailbox backup with folder structure preservation\n    - Selective folder backup support\n    - Progress tracking and error handling\n    - Maintains email metadata and attachments\n\n- **Duplicate Management**\n    - Intelligent duplicate detection using content hashing\n    - Interactive or automatic duplicate resolution\n    - Dry-run mode for safe testing\n    - Detailed action summaries\n\n## Installation\n\n### Using pre-built binaries (recommended)\n\nDownload the latest release that matches your system from the [releases page](https://github.com/clement-berard/go-imap-backup/releases).\n\n```bash\n# Example for Linux x64\nwget https://github.com/clement-berard/go-imap-backup/releases/latest/download/go-imap-backup-linux-amd64\nchmod +x go-imap-backup-linux-amd64\n\n# Example for macOS x64\nwget https://github.com/clement-berard/go-imap-backup/releases/latest/download/go-imap-backup-darwin-amd64\nchmod +x go-imap-backup-darwin-amd64\n```\n\n### Building from source\n\nIf you prefer building from source:\n\n```bash\ngit clone https://github.com/clement-berard/go-imap-backup\ncd go-imap-backup\ngo build\n```\n\n## Configuration\n\nCreate a `.env` file in the same directory as the binary:\n\n```env\nIMAP_HOST=imap.example.com\nIMAP_PORT=993\nIMAP_USER=your.email@example.com\nIMAP_PASSWORD=your_password\nBACKUP_DIR=email_backup\nTARGET_FOLDER=Optional/Specific/Folder  # Optional: focus on specific folder\n```\n\n## Usage\n\n### Email Backup\n\n```bash\n# Using pre-built binary\n./go-imap-backup-[your-platform] backup\n\n# Or if built from source\n./go-imap-backup backup\n```\n\nThe backup will create a directory structure like:\n```\nemail_backup/\n├── INBOX/\n│   ├── 1703011234_1.eml\n│   └── 1703011235_2.eml\n├── Sent/\n│   └── 1703011236_1.eml\n└── Work/\n    └── Project/\n        └── 1703011237_1.eml\n```\n\nEach `.eml` file contains a complete email with all metadata and attachments.\n\n### Duplicate Management\n\n```bash\n# Interactive mode\n./go-imap-backup-[your-platform] duplicates\n\n# Automatic mode (selects first email in each duplicate group)\n./go-imap-backup-[your-platform] duplicates --auto\n\n# Dry run (shows what would be done without making changes)\n./go-imap-backup-[your-platform] duplicates --dry-run\n\n# Automatic dry run\n./go-imap-backup-[your-platform] duplicates --auto --dry-run\n```\n\n#### Interactive Mode Options\n- Enter number (1-N): Keep that email, delete others in group\n- `s`: Skip current group\n- `q`: Jump to summary\n- `a`: Auto-select first email in current group\n\n#### Targeting Specific Folders\nUse the `TARGET_FOLDER` environment variable to focus on a specific folder:\n```env\nTARGET_FOLDER=Work/Project\n```\n\n### Folder Deletion\n\nFull deletion of a folder and all its subfolders with content.\n\n```bash\n# Interactive mode with details prompt\n./go-imap-backup-[your-platform] delete \"Work/Project\"\n\n# Dry run mode\n./go-imap-backup-[your-platform] delete --dry-run \"Work/Project\"\n```\n\n#### Features\n\n- Deep deletion of folders and subfolders\n- Safe ordering (deletes subfolders before parent folders)\n- Detailed preview of all messages in dry-run mode\n- Confirmation prompt with full impact summary\n- Automatic reconnection on connection loss\n- Progress tracking and error handling\n\n#### Safety Features for Folder Deletion\n\n- Confirmation required with total count of affected messages\n- Optional detailed message list in dry-run mode\n- Safe interruption with CTRL+C\n- Connection recovery in case of timeout\n- Multiple deletion attempts with automatic reconnection\n\n## How Duplicate Detection Works\n\n1. **Content Hash**: Creates a SHA-256 hash of each email's content\n2. **Hash Matching**: Groups emails with identical hashes\n3. **Verification**: Shows duplicate groups with details:\n    - Subject\n    - Date\n    - Size\n    - Mailbox location\n    - Content preview\n\n## Safety Features\n\n- Read-only scanning\n- Dry-run mode\n- Confirmation prompts\n- Safe interruption handling\n- Error logging\n- Progress tracking\n- Deep deletion order (children before parents)\n- Automatic reconnection on IMAP timeout\n\n## Important Notes\n\n- Always backup your emails before using the duplicate management tool\n- Test with `--dry-run` first\n- Some email providers might have specific IMAP settings or limitations\n- Large mailboxes might take significant time to process\n\n## Known Issues\n\n- Gmail requires App Password for IMAP access\n- Some IMAP servers might have connection limits\n- Large attachments might require more memory\n\n## Support\n\nFor issues and feature requests, please use the [GitHub issue tracker](https://github.com/clement-berard/go-imap-backup/issues).\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclement-berard%2Fgo-imap-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclement-berard%2Fgo-imap-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclement-berard%2Fgo-imap-backup/lists"}