{"id":30713206,"url":"https://github.com/helmi/python-smtp2http","last_synced_at":"2025-09-03T03:43:17.705Z","repository":{"id":222468567,"uuid":"757350261","full_name":"Helmi/python-smtp2http","owner":"Helmi","description":"A very basic SMTP to HTTP forwarder which enables webhooks to receive e-mails via SMTP.","archived":false,"fork":false,"pushed_at":"2024-02-14T10:12:41.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T20:55:35.683Z","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/Helmi.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}},"created_at":"2024-02-14T10:12:39.000Z","updated_at":"2024-02-14T10:13:47.000Z","dependencies_parsed_at":"2024-02-14T12:45:17.040Z","dependency_job_id":null,"html_url":"https://github.com/Helmi/python-smtp2http","commit_stats":null,"previous_names":["helmi/python-smtp2http"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Helmi/python-smtp2http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Helmi%2Fpython-smtp2http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Helmi%2Fpython-smtp2http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Helmi%2Fpython-smtp2http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Helmi%2Fpython-smtp2http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Helmi","download_url":"https://codeload.github.com/Helmi/python-smtp2http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Helmi%2Fpython-smtp2http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273386850,"owners_count":25096248,"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-03T02:00:09.631Z","response_time":76,"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":[],"created_at":"2025-09-03T03:43:12.571Z","updated_at":"2025-09-03T03:43:17.695Z","avatar_url":"https://github.com/Helmi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMTP to HTTP Email Forwarder\n\nThis project contains a Python application that acts as a local SMTP server to receive emails and forward them to HTTP endpoints based on the recipient's email address. The intended use is for tools like n8n or other Webhook receivers to be able to receive email via SMTP. \n\n### Content decoding\n\nCurrently the script only supports decoding of `text/plain` and `text/html` content types. It will ignore other content types.\n\n### Test script\n\nThe repo also includes a script for easy sending of test emails to the main script locally.\n\n## Requirements\n\n- Python 3.7 or higher\n- `aiosmtpd` library\n- `requests` library\n- `email` library\n\n## Installation\n\nClone the repository and install the required Python libraries.\n\n```bash\ngit clone https://github.com/yourusername/yourrepository.git\ncd yourrepository\npip install -r requirements.txt\n```\n\n## Usage\n\nTo run the SMTP server, use the following command:\n\n```bash\npython smtp2http.py\n```\n\nTo send a test email to the server, you can use the `local_test.py` script:\n\n```bash\npython local_test.py\n```\n\nModify the file itself to make it fit your testing needs.\n\n## Configuration\n\nThe script uses a configuration file (`email_config.json`) to map email addresses to HTTP endpoints. The configuration file should be in the following format:\n\n```json\n{\n    \"email_endpoints\": {\n        \"known@example.com\": \"https://example.com/webhook\"\n    },\n    \"allowed_senders\": [\n        \"allowed-sender@example.com\",\n        \"another-sender@example.com\"\n    ]\n}\n```\n\n## Logging\n\nThe script logs known and unknown emails separately. The logs are written to `known_emails.log` and `unknown_emails.log` respectively.\nLogging may as well seen as WIP. I'm not happy with it yet but wanted to have basic logging going early.\n\n## Security\n\nThe script includes basic checks for email format and malicious content. It also uses HTTPS for communication with the HTTP endpoints. However, it is recommended to further secure the script by implementing SPF, DKIM, and DMARC, and by securing the configuration file and logs.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelmi%2Fpython-smtp2http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelmi%2Fpython-smtp2http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelmi%2Fpython-smtp2http/lists"}