Flolagale / mailin

Artisanal inbound emails for every web app
mailin.io
MIT License
1.95k stars 151 forks source link

HAPROXY and send-proxy parameter #83

Open timmeade opened 8 years ago

timmeade commented 8 years ago

We setup a simple test for maillin and everything looks fantastic so far except for a proxy test.

using one of the latest haproxy setups, we wanted to test proxying the node servers running mailin.

With the send-proxy command turned on for the server, mailin crashes instantly with the checks.

server smtp-work 10.1.1.140:2525 check send-proxy

error: Error: write EPIPE at Object.exports._errnoException (util.js:856:11) at exports._exceptionWithHostPort (util.js:879:20) at WriteWrap.afterWrite (net.js:763:14) events.js:146 throw err; ^

Error: Uncaught, unspecified "error" event. ([object Object]) at emit (events.js:144:17)

Any ideas or thoughts? We need to proxy the IP of the actual sender through the haproxy.

Thanks

Flolagale commented 8 years ago

@TimMeade I'm not familiar with haproxy in particular and tcp proxying in general. How does the send-proxy protocol forwards the sender IP? Usually, EPIPE errors arise when the server on one end closes the connection. Would it be possible that haproxy closes the connection too early?