
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
simple-smtp-listener
Advanced tools
A NodeJS script that acts as a simple SMTP listen server. Accepts all emails, and emits them both as an EventEmitter and through a socket.
If only 1 script needs to receive mails:
const SMTPServer = require("simple-smtp-listener").Server;
const server = new SMTPServer(25 /* port */);
server.on("test@example.com", (mail)=>{
...
});
If multiple scripts need to receive mails, create a symlink at /var/dev/simple-smtp-listener/
pointing to the working directory, then create a symlink at /etc/systemd/system/simple-smtp-listener.service
pointing to ./service/simple-smtp-listener.service
. Finally run sudo systemctl start simple-smtp-listener
. This starts the server and keeps it running should it crash.
If you aren't running systemd, do the equivalent on your system.
Then in your scripts do
const SMTPClient = require("simple-smtp-listener");
const client = new SMTPClient();
client.on("test@example.com", ()=>{
...
});
All listeners receive a single response, a Mail
object. This is simply the email parsed by Nodemailer's Mailparser. See their documentation for details.
If you need access to mails from non-JS code (or you don't want to use SMTPClient
), you can instead listen to the UNIX/Windows socket (default UNIX location: /tmp/app.simple-smtp-listener
).
The server emits emails as UTF8-encoded JSON to all clients, using node-ipc
.
FAQs
A simple SMTP listen server
The npm package simple-smtp-listener receives a total of 1 weekly downloads. As such, simple-smtp-listener popularity was classified as not popular.
We found that simple-smtp-listener 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.