By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

Php script - create mail user - Linux/Postfix

P: n/a
Hi everybody,

I have a personel server (I learning) with Linux
I use apache, Php, Postfix.

I want create with Php script a mail user by web form (yahoo like) I
don't really know Php. May be someone can give me a example. I want
permit at my friends to create their own email account.

Thanks folks!

Jean-Louis

P.S. If possible sent me your answer at jl****@sympatico.ca

Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Matthew,

Thanks,
I'll try and I'll give you some news.

Jean-Louis

Matthew Vickers wrote:
On Mon, 25 Aug 2003 21:21:31 -0400
Jean-Louis Vill <jl****@sympatico.ca> wrote:

Hi everybody,

I have a personel server (I learning) with Linux
I use apache, Php, Postfix.

I want create with Php script a mail user by web form (yahoo like) I
don't really know Php. May be someone can give me a example. I want
permit at my friends to create their own email account.

The commands to read up on would be sudo, sudoers, useradd, the
backtick operator (or shell_exec) and escapeshellarg.

Add the user apache runs as on your unit and command adduser to the
sudoers file (as per the man page) and shell_exec sudo useradd.

Something like the following:

$password = escapeshellarg($_POST["pass"]);
$user_name = escapeshellarg($_POST["user"]);
$ret = `sudo useradd -g users -s /bin/false -p $password $user_name`;

*Disclaimer* code not tested, do not know if it will work and it's
most likely insecure.
Matt

<snip>


Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.