JSPM

srs.js

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 259
  • Score
    100M100P100Q88221F
  • License Apache 2.0

Sender Rewriting Scheme in JS.

Package Exports

  • srs.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (srs.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

srs.js v0.1.0

npm install srs.js

Javascript implementation of Sender Rewriting Scheme. Loosely based on the libsrs2 implementation, though compatibility with libsrs2/Mail::SRS is not guaranteed.

Usage

var SRS = require("srs.js");
var rewriter = new SRS({
    secret: "asecretkey"
});

// Rewrite the email orig@example.org
var rewritten = rewriter.forward("orig", "example.org");
// -> rewritten: SRS0=HHH=TT=example.org=orig
// Note that rewritten address does not include domain part (@example.org)

var reversed = rewriter.reverse(rewritten);
// -> reversed: ["orig", "example.org"]

License

Apache 2.0