Last active
November 17, 2020 16:58
-
-
Save simonjcarr/bb25d0cd410bf5d24fe3ea48268f2ed8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const SMTPServer = require("smtp-server").SMTPServer; | |
| const parser = require("mailparser").simpleParser | |
| const server = new SMTPServer({ | |
| onData(stream, session, callback) { | |
| parser(stream, {}, (err, parsed) => { | |
| if (err) | |
| console.log("Error:" , err) | |
| console.log(parsed) | |
| stream.on("end", callback) | |
| }) | |
| }, | |
| disabledCommands: ['AUTH'] | |
| }); | |
| server.listen(25, "192.168.30.100") |
Author
This is probably because the account you are running node with does not have root permission. Any port below 1024, in this case port 25 can only be used by an application that is started by an elevated user.
Simon
… On 17 Nov 2020, at 16:44, Duc Le ***@***.***> wrote:
@ducdev commented on this gist.
Hey, I've got this:
<https://user-images.githubusercontent.com/3524016/99419469-bbbea500-292e-11eb-8646-2fa246ee6aa8.png>
Any idea?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <https://gist.github.com/bb25d0cd410bf5d24fe3ea48268f2ed8#gistcomment-3530608>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AALH6TVX34O3HDLJKZLBPQLSQKR5RANCNFSM4TY2EGEQ>.
Author
To help you out further the following answer on Stack overflow should sort you out.
https://stackoverflow.com/a/27096568/501827 <https://stackoverflow.com/a/27096568/501827>
Simon
… On 17 Nov 2020, at 16:44, Duc Le ***@***.***> wrote:
@ducdev commented on this gist.
Hey, I've got this:
<https://user-images.githubusercontent.com/3524016/99419469-bbbea500-292e-11eb-8646-2fa246ee6aa8.png>
Any idea?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <https://gist.github.com/bb25d0cd410bf5d24fe3ea48268f2ed8#gistcomment-3530608>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AALH6TVX34O3HDLJKZLBPQLSQKR5RANCNFSM4TY2EGEQ>.
Amazing, I add the sudo and it works. Now I understand the issue is about lacking root permission. Thanks for your super quick reply.
I'm building my own disposable mail service, your guide made my day!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, I've got this:
Any idea?