{"id":15645944,"url":"https://github.com/zoni/postforward","last_synced_at":"2025-04-30T11:04:07.823Z","repository":{"id":53057996,"uuid":"102375622","full_name":"zoni/postforward","owner":"zoni","description":"Postfix SRS forwarding agent","archived":false,"fork":false,"pushed_at":"2020-12-06T22:51:08.000Z","size":22,"stargazers_count":53,"open_issues_count":4,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-25T07:08:34.478Z","etag":null,"topics":["mail","mailer","postfix","postfix-helper","sender-policy-framework","spf","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoni.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"nickgroenen"}},"created_at":"2017-09-04T15:25:37.000Z","updated_at":"2025-01-26T18:11:28.000Z","dependencies_parsed_at":"2022-08-27T14:55:31.810Z","dependency_job_id":null,"html_url":"https://github.com/zoni/postforward","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fpostforward","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fpostforward/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fpostforward/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoni%2Fpostforward/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoni","download_url":"https://codeload.github.com/zoni/postforward/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242640885,"owners_count":20162051,"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":["mail","mailer","postfix","postfix-helper","sender-policy-framework","spf","srs"],"created_at":"2024-10-03T12:10:40.873Z","updated_at":"2025-03-09T03:32:06.693Z","avatar_url":"https://github.com/zoni.png","language":"Go","funding_links":["https://ko-fi.com/nickgroenen"],"categories":[],"sub_categories":[],"readme":"Postforward\n===========\n\n*Postfix SRS forwarding agent.*\n\n\nAbout\n-----\n\nPostforward is a mail forwarding utility which aims to compliment the\n[Postfix Sender Rewriting Scheme daemon (PostSRSd)](https://github.com/roehling/postsrsd).\n\nThe downside of using PostSRSd is that all mail is naively rewritten, even\nwhen no forwarding is actually performed. Such rewritten Return-Path\naddresses may confuse sieve scripts and other mail filtering software.\n\nThis is where Postforward comes in. Instead of rewriting all incoming mail\nregardless of final destination, mail systems may be configured to pipe\nmail into Postforward only when forwarding needs to happen, leaving\nnon-forwarded mail unaltered by PostSRSd. Postforward will rewrite\nenvelope addresses for piped mail using PostSRSd itself and re-inject\nthese messages back into the queue, destined for the forwarding\nrecipient(s).\n\n\nProject status\n--------------\n\nThis software is actively maintained but considered feature-complete. No\nchanges or new features are planned except as required to fix any\npotential issues that may come up in the future.\n\n\nInstallation\n------------\n\nI no longer provide pre-compiled binaries for small-time projects of mine\nso you will have to build from sources yourself. If you have an up-to-date\n[Go toolchain](https://golang.org/dl/) installed on your system this is as\nsimple as:\n\n```sh\ngo get -d github.com/zoni/postforward\ncd ~/go/src/github.com/zoni/postforward\nmake\n```\n\nThis will create a binary called `postforward` which may be installed on\nthe target server(s). Go applications are statically linked by default so\nno additional dependencies are needed.\n\nThe makefile also contains targets to build native packages for FreeBSD\nand Debian-based operating systems (`make freebsd` and `make debian`\nrespectively). These require [fpm](https://github.com/jordansissel/fpm) to\nbe installed.\n\n\nConfiguration\n-------------\n\nPostforward relies on mail being delivered via stdin so this implies\ndelivery using Postfix's `local(8)` or `pipe(8)` delivery agents. One such\nmethod may be achieved by configuring a pipe forward in `/etc/aliases`:\n\n```\nforwarder: \"|/usr/local/bin/postforward someuser@another.host.tld\"\n```\n\n*(Note: when running PostSRSd on a different host or port, use the\n`--srs-addr` flag to set the correct address here.)*\n\nIn `main.cf`, configure `recipient_canonical_maps` and\n`recipient_canonical_classes` as\n[recommended by PostSRSd](https://github.com/roehling/postsrsd#configuration)\nbut *do not* set `sender_canonical_maps` or `sender_canonical_classes`.\n\nBeware that Postforward expects to be called for a single recipient at a\ntime (although it can *forward* to multiple recipients at once) so be sure\nto set [transport_destination_recipient_limit](http://www.postfix.org/postconf.5.html#transport_destination_recipient_limit)\nto 1 when using it with the `pipe(8)` daemon. See also\n[SINGLE-RECIPIENT DELIVERY](http://www.postfix.org/pipe.8.html).\n\n-----------------------------------------------------------------------------\n\nThe postfix `local(8)` delivery agent uses a highly sanitized environment\nfor executed processes for security reasons. Depending on your operating\nsystem, the default `$PATH` setting may be too strict for postforward to\nlocate the `sendmail` binary (Debian/Ubuntu are known to have this issue).\nIf this is the case for you, a custom `$PATH` may be set by supplying the\n`--path` argument. For example: `--path /usr/sbin:/sbin:/usr/bin:/bin`\n\n-----------------------------------------------------------------------------\n\nNote that in case of process errors, postfix bounces emails with the full\nprocess argument string in the DSN message which could leak internal\ninformation such as the forwarding address. This is default postfix\nbehavior for the local and pipe delivery agents.\n\nIf this is undesirable,\n[local_delivery_status_filter](http://www.postfix.org/postconf.5.html#local_delivery_status_filter)\nmay be configured with a PCRE map such as the following to hide this\ninformation (omit the `$2` in the final entry to also strip command\noutput):\n\n```\n/^(2\\S+ deliver(s|ed) to file).+/    $1\n/^(2\\S+ deliver(s|ed) to command).+/ $1\n/^(\\S+ Command died with status \\d+):.*(\\. Command output:.*)/ $1$2\n```\n\n\nPerformance\n-----------\n\nUsing Postforward introduces additional overhead caused by forking of\nprocesses which wouldn't happen with direct use of PostSRSd. Unless you\nare forwarding very large volumes of mail this extra overhead is likely\nnegligible in relation to the total processing cost of a complete email\ntransaction.\n\nPostforward takes care not to buffer entire messages in memory and is\ntherefore safe to use on very large emails.  Only message headers are\nbuffered in memory for processing, body content is streamed directly into\nsendmail.\n\n\nLicense\n-------\n\nPostforward is offered under the 2-Clause BSD license. See\n[LICENSE.txt](LICENSE.txt) for the full license text.\n\n\nChangelog\n---------\n\nSee [CHANGES](CHANGES.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoni%2Fpostforward","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoni%2Fpostforward","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoni%2Fpostforward/lists"}