@mxraven/mail - v0.2.0
    Preparing search index...

    Class Client

    Calls the mxRaven feedback service.

    Learning requests authenticate with the same submission API key used for SMTP submission, over HTTP Basic auth. A client is safe for concurrent use.

    const secret = process.env.MXRAVEN_SECRET;
    if (secret === undefined || secret === "") {
    throw new Error("MXRAVEN_SECRET is required");
    }

    const client = new Client({
    baseUrl: "https://feedback.mxraven.com",
    username: "mxr_tx_ab12cd34ef56",
    secret,
    });
    const result = await client.learnSpam(rawMessageBytes);
    Index
    • Submits one training example.

      rawMime must be the exact raw RFC 822 bytes that mxRaven processed; the service matches them against stored evidence by SHA-256. A message with no matching evidence fails with a FeedbackError whose statusCode is 404.

      Parameters

      • label: Disposition

        The training label to apply.

      • rawMime: Uint8Array

        The exact raw message bytes.

      • options: RequestOptions = {}

        An optional cancellation signal.

      Returns Promise<LearningResult>

      The service's learning result.

      FeedbackError When the service returns a non-success status.

    • Performs an RFC 8058 one-click unsubscribe for a token.

      This is the operation a recipient mail client performs against the List-Unsubscribe URL; applications rarely call it directly. It is unauthenticated.

      Parameters

      • token: string

        The signed unsubscribe token.

      • options: RequestOptions = {}

        An optional cancellation signal.

      Returns Promise<void>

      FeedbackError When the service returns a non-success status.