Mail alias - PHP User

Hi,

I am using a mail alias in Virtualmin to pipe emails to a PHP script, (php -q /path/to/script.php) this all works great except for one little hitch. When somebody sends in an email with an attachment the script grabs that attachment and saves it to a directory for use by the website later.

The problem is when the script runs the user it runs as is ‘nobody’ does anybody happen to know if there is a simple way to run this under the same user as the website to prevent permission problems?

Any ideas / advice would be very much appreciated.

Thanks

Howdy,

If you’re using CGI or FCGID, you can setup your scripts to run as the Virtual Server owner.

To do that, go into Server Configuration -> Website Options, and set “Run CGI scripts as domain owner” to “Yes”.

-Eric