Mail alias - PHP User

2 posts / 0 new
Last post
#1 Tue, 10/05/2010 - 04:42
globalwebcom

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

Tue, 10/05/2010 - 12:08
andreychek

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

Topic locked