{"id":15896194,"url":"https://github.com/numberoverzero/snails","last_synced_at":"2026-01-25T21:40:28.542Z","repository":{"id":57468801,"uuid":"183678364","full_name":"numberoverzero/snails","owner":"numberoverzero","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-21T15:54:43.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T20:24:40.420Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numberoverzero.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-04-26T18:43:23.000Z","updated_at":"2024-06-21T15:54:47.000Z","dependencies_parsed_at":"2024-10-27T16:33:21.963Z","dependency_job_id":"ec494d05-7807-48a3-8f84-c05ac95f05b9","html_url":"https://github.com/numberoverzero/snails","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"0a9a0dc8724e8df2906cc6d0e9314789114c86e7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/numberoverzero/snails","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Fsnails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Fsnails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Fsnails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Fsnails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numberoverzero","download_url":"https://codeload.github.com/numberoverzero/snails/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numberoverzero%2Fsnails/sbom","scorecard":{"id":698587,"data":{"date":"2025-08-11","repo":{"name":"github.com/numberoverzero/snails","commit":"84370abd1ca1db63c8c0ba69c480a8acbab67cd9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-221 / GHSA-pr2m-px7j-xg65","Warn: Project is vulnerable to: GHSA-wgjv-9j3q-jhg8","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T04:29:47.541Z","repository_id":57468801,"created_at":"2025-08-22T04:29:47.541Z","updated_at":"2025-08-22T04:29:47.541Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28759419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T20:56:06.009Z","status":"ssl_error","status_checked_at":"2026-01-25T20:54:48.203Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-10-06T09:06:46.743Z","updated_at":"2026-01-25T21:40:28.499Z","avatar_url":"https://github.com/numberoverzero.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/pypi/v/snails.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/snails\n\nSometimes you want to write a dumb email handler.\n\nGood for: low volume, minimal parsing, interacting with legacy email-based systems\n\nBad for: high volume, production use, 100% RFC compliance\n\n\nRequires Python 3.7+\n\n::\n\n    pip install snails\n\n=======\n Usage\n=======\n\n.. code-block:: python\n\n    import snails\n\n\n    def handle(msg: snails.Message) -\u003e None:\n        print(f\"To: {msg['to']}\")\n        print(f\"From: {msg['from']}\")\n        print(\"Subject: {msg['subject']}\")\n        for p in msg.get_payload():\n            print(p.get_payload(decode=True))\n\n    # run and block until ctrl + c\n    snails.serve(handle, \"0.0.0.0\", 8025)\n\n.. code-block:: python\n\n    # or, call start/stop yourself\n    mailbox = snails.Mailbox(handle, \"0.0.0.0\", 8025)\n    mailbox.start()\n\n============\n Enable TLS\n============\n\n.. code-block:: python\n\n    import ssl\n    import snails\n\n\n    def handle(msg: bytes) -\u003e None:\n        ...  # TODO\n\n\n    ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)\n    ssl_context.load_cert_chain(\"cert.pem\", \"key.pem\")\n\n    mailbox = snails.Mailbox(handle, \"::\", 25, ssl_context=ssl_context)\n\n=================\n Message Parsing\n=================\n\nWhen a new request arrives, ``snails`` will pass the envelope to a parser function.  You can either provide this\nparser yourself, or let snails infer the parser based on your handler's type annotations.\n\nSnails provides parsers for the following types:\n\n* ``bytes``\n* ``aiosmtpd.smtp.Envelope`` (aliased to ``snails.Envelope``)\n* ``email.message.Message`` (aliased to ``snails.Message``)\n\n\nMost of the time it's enough to use an annotation:\n\n.. code-block:: python\n\n    def handle(x: bytes):\n        with open(\"out.log\", \"wb\") as f:\n            f.write(x)\n\n    def handle(x: snails.Envelope):\n        with open(\"out.log\", \"wb\") as f:\n            f.write(x.content)\n\n    def handle(x: snails.Message):\n        with open(\"out.log\", \"wb\") as f:\n            f.write(x.as_bytes())\n\n\nYou can also define your own parser:\n\n.. code-block:: python\n\n    def parse(e: snails.Envelope) -\u003e dict:\n        as_str = e.content.decode()\n        return {}  # TODO your parsing\n\n\n    def handle(x: dict):\n        ...  # TODO use the dict parsed above\n\n\n    mailbox = snails.Mailbox(handle, \"::\", 25, parser=parse)\n\n===============\n Async Mailbox\n===============\n\nYour handler and parser can both be async functions; by default ``snails`` wraps all synchronous functions.\n\n.. code-block:: python\n\n    import snails\n\n    async def parse(e: snails.Envelope) -\u003e dict:\n        as_str = e.content.decode()\n        return {}  # TODO your parsing\n\n\n    async def handle(x: dict):\n        res = await some_db_call(...)\n\n\n    mailbox = snails.Mailbox(handle, \"::\", 25, parser=parse)\n\n=======\n Other\n=======\n\n* You can return a string from your handler such as ``\"250 OK\"`` or the built-in ``snails.SMTP_250``.\n* Instead of ``snails.serve`` use ``Mailbox.start`` and ``Mailbox.stop``\n* Call ``snails.serve`` with ``cleanup_at_exit=True`` to ensure ``Mailbox.stop`` is called\n  when the interpreter is shutting down (enabled by default)\n* Call ``snails.serve`` with ``block=True`` to block execution after calling ``Mailbox.start`` (enabled by default).\n  You can stop the server by sending SIGINT or Ctrl + C.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumberoverzero%2Fsnails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumberoverzero%2Fsnails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumberoverzero%2Fsnails/lists"}