Skip to content

Instantly share code, notes, and snippets.

@simonjcarr
Last active November 17, 2020 16:58
Show Gist options
  • Select an option

  • Save simonjcarr/bb25d0cd410bf5d24fe3ea48268f2ed8 to your computer and use it in GitHub Desktop.

Select an option

Save simonjcarr/bb25d0cd410bf5d24fe3ea48268f2ed8 to your computer and use it in GitHub Desktop.
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")
@ducdev
Copy link

ducdev commented Nov 17, 2020

Hey, I've got this:

image

Any idea?

@simonjcarr
Copy link
Author

simonjcarr commented Nov 17, 2020 via email

@simonjcarr
Copy link
Author

simonjcarr commented Nov 17, 2020 via email

@ducdev
Copy link

ducdev commented Nov 17, 2020

Amazing, I add the sudo and it works. Now I understand the issue is about lacking root permission. Thanks for your super quick reply.

@ducdev
Copy link

ducdev commented Nov 17, 2020

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