• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

How would I let users sign up for pop3 accounts?

CHR1S

New Member
Could I possibly have users sign up for pop3 accounts on a webspace account with unlimited pop3 accounts? I haven't chosen a paid hosting service yet, but I have seen alot with unlimited pop3 accounts. I want people to automatically be able to sign up for them. Thanks for any help.
-Chris
 
The host I'm with, one of the members has made a script that allows this (it will work on any host using CPanel), but I think the script is only for clients of this particular host. But, it is possible...I think there might be some scripts out there that will work...
 
Try this,

It should work, if not just modify small bits of it :)

Dont forget to set your path.
And username/password for this test.

You can add an ?username=blabla&Password=blabla argument to this code using what yupapa posted a few posts back "cgi arguments"

Here's the bare code:

Code:
#!/usr/bin/perl

# Main path to users account
$home_directory	= "PATH"; #/home/username

# Mailbox path
$mail_path = $home_directory . "/mail";

# This directory is where the passwd and shadow files are stored
$p_directory = $home_directory . "/etc";

$html_content_header = "Content-type: text/html\n\n";

$newuser = "USERNAME";
$usrPassword = "PASSWORD";

print $html_content_header;
&CreateNewUser;


# Function to create a new user
sub CreateNewUser {
    mkdir ("$mail_path/$newuser",0770) or die "Could not create directory $mail_path/$newuser. $!";
    mkdir ("$mail_path/$newuser/uploads",0770) or die "Could not create directory $mail_path/$newuser/uploads. $!";
    mkdir ("$mail_path/$newuser/addressbook",0770) or die "Could not create directory $mail_path/$newuser/addressbook. $!";

	# one handle to read file data
	open(MAILFILE, "$p_directory/passwd") or die "Cant access file";
	open(SHADOWFILE, "$p_directory/shadow") or die "Cant access file";

	#another handle to write data
	open(MAILFILE2, ">>$p_directory/passwd") or die "Cant access file";
	open(SHADOWFILE2, ">>$p_directory/shadow") or die "Cant access file";
	
	# get the users and store in array in reverse order
	@lines = reverse <MAILFILE>;

	foreach $line (@lines) {
		if ($line =~ /$newuser/) {
			print "User already exists";
			exit;
		}
	}

	#get this line from your passwd file just duplicate it as passwords are stored in the shadow file
	print MAILFILE2 "$newuser:x:xxxxx:xxx::$home_directory:/bin/bash\n";

	#this is the important file
	print SHADOWFILE2 "$newuser:" . crypt($usrPassword, $usrPassword) . ":::::::\n";

	close(MAILFILE);
	close(SHADOWFILE);
	close(SHADOWFILE2);
	close(MAILFILE2);
}


BUT, keep in mind that you have a maximim email account number.
Check this out in your cpanel.
Email Accounts X / XXX
Be sure no more then XXX users will sign up or else you'll have to upgrade your plan (more $$$)

Don't forget also that their inbox space wastes your site's total available space. Same aaplies for bandwidth :)
 
Last edited:
There is no way you can do that unless you have full access to the server. The above script only works if you have root access, otherwise, any users will be able to delete or add any hosting accounts to the web server. :p You can try the script above, but i am very sure you will get a permission denied or lock passwd error when writing...

You can setup accounts manually from CPanel and install a web mail for your users to check email... that won't be a problem. :)
 
Last edited:
I have been looking for this too but I have little if any programing skills and I wan't to ask how can a person with unlimited POP3 and/or SMTH accounts use it for his website visitors as an email and provide email service. How can I use a webmail software(script) to let users signup and check their email. Could somebody give me a detailed explanation or give me a link where it is explained easily. :classic2:
 
I'm pretty sure it will all depend on your host, and the control panel they give you. I think to get a decent one, you might have to pay...
 
You could, and I would recomend it, just make the users fill in a form and then you can add accounts from your control panel. This way users don't sign up and in the end use up all your hard drive space becuause you can monitor it.
 
Originally posted by YUPAPA
There is no way you can do that unless you have full access to the server. The above script only works if you have root access, otherwise, any users will be able to delete or add any hosting accounts to the web server. :p You can try the script above, but i am very sure you will get a permission denied or lock passwd error when writing...

You can setup accounts manually from CPanel and install a web mail for your users to check email... that won't be a problem. :)
No yupapa.

Just make a script that deletes the files.

The files made by this script are marked as beeing made by PHP (or nobody:nobody I've heard)

Just use cpanel to delete the created accounts or make another php script that reverses.

I've used this and it worked like a charp to create the accounts and I used cpanel after to get rid of them.



It should work with all hosts since more are in this format:

/etc
/mail
/public_ftp
/public_html
/tmp
/www

and it needs access to /mail to create a folder _ /etc to add password entry. thats it.

Then just use your webmail or outlook or whatever
 
Last edited:
just remember that the actual space taken up by people's mail comes out of your webspace. So if a few dozen people start receving attachments or sign up for 500 spam emails/day watch out.
SMTP/POP3/IMAP traffic will also most certainly count towards you monthly transfer limit.
Besides all that I don't think your host will be too happy if you start up the next Hotmail on a shared hosting enviorment so you might want to check with them first as well before they run across it themselves.
 
ooooooooooooooooooooooooooooooooooh baby~ :p

I don't really have CPanel and I didn't know that...
THAT"S COOL, I maybe upgrade my CP to have that workin~ :)
 
Originally posted by abush
I have been looking for this too but I have little if any programing skills and I wan't to ask how can a person with unlimited POP3 and/or SMTH accounts use it for his website visitors as an email and provide email service. How can I use a webmail software(script) to let users signup and check their email. Could somebody give me a detailed explanation or give me a link where it is explained easily. :classic2:

Well it didn't seem like anyone answered your questions from before...so here goes.

I am a host myself, and I also offer "unlimited" pop 3 accounts, but the thing about it is, like everyone else said, it takes up bandwidth and space. So it's not really "unlimited", it's as much as your account could withstood.

Getting back to the point - to find a good webmail software you could use, try "Ubmail", i think that's pretty nice, or try hotscrtips.com and go under php scripts for great scripts you could use with mail. Dont' be afarid of php, it's a ton simpler than cgi scripts - sometimes all you have to really do is upload them.

Check them out - hope that helps.
 
Back
Top