haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.08k stars 661 forks source link

CRIT in smtp_client.js if connection goes away #441

Closed godsflaw closed 10 years ago

godsflaw commented 10 years ago
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] TypeError: Cannot read property 'mail_from' of null
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at SMTPClient.<anonymous> (/u/haraka/smtp_client.js:365:53)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at SMTPClient.EventEmitter.emit (events.js:92:17)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at pluggableStream.<anonymous> (/u/haraka/smtp_client.js:91:22)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at pluggableStream.EventEmitter.emit (events.js:95:17)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at pluggableStream.self.process_data (/u/haraka/line_socket.js:24:18)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at pluggableStream.<anonymous> (/u/haraka/line_socket.js:34:44)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at pluggableStream.EventEmitter.emit (events.js:95:17)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at Socket.<anonymous> (/u/haraka/tls_socket.js:48:14)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at Socket.EventEmitter.emit (events.js:95:17)
Feb 3 16:41:31 mxi10f haraka[9064]: [CRIT] [-] [core] at Socket.<anonymous> (_stream_readable.js:736:14)
godsflaw commented 10 years ago

Working on the fix for this now. Going to let it burn in for a bit before submitting a pull request.

smfreegard commented 10 years ago

Chris - see #427 - same issue. I hadn't had a chance to put together a test case to reproduce it; but the debug output I got from the user might help you.

godsflaw commented 10 years ago

I'm not using smtp_proxy these days, but my guess is a variant of this bug exists there too. As for issue #427, I think you're correct. They appear to be the same thing. My fix is going to be to move _is_dead_sender() from smtp_forward, up a level to smtp_client so that both plugins can call it.

smfreegard commented 10 years ago

I wasn't sure that it was that though; it looked to me like that calling next() was the wrong thing to do as it made the connection continue with a dead transaction; but I didn't look too hard at it.

godsflaw commented 10 years ago

fixed in https://github.com/baudehlo/Haraka/pull/443, closing.