Created
August 20, 2013 20:40
-
-
Save dannycoates/6286979 to your computer and use it in GitHub Desktop.
simplesmtp _onData bug
This file contains 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
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