haraka / Haraka

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

Unable to use the qmail-queue plugin #150

Closed abhas closed 11 years ago

abhas commented 12 years ago

I'm attempting to use the qmail-queue plugin. But it fails to compile and haraka does not start up. I have tried to install Haraka using npm as well as using the git repository.

This is the error that I get:


[INFO] [-] [core] Loading plugin: queue/qmail-queue
[CRIT] [-] [core] Compiling plugin: queue/qmail-queue failed
[CRIT] [-] [core] Error: No such module
[CRIT] [-] [core]     at queue/qmail-queue:5:26
[CRIT] [-] [core]     at Object._load_and_compile_plugin (/data/Code/github/Haraka/plugins.js:133:12)
[CRIT] [-] [core]     at /data/Code/github/Haraka/plugins.js:88:26
[CRIT] [-] [core]     at Array.map (native)
[CRIT] [-] [core]     at Object.load_plugins (/data/Code/github/Haraka/plugins.js:81:39)
[CRIT] [-] [core]     at Object.createServer (/data/Code/github/Haraka/server.js:61:13)
[CRIT] [-] [core]     at Object.<anonymous> (/data/Code/github/Haraka/haraka.js:39:8)
[CRIT] [-] [core]     at Module._compile (module.js:432:26)
[CRIT] [-] [core]     at Object..js (module.js:450:10)
[CRIT] [-] [core]     at Module.load (module.js:351:31)

Line numer 5 of queue/qmail-queue contains:

var netBinding = process.binding('net');

I am using using node v0.6.8.

baudehlo commented 12 years ago

Sadly this plugin only works on node 0.4.x, because the node core team removed some functionality I was using, and they haven't provided any new way of doing it under 0.6.

I'm pretty annoyed about the situation, but what can I do?

abhas commented 12 years ago

Is it possible that we could work together on rewriting this in some way so that it can work with the latest version of node-js? I am new to nodejs but can pick up fast to implement this plugin.

baudehlo commented 12 years ago

The only way I can think of is to write a wrapper in another language that somehow supports delimited submission over just stdin. There seems to be no way to write to stdout in the new node.

msimerson commented 12 years ago

Is there a workaround? Like run qmail-smtpd on another port and use the smtp-forward or smtp-proxy plugins?

baudehlo commented 12 years ago

FWIW, Node 0.8 has the abilities we need added back in. We should be able to make it work under 0.8 now.

baudehlo commented 12 years ago

Please try the qmail_queue_fix branch. I implemented a fix for this, but haven't been able to test it.

sarguru commented 12 years ago

@baudehlo I tested it out . The problem is qmail_queue.stdio[1]/[0] are streams. So it gives an badtype error as we are using it in the fs.write function since it expects fd. Instead we should be using qmail_queue.stdio[1].write(buff) and modify write_more function accordingly I beleive. Also, I think some other things are a bit different . Please check this [ https://gist.github.com/3052681 ] when you are free

baudehlo commented 11 years ago

I have finally fixed this in Haraka 2.1.

abhas commented 11 years ago

Thanks a lot for this! Haraka works great with qmail now! :+1: