haraka / Haraka

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

Bounce mail kills process #314

Closed DominicBoettger closed 11 years ago

DominicBoettger commented 11 years ago

If a outgoing mail bounces i get this error. The worker goes down and a lot of mails stay in queue. Any ideas?

May 10 11:13:51 node02 haraka[32335]: [INFO] [F69B72E7-EBD6-4F12-BB38-1AC5D8059C47.120] [outbound] bouncing mail: Error re-queueing email: Error: ENOENT, rename '/var/node/haraka/queue/1368177109212_0_32335_5101.node02' May 10 11:13:51 node02 haraka[32335]: [DEBUG] [F69B72E7-EBD6-4F12-BB38-1AC5D8059C47.120] [outbound] running bounce hooks May 10 11:13:51 node02 haraka[32335]: [ERROR] [F69B72E7-EBD6-4F12-BB38-1AC5D8059C47.120] [outbound] Double bounce: Error populating bounce message: Error: ENOENT, open '/var/node/haraka/queue/1368177109212_0_32335_5101.node02' May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] Error: Callback was already called. May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] at /usr/local/lib/node_modules/Haraka/outbound.js:1016:25 May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] at HMailItem.next_cb (/usr/local/lib/node_modules/Haraka/node_modules/async/lib/async.js:22:31) May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] at HMailItem.double_bounce (/usr/local/lib/node_modules/Haraka/outbound.js:1032:10) May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] at ReadStream. (/usr/local/lib/node_modules/Haraka/outbound.js:975:9) May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] at ReadStream.EventEmitter.emit (events.js:95:17) May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] at fs.js:1500:12 May 10 11:13:51 node02 haraka[32335]: [CRIT] [-] [core] at Object.oncomplete (fs.js:107:15) May 10 11:13:51 node02 haraka[32335][NOTICE] [-] [core] Shutting down

DominicBoettger commented 11 years ago

Solved using postfix

baudehlo commented 11 years ago

These issues should now be fixed in Haraka.

patchlog commented 10 years ago

This still happens in haraka 2.4.0

baudehlo commented 10 years ago

We can't replicate this. Can you specify some kind of setup that shows this happening?

On Tue, Mar 25, 2014 at 1:38 PM, Mihai Secasiu notifications@github.comwrote:

This still happens in haraka 2.4.0

— Reply to this email directly or view it on GitHubhttps://github.com/baudehlo/Haraka/issues/314#issuecomment-38596227 .

patchlog commented 10 years ago

Sadly it doesn't happen all the time. Most of the time the server just works and then this error comes up and kills it. It happened twice in a few hours. I can't really use this as a production server is this keeps happening so unfortunately I had to uninstall it. I was using haraka 2.4.0 on debian 7. It was set up simply as an outbound server. Qmail was injecting messages into it through smtp ( smtproutes ). I did a small change to the outbound.js file to allow me to exclude some hosts from tls ( problems with yahoo ) but that shouldn't have anything to do with the double bounce issue. The error I was getting was this: [outbound] Double bounce: Error populating bounce message: Error: ENOENT, open '/lv-data/haraka/queue/1395768298382_0_19693_6928.t' [CRIT] [-] [core] Error: Callback was already called. [CRIT] [-] [core] at /usr/lib/node_modules/Haraka/node_modules/async/lib/async.js:22:31 [CRIT] [-] [core] at HMailItem.hmail.next_cb (/usr/lib/node_modules/Haraka/outbound.js:48:9) [CRIT] [-] [core] at HMailItem.double_bounce (/usr/lib/node_modules/Haraka/outbound.js:1253:10) [CRIT] [-] [core] at /usr/lib/node_modules/Haraka/outbound.js:1237:25 [CRIT] [-] [core] at ReadStream. (/usr/lib/node_modules/Haraka/outbound.js:1194:9) [CRIT] [-] [core] at ReadStream.EventEmitter.emit (events.js:95:17) [CRIT] [-] [core] at fs.js:1505:12 [CRIT] [-] [core] at Object.oncomplete (fs.js:107:15)

and the modifications I did to outbound.js are bellow:

--- /usr/local/lib/node_modules/Haraka/outbound.js  2014-02-12 16:20:50.000000000 +0200
+++ outbound.js 2014-03-25 20:48:26.137832057 +0200
@@ -970,7 +970,7 @@
             }
         }

-        if (smtp_properties.tls && config.get('outbound.enable_tls') && !secured) {
+        if (smtp_properties.tls && config.get('outbound.enable_tls') && !secured && ( typeof mx.notls == 'undefined' || !mx.notls ) ) {
             socket.on('secure', function () {
                 // Set this flag so we don't try STARTTLS again if it
                 // is incorrectly offered at EHLO once we are secured.

mx.notls is set through a plugin that uses the get_mx hook.

my config/plugins file has the following plugins: dnsbl, data.headers, helo.checks, mail_from.access, mail_from.is_resolvable, max_unrecognized_commands, rcpt_to.access, rcpt_to.in_host_list, relay_acl, tls, dkim_sign and my plugin that basically just sets mx.notls and mx.bind based on the destination and sender domains. relay_acl is set to relay anything from localhost Let me know if you need any other info.