New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

miabclient

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

miabclient

A simple module for the Mail-in-a-Box API with little additions

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

MiabClient

MiabClient is a simple module for interacting with the Mail-in-a-Box API with additional features. It provides a client for sending requests to a Mail-in-a-Box server, including methods for getting and setting the admin email, generating passwords, and fetching emails from a mailbox.

This client includes all neccessary methods to be used as an self-made kopeechka alternative.

MIAB: https://mailinabox.email/

Installation

You can install MiabClient using npm:

npm install miabclient

Requirements

You must have a fully setuped and working Mail-in-a-Box server, read here how to setup: https://mailinabox.email/guide.html

Usage

Here's an example of how you can use MiabClient to create an email and read emails:

import MiabClient from "miabclient";

// Initialize the client
const client = new MiabClient('https://your-domain.com', 'admin@your-domain.com', 'your-password');

async function main() {
    // Create a mailbox
    const mailbox = await client.createMailbox('your-domain.com'
        // 'username', // optional
        // 'password' // optional
    );
    console.log(mailbox); // { success: true, email: 'email@your-domain.com', password: 'password' }

    // Get emails
    const emails = await client.getEmails(mailbox.email, mailbox.password);
    console.log(emails); // { success: true, response: [ { ... }, { ... }, ... ] }

    // Wait for an email
    const email = await client.waitForEmail({
        email: mailbox.email,
        password: mailbox.password,
        regex: [
            'This text is in the email',
            
            // also supports regex in the form of a string
            '/This text is in the email/^i'	
        ]
    });

    console.log(email); // { success: true, response: { ... } }
}

Please replace 'https://your-domain.com', 'admin@your-domain.com', 'your-password', and 'mailbox@your-domain.com' with your actual domain, admin email, password, and mailbox respectively.

Additional Information

The module is based on the v67. [03.2024]

License

MiabClient is ISC licensed.

Keywords

FAQs

Package last updated on 17 Mar 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc