Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
smtpd-lite
Advanced tools
Readme
An uncomplicated SMTP mail receiver for Node.js.
var Server = require('smtpd-lite');
var server = new Server({
host: 'mail.example.com',
domain: 'example.com'
});
server.on('receive', function(mail) {
console.log(mail);
});
server.listen(25);
# Install with npm
$ npm install smtpd-lite
# Install from source code
$ git clone https://github.com/g6123/node-smtpd-lite.git smtpd-lite
smtpd-lite
uses new stream API (stream2), and is supported for Node.js v0.10+.libicu
. Install guide is here.This class inherits net.Server. You can use all methods and events from net.Server such as server.listen()
, server.close()
, server.on('error', function(error) { ... })
, etc.
options
defines all settings for server and supoorts following properties :
false
, all TLS features are disabled. (default : false)
false
, all authentication features are disabled. (default : false)
false
, log file won't be created. (default : false)Removes temporary files in the directory configured by config['tempDir']
. If all
argument is given true
, it removes all files in the directory. Otherwise, it removes only empty (zero-size) files.
Alias for sessionStart event of Receiver.
Alias for sessionEnd event of Receiver.
Alias for parseStart event of Parser.
Alias for parseEnd event of Parser.
Another alias for parseEnd event of Parser.
Replaces the socket which the receiver uses. Also it removes, from the old socket, event listeners registered by receiver, and sets the same listeners on the new socket.
The socket a receiver is currently using.
Indicates whether or not HELO/EHLO message response was sent.
There are four possible states.
-1
means that TLS features are disabled.0
means TLS features are enabled, but the socket is not secure due to failed negotiation or just because TLS negotiation has not yet started.1
means the socket is secured with TLS.2
means that server is negotiating with the client.There are four possible states.
-1
means authentication is disabled.0
means authentication feature is enabled, but the client has not yet logged in or the authentication has failed.1
means the client has been authenticated successfully.2
means authentication is in the progress.Emitted when the server was connected to a new client or the client made a new session (RSET
or the end of DATA
.)
Emitted when the client sends AUTH
command. Until callback
is called, all data chunks from the client is processed only by event listener listening on this auth event. When callback
is called with error
, the receiver will consider the authentication has failed. Below is an example code.
var Server = require('smtpd-lite');
var server = new Server({
auth: {
force: false,
type: ['DIGEST-MD5', 'CRAM-MD5']
}
});
server.on('sessionStart', function(receiver) {
receiver.on('auth', function(data, callback) {
// Authenticate the client with the given `data`..
if(error) {
receiver.socket.send(error + 'Authentication failed');
} else {
receiver.socket.send('235 Authentication successful');
}
callback(error);
});
});
Emitted when the server reached the end of a mail or the client made new session (RSET
or the end of DATA
.) Not emitted when the connection has been closed or session been reset before any mail had been received.
This class inherits stream.Transform. You can use all methods and events from stream.Transform such as parser.pipe()
, parser.end()
, parser.on('error', function(error) { ... })
, etc.
Emitted when the first line to be parsed is received.
mail
argument is an object with following properties :
{
id: String,
header: { ... },
body: {
stream: stream.Readable stream,
length: Number
},
multiparts: [
{
header: { ... },
stream: stream.Readable stream,
length: Number
}, ...
]
}
stream
.stream
.FAQs
An uncomplicated SMTP server for Node.js
The npm package smtpd-lite receives a total of 8 weekly downloads. As such, smtpd-lite popularity was classified as not popular.
We found that smtpd-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.