{"id":22457501,"url":"https://github.com/sadmanca/mbox-attachment-extractor","last_synced_at":"2025-03-27T13:38:39.129Z","repository":{"id":247893569,"uuid":"827088442","full_name":"sadmanca/mbox-attachment-extractor","owner":"sadmanca","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-11T21:16:11.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T18:12:25.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/sadmanca.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-07-11T02:18:48.000Z","updated_at":"2024-07-11T21:16:14.000Z","dependencies_parsed_at":"2024-07-11T07:08:09.030Z","dependency_job_id":null,"html_url":"https://github.com/sadmanca/mbox-attachment-extractor","commit_stats":null,"previous_names":["sadmanca/mbox-attachment-extractor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadmanca%2Fmbox-attachment-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadmanca%2Fmbox-attachment-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadmanca%2Fmbox-attachment-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadmanca%2Fmbox-attachment-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadmanca","download_url":"https://codeload.github.com/sadmanca/mbox-attachment-extractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245855749,"owners_count":20683569,"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","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":[],"created_at":"2024-12-06T08:07:50.038Z","updated_at":"2025-03-27T13:38:39.105Z","avatar_url":"https://github.com/sadmanca.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mbox Attachment Extractor\n\n## Overview\n\nThis Python script (`extract.py`) is designed to parse `.mbox` files containing email messages, extract attachments from those emails, and optionally save each email as an individual `.mbox` file in corresponding folders. It provides a command-line interface (CLI) to customize its behavior based on various options.\n\n## Features\n\n- **Attachment Extraction**: Automatically detects and saves attachments from emails in the `.mbox` file.\n- **Individual Email Saving**: Optionally saves each email as a separate `.mbox` file in a directory named after the email's timestamp and subject.\n- **Logging**: Logs detailed information about the processing steps, including saved emails, skipped emails, and errors.\n- **Progress Monitoring**: Uses `tqdm` to display a progress bar in the terminal, indicating the status of email processing.\n- **Customizable Output**: Allows specifying an output folder where attachments and `.mbox` files are saved.\n\n## Requirements\n\n- Python 3.x\n- Required Python packages (`colorama`, `tqdm`)\n\n\n## Usage\n\n### Command-Line Options\n\nThe script accepts several command-line options to customize its behavior:\n\n- **Positional Arguments**:\n- `mbox_file`: Path to the `.mbox` file to be processed.\n\n- **Optional Arguments**:\n- `-s, --save-mbox`: Save each email as an individual `.mbox` file in folders. Default is `False`.\n- `-v, --verbose`: Print detailed logs to the terminal in addition to saving them to a log file. Default is `False`.\n- `-l, --log-first-line`: Include the first line of each email (From field) in the log file. Default is `False`.\n- `-o OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER`: Specify the output folder where attachments and `.mbox` files will be saved. Default is `emails`.\n\n### Examples\n\n1. **Basic Usage**:\n\n- Processes `mboxfile.mbox` without saving individual `.mbox` files, without verbose logging, and saving output in the default `emails` folder.\n\n```\npython extract.py path/to/your/mboxfile.mbox\n```  \n\n2. **Save Individual `.mbox` Files**:\n\n- Processes `mboxfile.mbox`, saves each email as an individual `.mbox` file in default `emails` folder.\n\n```\npython extract.py path/to/your/mboxfile.mbox -s\n```\n\n3. **Verbose Output**:\n\n- Processes `mboxfile.mbox`, prints detailed logs to the terminal, and saves output in the default `emails` folder.\n\n```\npython extract.py path/to/your/mboxfile.mbox -v\n```\n\n4. **Custom Output Folder**:\n\n- Processes `mboxfile.mbox`, saves attachments and `.mbox` files in `custom_output_folder`.\n\n```\npython extract.py path/to/your/mboxfile.mbox -o \"custom_output_folder/path\"\"\n```\n\n\n5. **Verbose and Log First Line**:\n\n- Processes `mboxfile.mbox`, prints detailed logs to the terminal with the first line of each email included, and saves output in the default `emails` folder.\n\n```\npython extract.py path/to/your/mboxfile.mbox -v -l\n```\n\n\n### Output\n\n- **Attachments**: Extracted attachments from emails are saved in subfolders within the specified or default output folder.\n- **Log File**: Detailed logs of the processing steps are saved in a timestamped log file (`email_parser_\u003ctimestamp\u003e.log`).\n\n```\npython extract.py -h\n```\n\n\n### Notes\n\n- Ensure Python and required packages (`colorama`, `tqdm`) are installed before running the script.\n- Use `-h` or `--help` for help with command-line options:\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadmanca%2Fmbox-attachment-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadmanca%2Fmbox-attachment-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadmanca%2Fmbox-attachment-extractor/lists"}