Socket
Socket
Sign inDemoInstall

maildrop

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    maildrop

A wrapper around Maildrop's api.


Version published
Maintainers
1
Created

Readme

Source

Installation

npm i maildrop

Type Definitions

type Message = {
  id: string,
  ip: string,
  helo: string,
  date: string,
  mailfrom: string,
  rcptto: string[],
  headerfrom: string,
  subject: string,
  data: string,
  html: string,
};

type Statistics = {
  blocked: number,
  saved: number,
};

function getInbox(mailbox: string): Promise<Omit<Omit<Message, "data">, "html">[] | null>

function getMessage(mailbox: string, id: string): Promise<Message | null>

function getAltInbox(mailbox: string): Promise<string | null>

function getStatistics(): Promise<Statistics | null>

function getStatus(): Promise<string | null>

Usage

// my-file.ts

import maildrop from "maildrop";

const mailbox = "test";

maildrop.getInbox(mailbox).then((inbox) => {
  if (!inbox) return;

  // inbox messages do not contain the "html" and "data" fields
  inbox.forEach((message) => {
    maildrop.getMessage(mailbox, message.id).then((message) => {
      if (!message) return;
      console.log(message);
    });
  });
});

maildrop.getAltInbox(mailbox).then((altinbox) => {
  if (!altinbox) return;
  console.log(altinbox);
});

maildrop.getStatistics().then((statistics) => {
  if (!statistics) return;
  console.log(statistics);
});

maildrop.getStatus().then((status) => {
  if (!status) return;
  console.log(status);
});

Keywords

FAQs

Last updated on 08 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc