Question

I am trying to setup nginx as mail proxy. All i want is to let nginx receive the mail and forward it to a script. Is this set possible or should i only use sendmail for that.

Was it helpful?

Solution

The only way I can remotely imagine that working is if you would let nginx listen on the smtp port and run a smtp server web application on that port. At that point nginx would basically only connect the outside port to your locally running app. So yeah, I think you would be much better off with a real smtp server like sendmail. Actually, I recommend you use postfix because it does the same thing arguably better.

OTHER TIPS

there is a lack of documentation but from playing around with it it looks to like the nginx mail options are for creating proxies to more easily add custom authentication to an existing MTA.

A use case might be to use a php script to authenticate existing website users using the website's existing users database without needing to create system users for them or set up extra databases.

so no, it won't forward the actual email to a script (look for things like 'pipe_tansport' in MTA's like exim to do that) but it will let you use a script to put authentication in front of an existing smtp server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top