Welcome to WebmasterWorld Guest from 54.227.127.109

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Setting Up New Imap Accounts Automatically

Possible With PHP?

     
8:51 pm on Jan 27, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2004
posts:127
votes: 0


I was wondering if it is possible to automatically setup new imap accounts with php (if not, is there another similar free language that I could use to do this (perl).

-Brendan

9:15 pm on Jan 27, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 29, 2004
posts:194
votes: 0


This all depends on how the IMAP accounts are being authenticated. If they are authenticated straight to the OS user store, then it will be pretty hard (and very insecure) to set them up with PHP, if you are thinking of doing it as a web based thing.

However, if the users are stored in something else, like LDAP, MySQL, Postgres, or what have you, using PHP to add/edit/delete users should be a snap. In fact the mail server I set up uses MySQL as the user store, and writing a quick PHP app to allow users to add/edit/delete accounts and aliases to their domains was easy.

10:57 pm on Jan 27, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2004
posts:127
votes: 0


I want to make an option for members at my site to get email service. I was thinking about setting up a page that inserts all their email in to a mysql database and run a crontab on it. Is there a single function that can setup imap accounts, if so, what is it?
11:41 pm on Jan 27, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Apr 27, 2003
posts:243
votes: 0


If you have cpanel on a shared host, google your problem and you should get a good script/help. ;)
2:56 am on Jan 28, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2004
posts:127
votes: 0


I googled for tutorials and I can't find anything on php.net, if anyone has a link to a useful resource on the topic or knows the function that is used to create accounts so I can look it up on php.net, please let me know
7:09 am on Jan 28, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 3, 2003
posts:1633
votes: 0


Remember that you don't have to limit yourself to PHP internal functions; you can use the program execution [uk.php.net] functions to fire off shell scripts that can then perform any kind of automation task you want.

You do have to make sure that whatever user PHP sees the system as (quite often "apache") has permissions to do whatever your script needs to do.

5:09 pm on Jan 28, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 29, 2004
posts:194
votes: 0


Remember that you don't have to limit yourself to PHP internal functions; you can use the program execution functions to fire off shell scripts that can then perform any kind of automation task you want.

This is VERY dangerous to do in an application out in the open on the Internet. Never do system calls from PHP if you can help it, especially to add/edit/delete user accounts on a system!

As for the original question, brendan3eb, it looks like you need to do a little researching on how IMAP accounts work. It all depends on your set up, there is no one way it works on everything.

Adding e-mail addresses to a database and having a cron job run through it and add accounts to the system is probably the safest, that way it separates the end user from the actual function of adding an account. Like I mentioned before, adding an IMAP account to a system all depends on how your e-mail server is set up. Try to find out how to add a new IMAP account before choosing your method for allowing users to obtain new accounts from a web site.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members