{"id":18830765,"url":"https://github.com/nextronsystems/postfix2thunderstorm","last_synced_at":"2026-01-24T11:30:14.182Z","repository":{"id":208990285,"uuid":"687369713","full_name":"NextronSystems/postfix2thunderstorm","owner":"NextronSystems","description":"Postfix 2 Thor Thunderstorm","archived":false,"fork":false,"pushed_at":"2023-11-24T11:12:38.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-30T06:44:46.815Z","etag":null,"topics":[],"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/NextronSystems.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":"2023-09-05T08:10:33.000Z","updated_at":"2023-11-28T17:29:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"fca60c9b-187b-48bf-8d8c-32ebd03951d3","html_url":"https://github.com/NextronSystems/postfix2thunderstorm","commit_stats":null,"previous_names":["nextronsystems/postfix2thunderstorm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextronSystems%2Fpostfix2thunderstorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextronSystems%2Fpostfix2thunderstorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextronSystems%2Fpostfix2thunderstorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextronSystems%2Fpostfix2thunderstorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NextronSystems","download_url":"https://codeload.github.com/NextronSystems/postfix2thunderstorm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768952,"owners_count":19693760,"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":[],"created_at":"2024-11-08T01:50:32.812Z","updated_at":"2026-01-24T11:30:14.124Z","avatar_url":"https://github.com/NextronSystems.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Milter 2 THOR-Thunderstorm - Postfix Milter service for scanning with THOR Thunderstorm\n\n![image](https://github.com/NextronSystems/postfix2thunderstorm/assets/8741929/8a79d757-0ae5-40cd-bd67-6ebb8e22dd02)\n\nThe Postfix mail server is a popular and highly configurable Mail Transfer Agent (MTA) used for routing and delivering email messages within a network or across the internet. Similar to the Sendmail MTA, it can use Milter (protocol) to scan incoming emails for spam or malware. On incoming emails, compatible MTAs use the Milter protocol to communicate with an extra service, which also speaks the Milter protocol. This extra service scans the email and responds with its findings. Based on the response of the extra service the MTA can filter, discard, or quarantine the email. `postfix2thunderstorm` is a free and open-source implementation of a Milter Service which allows you to scan emails using THOR Thunderstorm. Read more about this in the following [blog post](https://www.nextron-systems.com/2023/11/14/supercharged-postfix)\n\n## Build\n\nRequires Go \u003e= 1.20\n\n```bash\ngo build -o postfix2thunderstorm cmd/main/main.go\n```\n\n## Usage\n\n```bash\n./postfix2thunderstorm -h\n```\n```bash\n-config string\n       Config filepath (default \"./p2t.config.yaml\")\n-debug\n       Debug flag\n\n```\n\n## Running\n\n```bash\n./postfix2thunderstorm --config p2t.config.yaml\n```\n\n## Config\n\nBelow is an [example](https://github.com/NextronSystems/postfix2thunderstorm/blob/master/p2t.config.yaml) configuration that can be used with `postfix2thunderstorm`\n\n```yml\nlog_filepath: ./postfix2thunderstorm.log                                        # log filepath\nmax_filesize_bytes: 50_000_000                                                  # max size in bytes\nactive_mode: true                                                               # if true mails are quarantied based on 'quarantine_expression', else its in 'passive-mode'\nmilter_host: localhost                                                          # host to listen on, postfix will connect here\nmilter_port: 11337                                                              # port to listen on\nthorthunderstorm_url: http://localhost:8080/api/check                           # Thor Thunderstorm endpoint\nquarantine_expression: one(Matches, {.Subscore \u003e 90}) or FullMatch.Score \u003e 90   # Expression (https://github.com/antonmedv/expr) used for deciding if email should be quarantined\n# Objects (e.g., '.Subscore' and FullMatch) to work with can be found in \"milter.go:16\"\n```\n\nThere is an automatic log file rotation (~ 3 months of logs): \n\n* MaxSize:    500 megabytes\n* MaxBackups: 3\n* MaxAge:     31 days\n\nIt might be a good idea to monitor the log file for level `warning` and `error` messages.\n\nNotably you want to look for `warning` level lines with the following message:\n\n* `msg:\"Finding\"` --\u003e THOR Thunderstorm found something suspicious\n* `msg:\"Quarantined email\"` --\u003e THOR Thunderstorm found something and the `quarantine_expression` triggered.\n\nPostfix will place quarantined mails into its \"hold\" queue where they can be inspected and released or deleted.\n\n## Postfix\n\nTested with version 3.6.4 - but should work with any recent version.\n\n### Postfix Config\n\nAdd the follwoing to your Postfix config (/etc/postfix/main.cf) and restart it:\n```\n# See https://www.postfix.org/MILTER_README.html for more information\nsmtpd_milters = inet:\u003cIP\u003e:\u003cPort\u003e # IP/Port of host where the postfix2thunderstorm service is running (might be a good idea to make it the localhost (or use TLS))\nmilter_default_action = accept   # default action in case of error/timeout/...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextronsystems%2Fpostfix2thunderstorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextronsystems%2Fpostfix2thunderstorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextronsystems%2Fpostfix2thunderstorm/lists"}