{"id":19608910,"url":"https://github.com/forwardemail/authheaders","last_synced_at":"2025-04-27T20:33:10.434Z","repository":{"id":42367840,"uuid":"285227732","full_name":"forwardemail/authheaders","owner":"forwardemail","description":"Node.js wrapper around the Python pip package authheaders exposing a function to generate Authentication-Results headers","archived":false,"fork":false,"pushed_at":"2023-12-07T00:06:18.000Z","size":447,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T16:12:28.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/forwardemail.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}},"created_at":"2020-08-05T08:27:54.000Z","updated_at":"2024-01-15T15:26:02.000Z","dependencies_parsed_at":"2023-12-22T16:11:07.338Z","dependency_job_id":"98a4f3d8-dff2-4160-85f1-e4f9f0ad8261","html_url":"https://github.com/forwardemail/authheaders","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"fb4f7b746d323121b06d47ad4b208238b0541b29"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardemail%2Fauthheaders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardemail%2Fauthheaders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardemail%2Fauthheaders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forwardemail%2Fauthheaders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forwardemail","download_url":"https://codeload.github.com/forwardemail/authheaders/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251204769,"owners_count":21552286,"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-11T10:18:31.648Z","updated_at":"2025-04-27T20:33:09.869Z","avatar_url":"https://github.com/forwardemail.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# authheaders\n\n[![build status](https://img.shields.io/travis/com/forwardemail/authheaders.svg)](https://travis-ci.com/forwardemail/authheaders)\n[![code coverage](https://img.shields.io/codecov/c/github/forwardemail/authheaders.svg)](https://codecov.io/gh/forwardemail/authheaders)\n[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)\n[![license](https://img.shields.io/github/license/forwardemail/authheaders.svg)](LICENSE)\n[![npm downloads](https://img.shields.io/npm/dt/authheaders.svg)](https://npm.im/authheaders)\n\n\u003e Node.js wrapper around the Python pip package [authheaders][] exposing a function to generate Authentication-Results headers\n\n\n## Table of Contents\n\n* [Requirements](#requirements)\n* [Install](#install)\n* [Usage](#usage)\n  * [authenticateMessage](#authenticatemessage)\n* [Contributors](#contributors)\n* [License](#license)\n\n\n## Requirements\n\n1. Ensure that you have a Python version of \u003e= 3.6 installed.\n\n   ```sh\n   python3 --version\n   ```\n\n2. Install the package [authheaders][] from our fork which contains a fix (until \u003chttps://github.com/ValiMail/authentication-headers/pull/6\u003e is merged and released):\n\n   ```sh\n   pip3 install git+https://github.com/forwardemail/authentication-headers.git\n   ```\n\n3. Install [dnspython](https://github.com/rthalley/dnspython) v1.16.0:\n\n   ```sh\n   pip3 install dnspython==1.16.0\n   ```\n\n4. Install [pyspf](https://pypi.org/project/pyspf/):\n\n   ```sh\n   pip3 install pyspf\n   ```\n\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install authheaders\n```\n\n[yarn][]:\n\n```sh\nyarn add authheaders\n```\n\n\n## Usage\n\n### authenticateMessage\n\n```js\nconst fs = require('fs');\n\nconst { authenticateMessage } = require('authheaders');\n\nconst message = fs.readFileSync('/path/to/example.eml');\nconst authservId = 'mx.example.com';\nconst ip = '1.2.3.4';\nconst mailFrom = 'example.net';\nconst helo = 'domain.of.sender.example.net';\n\n// then/catch usage\nauthenticateMessage(message, authservId, ip, mailFrom, helo)\n  .then(console.log)\n  .catch(console.error);\n\n// async/await usage\n(async () =\u003e {\n  try {\n    const result = await authenticateMessage(message, authservId, ip, mailFrom, helo);\n    console.log(result);\n  } catch (err) {\n    console.error(err);\n  }\n})();\n```\n\nThe value of `result` is an Object with properties `header` (String), and Objects for `spf`, `dkim`, `arc`, and `dmarc`.\n\nThese Objects contain a `result` (String) and conditionally a `reason` (String) value.\n\nAn example `result` object is provided below:\n\n```js\n{\n  header: 'example.com; spf=none smtp.helo=domain.of.sender.net smtp.mailfrom=test.com; dkim=pass header.d=forwardemail.net; arc=pass; dmarc=fail (Used From Domain Record) header.from=gmail.com policy.dmarc=none',\n  spf: { result: 'none' },\n  dkim: { result: 'pass' },\n  arc: { result: 'pass' },\n  dmarc: { policy: 'none', result: 'fail', reason: 'Used From Domain Record' }\n}\n```\n\n\n## Contributors\n\n| Name           | Website                    |\n| -------------- | -------------------------- |\n| **Nick Baugh** | \u003chttp://niftylettuce.com/\u003e |\n\n\n## License\n\n[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)\n\n\n## \n\n[npm]: https://www.npmjs.com/\n\n[yarn]: https://yarnpkg.com/\n\n[authheaders]: https://pypi.org/project/authheaders/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforwardemail%2Fauthheaders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforwardemail%2Fauthheaders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforwardemail%2Fauthheaders/lists"}