MailServiceFree
New Pleskian
Dear PP community,
I want to create a free e-mail service.
I'm using a vServer with 200gb (for the first time) on Debian 6 with Parallels Plesk 11 backend.
Now I just want a simple php script which is for guests to register a new mail (for themselves).
I've asked a good programming friend if he could help me, so he did.
He has written a script like this:
Looks like it would work, I've tested it, but the shell_exec doesn't work correctly. (index.php permissions are at 755)
I have just this file as index.php I don't need more for the first time, I'll code the other stuff when the index.php works fine.
I've read a bit about Plesk and the creation of mails.
They have written, that shell_exec is disabled in Plesk by default and I have to activate it.
I don't know how and where I can do that.. do you know a solution?
PLEASE ANSWER IF YOU NOW THE SOLUTION...
And no, I won't use XML because I don't know how to work with it.
Thanks in advance!!
I want to create a free e-mail service.
I'm using a vServer with 200gb (for the first time) on Debian 6 with Parallels Plesk 11 backend.
Now I just want a simple php script which is for guests to register a new mail (for themselves).
I've asked a good programming friend if he could help me, so he did.
He has written a script like this:
Code:
<form method="post" action="">
<input type='hidden' name='submitted' id='submitted' value='1'/>
<label for='email' >Email Address:</label>
<input type='text' name='email' id='email' maxlength="50" />
<br>
<label for='password' >Password*:</label>
<input type='password' name='password' id='password' maxlength="50" />
<input type="submit" name="submit" value="Submit" />
</form>
<?
function sanitize($data) {
$data = strip_tags(trim($data));
$search = array('/[^A-Za-z0-9\. -\!\?\(\)\<\>\@]/');
$data = preg_replace($search, '', $data);
return $data;
}
if(isset($_POST['email'])){
// STRIP OUT ANY UNWANTED STUFF
$_POST['email'] = sanitize($_POST['email']);
$_POST['password'] = sanitize($_POST['password']);
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$email = $_POST['email'];
} else {
echo "Invalid email<br>";
$_POST['email'] = null;
return;
}
$password = $_POST['password'];
shell_exec ("/usr/local/psa/bin/./mail --create $email -passwd $password -mailbox true");
echo "Your account '$email' has been setup with password '$password'";
}
?>
Looks like it would work, I've tested it, but the shell_exec doesn't work correctly. (index.php permissions are at 755)
I have just this file as index.php I don't need more for the first time, I'll code the other stuff when the index.php works fine.
I've read a bit about Plesk and the creation of mails.
They have written, that shell_exec is disabled in Plesk by default and I have to activate it.
I don't know how and where I can do that.. do you know a solution?
PLEASE ANSWER IF YOU NOW THE SOLUTION...
And no, I won't use XML because I don't know how to work with it.
Thanks in advance!!