[PROTOCOL] [queue/smtp_proxy] Error: Drained at pluggableStream. (queue/smtp_proxy:311:26)
at pluggableStream.emit (events.js:81:20)
at CleartextStream. (/Users/matt/Perl/Haraka/tls_socket.js:59:14)
at CleartextStream.emit (events.js:61:17)
at CleartextStream._pull (tls.js:374:10)
at SecurePair._cycle (tls.js:558:20)
at CleartextStream.write (tls.js:97:13)
at pluggableStream.write (/Users/matt/Perl/Haraka/tls_socket.js:95:34)
at Object.send_data (queue/smtp_proxy:150:47)
at Plugin.hook_queue (queue/smtp_proxy:349:16)
The problem is the direct call to emit('drain') in _pull, which needs to be wrapped in a nextTick().
Example stacktrace:
[PROTOCOL] [queue/smtp_proxy] Error: Drained at pluggableStream. (queue/smtp_proxy:311:26)
at pluggableStream.emit (events.js:81:20)
at CleartextStream. (/Users/matt/Perl/Haraka/tls_socket.js:59:14)
at CleartextStream.emit (events.js:61:17)
at CleartextStream._pull (tls.js:374:10)
at SecurePair._cycle (tls.js:558:20)
at CleartextStream.write (tls.js:97:13)
at pluggableStream.write (/Users/matt/Perl/Haraka/tls_socket.js:95:34)
at Object.send_data (queue/smtp_proxy:150:47)
at Plugin.hook_queue (queue/smtp_proxy:349:16)
The problem is the direct call to emit('drain') in _pull, which needs to be wrapped in a nextTick().