{"id":22153905,"url":"https://github.com/philr/srsd","last_synced_at":"2025-03-24T13:45:35.441Z","repository":{"id":79881499,"uuid":"213733238","full_name":"philr/srsd","owner":"philr","description":"Sender Rewriting Scheme Daemon","archived":false,"fork":false,"pushed_at":"2019-10-09T19:55:39.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T18:47:12.530Z","etag":null,"topics":["email","golang","sender-rewriting-scheme","srs"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/philr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-08T19:22:44.000Z","updated_at":"2019-10-09T19:55:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"baa54fa4-53d5-4818-94c8-cc4520505160","html_url":"https://github.com/philr/srsd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philr%2Fsrsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philr%2Fsrsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philr%2Fsrsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philr%2Fsrsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philr","download_url":"https://codeload.github.com/philr/srsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245284706,"owners_count":20590307,"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":["email","golang","sender-rewriting-scheme","srs"],"created_at":"2024-12-02T01:38:55.713Z","updated_at":"2025-03-24T13:45:35.419Z","avatar_url":"https://github.com/philr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# srsd - Sender Rewriting Scheme Daemon\n\nA daemon written in Go that accepts and rewrites email addresses according to\nthe [Sender Rewriting System](https://en.wikipedia.org/wiki/Sender_Rewriting_Scheme).\n\nThe daemon listens on a Unix socket for requests to rewrite email addresses\neither for forwarding or in reverse for bounce handling.\n\nThe [mileusna/srs](https://github.com/mileusna/srs) package is used perform the\nrewriting.\n\n\n## Compiling\n\nFrom the source directory, run `go build` to produce a srsd executable.\n\n\n## Configuration\n\nsrsd uses a JSON configuration file. A sample is provided as srsd.json. A\ndefault secret can be provided in addition to secrets for specific target\nSRS domains.\n\nSecrets in the configuration file must be encoded using base64. 64 random bytes\nare recommended (used for an SHA-1 HMAC). Suitable secrets can be generated by\nrunning:\n\n```\nhead -c64 /dev/urandom | base64 -w0\n```\n\n## Executing\n\nStart the daemon by running `srsd`.\n\nBy default, srsd will look for a configuration file named srsd.json in the\ncurrent directory and open a socket named srsd.sock in the current directory.\nThe socket will be created with access permissions set to 0770. To specify\ndifferent configuration file and socket locations, use the `-config-file` and\n`-socket-path` options respectively. To specify different access permissions use\nthe `-socket-access` option. For example:\n\n```\nsrsd -config-file /etc/srsd.conf -socket-path /run/srsd/srsd.sock -socket-access 0777\n```\n\nThe process will remain running in the foreground when started. To terminate\nsend the process an INT or TERM signal.\n\n## Protocol\n\nsrsd accepts connections made to the Unix socket. Each connection can be used to\nperform multiple operations (provided a syntax error is not encountered).\nRewrite commands are issued one per line (terminated with a line feed `\\n`).\n\nRequesting a forwarding rewrite for the sender address from@example.org using\nthe SRS domain srs.example.com:\n\n```\n\u003e Fsrs.example.com:from@example.org\n\u003c SRS0=PmRI=YB=example.org=from@srs.example.com\n```\n\nRequesting a reverse rewrite for the SRS address\nSRS0=PmRI=YB=example.org=from@srs.example.com:\n\n```\n\u003e RSRS0=PmRI=YB=example.org=from@srs.example.com\n\u003c from@example.org\n```\n\nErrors will be reported prefixed with \"ERROR: \":\n\n```\n\u003e RSRS0=aaaa=YB=example.org=from@srs.example.com\n\u003c ERROR: Hash invalid in SRS address\n\u003e RSRS0=PmRI=aa=example.org=from@srs.example.com\n\u003c ERROR: Time stamp out of date\n\u003e Ffrom@example.org\n\u003c ERROR: Missing SRS domain or email address\n```\n\nThe final error in the above example will result in the connection being closed\ndue to the syntax error.\n\n\n## systemd\n\nA systemd service file is provided as srsd.service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilr%2Fsrsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilr%2Fsrsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilr%2Fsrsd/lists"}