Create a mail account with PHP in Linux

Is there any PHP code / idea to create e-mail account automatically in Linux , PHP environment ? I know it may be risky or spam based etc.,

I have mail servers to use Linux/Postfix with full permissions.
LVL 36
Loganathan NatarajanLAMP DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There are several different methods could be used to accomplish this.  

One option would be to use shell_exec() in PHP to directly execute Linux commands.  You could then create the email accounts exactly the same way you would from a Linux command line.

Another option would be to an existing full webmail application such as Roundcube or SquirrelMail and to use their out-of-the-box functionality.

 My recommendation would be to configure your Linux mail server to work with LDAP and then to use the PHP LDAP module to create and manage the LDAP users, thereby managing the email users.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Loganathan NatarajanLAMP DeveloperAuthor Commented:
Thanks, It was useful to consider.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.