You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

server-accepts-email

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

server-accepts-email

Check if an SMTP server accepts emails to a given address.

1.11.1
latest
Source
npmnpm
Version published
Weekly downloads
25
78.57%
Maintainers
1
Weekly downloads
 
Created
Source

Server Accepts Email

Check if an SMTP server accepts emails to a given address.

Installation

npm install --save server-accepts-email

Usage

const serverAcceptsEmail = require('server-accepts-email')

console.log(await serverAcceptsEmail('linus@folkdatorn.se'))
//=> true

console.log(await serverAcceptsEmail('6bJ4zsZHOE@folkdatorn.se'))
//=> false

console.log(await serverAcceptsEmail('linus@gp5uzpn2q7.se'))
//=> false

API

serverAcceptsEmail(email[, options]) => Promise<boolean>

  • email (string, required) - Email address to test
  • options (object, optional)
    • senderDomain (string, optional) - Domain to identify as (in HELO smtp command)
    • senderAddress (string, optional) - Email address to identify as (in MAIL FROM command)

Other libraries

There are some other libraries that do the same thing, but I found them to have some flaws which made me write this one.

 Promise APIFollows RFC5321 1Proper Errors 2Handles Greylisting 3Connection Pooling 4
server-accepts-email
email-exists
email-existence
email-verify

1 None of the other libraries parsed the replies to support multiline replies but instead relied on every reply coming in a chunk, accepting all data and searching for substrings, or something similar.

2 Some of the other libraries rejects, or calls the callback, with something other than an Error instance.

3 This library detects Greylisting and sends another request after the timeout has passed.

4 This library reuses connections, and limits the number of simultaneous connections to any given host. This is more effecient, and the behaviour more closely matches that of proper SMTP clients, decreasing the chance of being blacklisted.

Keywords

check

FAQs

Package last updated on 25 Jul 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.