Hey everyone, I'm a bit stuck and need some help. I want to pipe all emails going to a subdomain to a PHP Script. So I created a subdomain and a catchall to deliver to a mailbox. I've heared something about seive pipe but don't know how to use it as I am new to that topic. Anyone got some tipps for me how to do it? Thanks
Allowing any of your mail accounts to pipe to commands opens security issues for your server (though the idea is a possible solution), I would instead create a dedicated mail transport in master.cf to run your one command/script, and add an email route for the one email account to use that transport. Be careful in your scripting, as it's easy to create vulnerabilities that can then be explored by anyone sending you email.
Or you let all emails deliver to a mailbox and then read the mailbox files from your script, either on the shell (less recommended) or by connecting to the mailbox by imap or pop3.
Thank you for the quick reply! Sounds like it's the perfect solution for my purpose. As I am learning and testing, can you give a short advice how to add a dedicated transport properly and how to use the route for specific domains? Would be great.
Now I created an entry in master.cf: Code: extpipe unix - n n - - pipe flags=FR user=vmail argv=/path/to/script created a route in ISPConfig: Type: Custom Destination: "extpipe" And created an entry in Relay Recipients with @domain.com. My Problem now is, that I get an error: Code: warning: connect to transport private/["extpipe"]: No such file or directory I tried without quotes but no change.
Okay I solved my issues. Seems like there have to be no quotes in the route. and there was a permission problem with the file. Thank you guys for your help!