haraka / Haraka

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

problem loading modules in haraka plugin #571

Closed evilwhaleboy closed 10 years ago

evilwhaleboy commented 10 years ago

I want to use some modules for NodeJs in a plugin, like xmlhttprequest, but it gives me the error "module not found" when I do "require("xmlhttprequest")"" .The same is happening with protobufjs. Did any of you encounter problems loading modules in haraka?

smfreegard commented 10 years ago

Like with all node.js modules - you have to install them locally for each app. For plugins you need to run 'npm install ' wherever you ran 'haraka -i /path/to/config' e.g.

If you installed Haraka with 'haraka -i /etc/haraka' then you'd install your plugin modules into /etc/haraka (cd /etc/haraka && npm install xmlhttprequest) and your plugin would like in /etc/haraka/plugins

Hope that makes sense.

evilwhaleboy commented 10 years ago

Thanks a lot! You were very helpful.