{"id":19794232,"url":"https://github.com/deysuman/smtp-listener","last_synced_at":"2026-05-14T10:39:18.034Z","repository":{"id":116972194,"uuid":"153929087","full_name":"deysuman/Smtp-Listener","owner":"deysuman","description":"A NodeJS script that acts as a SMTP listen server. Accepts all emails, and emits them both as an EventEmitter and through a socket.","archived":false,"fork":false,"pushed_at":"2018-10-20T17:16:35.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T04:42:53.862Z","etag":null,"topics":["listener","mail","nodejs","smtp","smtp-client","smtp-library","smtp-listerner","smtp-mail","smtp-server","socket","socket-programming"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deysuman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-20T17:10:13.000Z","updated_at":"2018-10-20T17:18:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce56354d-df84-40ef-81db-812bb247e253","html_url":"https://github.com/deysuman/Smtp-Listener","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deysuman%2FSmtp-Listener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deysuman%2FSmtp-Listener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deysuman%2FSmtp-Listener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deysuman%2FSmtp-Listener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deysuman","download_url":"https://codeload.github.com/deysuman/Smtp-Listener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241133271,"owners_count":19915382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["listener","mail","nodejs","smtp","smtp-client","smtp-library","smtp-listerner","smtp-mail","smtp-server","socket","socket-programming"],"created_at":"2024-11-12T07:12:36.043Z","updated_at":"2026-05-14T10:39:18.007Z","avatar_url":"https://github.com/deysuman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smtp-listener\n\nA NodeJS script that acts as a SMTP listen server. Accepts all emails, and emits them both as an EventEmitter and through a socket.\n\n\n[![suman made-with-nodejs](https://cdn.pixabay.com/photo/2015/04/23/17/41/node-js-736399_960_720.png)](https://nodejs.org)\n\n## Usage (single access)\n\nIf only 1 script needs to receive mails:\n\n```javascript\nconst SMTPServer = require(\"smtp-listener\").Server;\nconst server = new SMTPServer(25 /* port */);\nserver.on(\"test@example.com\", (mail)=\u003e{\n    ...\n});\n```\n\n## Usage (multi access)\n\nIf multiple scripts need to receive mails, create a symlink at `/var/dev/smtp-listener/` pointing to the working directory, then create a symlink at `/etc/systemd/system/smtp-listener.service` pointing to `./service/smtp-listener.service`. Finally run `sudo systemctl start smtp-listener`. This starts the server and keeps it running should it crash.\n\nIf you aren't running systemd, do the equivalent on your system.\n\nThen in your scripts do\n\n```javascript\nconst SMTPClient = require(\"smtp-listener\");\nconst client = new SMTPClient();\nclient.on(\"test@example.com\", ()=\u003e{\n    ...\n});\n```\n\n## Mail object\n\nAll listeners receive a single response, a `Mail` object. This is simply the email parsed by [Nodemailer's Mailparser](https://nodemailer.com/extras/mailparser/). See their documentation for details.\n\n## Socket\n\nIf 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.smtp-listener`).\n\nThe server emits emails as UTF8-encoded JSON to all clients, using [`node-ipc`](https://github.com/RIAEvangelist/node-ipc).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeysuman%2Fsmtp-listener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeysuman%2Fsmtp-listener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeysuman%2Fsmtp-listener/lists"}