{"id":24042435,"url":"https://github.com/jichu4n/srslib","last_synced_at":"2025-04-19T20:45:36.418Z","repository":{"id":57470761,"uuid":"98482410","full_name":"jichu4n/srslib","owner":"jichu4n","description":"Sender Rewriting Scheme (SRS) library for Python","archived":false,"fork":false,"pushed_at":"2024-05-10T21:32:18.000Z","size":205,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T13:12:18.611Z","etag":null,"topics":["mailserver","python"],"latest_commit_sha":null,"homepage":"https://srslib.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jichu4n.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2017-07-27T01:53:46.000Z","updated_at":"2025-02-04T09:08:50.000Z","dependencies_parsed_at":"2022-09-26T17:40:36.333Z","dependency_job_id":null,"html_url":"https://github.com/jichu4n/srslib","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jichu4n%2Fsrslib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jichu4n%2Fsrslib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jichu4n%2Fsrslib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jichu4n%2Fsrslib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jichu4n","download_url":"https://codeload.github.com/jichu4n/srslib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830413,"owners_count":21168272,"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":["mailserver","python"],"created_at":"2025-01-08T22:55:24.686Z","updated_at":"2025-04-19T20:45:36.394Z","avatar_url":"https://github.com/jichu4n.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# srslib - Sender Rewriting Scheme (SRS) library for Python\n\n**srslib** is a modern Python implementation of the [Sender Rewriting Scheme (SRS)](https://en.wikipedia.org/wiki/Sender_Rewriting_Scheme).\n* Compatible with Python 2.7 and 3.x\n* Implements the standard \"Guarded\" SRS scheme as described in the [original SRS paper](http://www.libsrs2.org/srs/srs.pdf)\n\n## Installation\n\n```sh\npip install srslib\n```\n\n## Example Usage\n\n```py\nimport srslib\n\nsrs = srslib.SRS('my_secret_key')\n\n# Rewrites an email from alice@A.com to B.com\nrewritten_addr = srs.forward('alice@A.com', 'B.com')\n# =\u003e 'SRS0=ZPM1=67=A.com=alice@B.com'\n\n# Reverse it to get the address to bounce to.\ntry:\n  bounce_addr = srs.reverse(rewritten_addr)\n  # =\u003e 'alice@A.com'\nexcept srslib.Error as e:\n  ...  # Handle errors\n\n# Check if addresses are valid SRS addresses.\nassert not srslib.SRS.is_srs_address('alice@A.com')\nassert srslib.SRS.is_srs_address(rewritten_addr)\n```\n\n## Documentation\n\nThe full documentation for **srslib** lives at https://srslib.readthedocs.io/.\n\n## Implementation\n\nThis library is a clean re-implementation of SRS in modern Python based on the [original SRS paper](http://www.libsrs2.org/srs/srs.pdf), and taking inspiration from the canonical [libsrs2](https://github.com/shevek/libsrs2) C implementation and the older [pysrs](http://www.bmsi.com/python/pysrs.html) library (which itself is based on the\n[Mail::SRS](http://search.cpan.org/~shevek/Mail-SRS-0.31/lib/Mail/SRS.pm) Perl package).\n\nCompared to these two libraries, **srslib**\n\n* ... is a clean, modern, pure-Python implementation and supports Python 3.x;\n* ... discards baggage from Mail::SRS around legacy schemes and settings.\n\n## License\n\nLicensed under the Apache License, Version 2.0.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjichu4n%2Fsrslib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjichu4n%2Fsrslib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjichu4n%2Fsrslib/lists"}