Skip to content

Instantly share code, notes, and snippets.

@dannycoates
Created August 20, 2013 20:40
Show Gist options
  • Save dannycoates/6286979 to your computer and use it in GitHub Desktop.
Save dannycoates/6286979 to your computer and use it in GitHub Desktop.
simplesmtp _onData bug
var smtp = require('simplesmtp')
var net = require('net')
var server = net.createServer(
function (c) {
console.log('connected')
c.write('220 127.0.0.1\r\n')
c.on('data',
function (data) {
console.log(data.toString())
c.write('250-127.0.0.1\r\n250-8BITMIME\r\n')
setTimeout(
function () {
c.write('250 OK\r\n')
},
10
)
}
)
}
)
server.listen(9999)
console.log('connecting')
var client = smtp.connect(9999, '127.0.0.1', { debug: true })
client.once('idle', function () {
console.log('ok')
process.exit(0)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment