{"id":19080639,"url":"https://github.com/valeriansaliou/node-spamassassin-client","last_synced_at":"2025-04-30T06:11:55.749Z","repository":{"id":250131705,"uuid":"833586901","full_name":"valeriansaliou/node-spamassassin-client","owner":"valeriansaliou","description":"🔪 SpamAssassin client for Node. Lets you check if an email is spam or ham.","archived":false,"fork":false,"pushed_at":"2025-01-06T21:18:58.000Z","size":63,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T06:11:48.704Z","etag":null,"topics":["antispam","email","ham","spam","spamassassin","spamc","spamd"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/spamassassin-client","language":"JavaScript","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/valeriansaliou.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-07-25T10:51:29.000Z","updated_at":"2025-01-06T21:19:02.000Z","dependencies_parsed_at":"2024-11-09T02:25:02.635Z","dependency_job_id":"92d48d4a-bdda-4cd8-8f6b-c53ef11da691","html_url":"https://github.com/valeriansaliou/node-spamassassin-client","commit_stats":null,"previous_names":["valeriansaliou/node-spamassassin-client"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fnode-spamassassin-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fnode-spamassassin-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fnode-spamassassin-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valeriansaliou%2Fnode-spamassassin-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valeriansaliou","download_url":"https://codeload.github.com/valeriansaliou/node-spamassassin-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251651231,"owners_count":21621716,"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":["antispam","email","ham","spam","spamassassin","spamc","spamd"],"created_at":"2024-11-09T02:24:49.272Z","updated_at":"2025-04-30T06:11:55.710Z","avatar_url":"https://github.com/valeriansaliou.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-spamassassin-client\n\n[![Test and Build](https://github.com/valeriansaliou/node-spamassassin-client/workflows/Test%20and%20Build/badge.svg)](https://github.com/valeriansaliou/node-spamassassin-client/actions?query=workflow%3A%22Test+and+Build%22) [![Build and Release](https://github.com/valeriansaliou/node-spamassassin-client/workflows/Build%20and%20Release/badge.svg)](https://github.com/valeriansaliou/node-spamassassin-client/actions?query=workflow%3A%22Build+and+Release%22) [![NPM](https://img.shields.io/npm/v/spamassassin-client.svg)](https://www.npmjs.com/package/spamassassin-client) [![Downloads](https://img.shields.io/npm/dt/spamassassin-client.svg)](https://www.npmjs.com/package/spamassassin-client)\n\n**SpamAssassin client, that lets you check if an email is spam or ham.**\n\nThis library aims at being as correct and lightweight as possible, built as an alternative to all other SpamAssassin client libraries which are 10+ years old, unmaintained and buggy.\n\nAll functions in this library return Promise objects. TypeScript definitions are also provided.\n\n**🇸🇮 Crafted in Ljubljana, Slovenia.**\n\n## Who uses it?\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://crisp.chat/\"\u003e\u003cimg src=\"https://valeriansaliou.github.io/node-spamassassin-client/images/crisp.png\" width=\"64\" /\u003e\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://yournotify.com/\"\u003e\u003cimg src=\"https://valeriansaliou.github.io/node-spamassassin-client/images/yournotify.png\" width=\"64\" /\u003e\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd align=\"center\"\u003eCrisp\u003c/td\u003e\n\u003ctd align=\"center\"\u003eYournotify\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n_👋 You use spamassassin-client and you want to be listed there? [Contact me](https://valeriansaliou.name/)._\n\n## How to install?\n\nInclude `spamassassin-client` in your `package.json` dependencies.\n\nAlternatively, you can run `npm install spamassassin-client --save`.\n\n## How to use?\n\n### Check if an email is spam\n\n#### 1. Create a client\n\n```javascript\nvar SpamAssassinClient = require(\"spamassassin-client\").SpamAssassinClient;\n\nvar spamAssassin = new SpamAssassinClient({\n  host : \"127.0.0.1\"\n});\n```\n\n#### 2. Check an email\n\n```javascript\nspamAssassin.check(message)\n  .then(function(result) {\n    // (Handle result here)\n  })\n  .catch(function(error) {\n    // (Handle error here)\n  });\n```\n\n### Tunnel to a remote SpamAssassin\n\nIf you need to test this library on your local computer, while using a remote SpamAssassin instance, you can easily open a SSH tunnel to this instance:\n\n```sh\nssh -L 127.0.0.1:783:[remote_spamd_ip]:783 root@[remote_ssh_hostname]\n```\n\nYou will need root permissions to bind to `783` on your local machine, so you might need to `sudo`.\n\n_👉 Make sure to replace `[remote_spamd_ip]` and `[remote_ssh_hostname]` with the IP address SpamAssassin is listening on, and your server hostname._\n\n## Available options\n\nThose options can be passed when constructing a new `SpamAssassinClient` instance:\n\n* `host`: the hostname or IP address of the SpamAssassin server (_defaults to `127.0.0.1`_);\n* `port`: the port of the SpamAssassin server (_defaults to `783`_);\n* `timeout`: the timeout in seconds of the socket connection to the SpamAssassin server (_defaults to `10`_);\n\n## Available methods\n\nThose methods can be called on a `SpamAssassinClient` instance:\n\n * `spamAssassin.check(message)`: checks an email for spam, returns `Promise\u003c{ score, spam }\u003e`;\n * `spamAssassin.symbols(message)`: checks an email for spam and get its symbols, returns `Promise\u003c{ score, spam, symbols }\u003e`;\n * `spamAssassin.report(message)`: checks an email for spam and generate a report, returns `Promise\u003c{ score, spam, report }\u003e`;\n * `spamAssassin.ping()`: checks for the SpamAssassin connection health, returns `Promise\u003c{}\u003e`;\n\nNote that all methods also return the `code` and `message` properties.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaleriansaliou%2Fnode-spamassassin-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaleriansaliou%2Fnode-spamassassin-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaleriansaliou%2Fnode-spamassassin-client/lists"}