haraka / Haraka

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

Question: Example of anti-spam config & HTTP email forwarding? #268

Closed dhruvbird closed 11 years ago

dhruvbird commented 11 years ago

Hello,

There's 2 thing I was thinking of. Please could you let me know if there are any relevant examples.

  1. Plugging it into an email classifier such as spamassassin/popfile/etc...
  2. Forwarding received email to an HTTP endpoint (yes), so that the HTTP endpoint can decide what to do with it. Alternatively a simple function like process_email(email_object) should also be fine.

Motivation is to be able to store the received email in a custom format (possibly encrypt, etc...)

If this SMTP server is an EventEmitted (or an EventPipe), then things should be relatively smooth since the AV/anti-spam/delivery can just be handlers at various stages in the pipe. I was checking out some of the plugin examples such as https://github.com/baudehlo/Haraka/blob/master/plugins/clamd.js and it seems it is the way I am thinking it to be, but some documentation would be super helpful.

For example, it seems that the connection object has the entire email stored within it. Any docs. about the various fields here?

dhruvbird commented 11 years ago

bah. nvm - I think I found something useful: https://github.com/baudehlo/Haraka/blob/master/docs/Plugins.md