|P is for Practical|
Programmatically Adding E-Mail Accountsby rjahrman (Scribe)
|on Sep 15, 2004 at 05:04 UTC||Need Help??|
rjahrman has asked for the
wisdom of the Perl Monks concerning the following question:
I have a shared hosting account (cPanel, with SSH), and I want to programmatically add e-mail accounts that can receive e-mails and then be checked via POP3. I don't care about webmail, spam protection, outgoing mail, or anything else. I just want to add an account, then put ftp.domain.com as the POP3 server in Outlook/Thunderbird/whatever with the account's username and password and to have it get e-mails sent to email@example.com.
So, I assume that this is done by system calls. As far as I know, I need to do:
Adduser username -g mail
Is this all? Should I then be able to send e-mails to firstname.lastname@example.org and get e-mails in a client? Since it's a shared host, do I somehow need to compensate for that? (Will the e-mails sent to my domain end up at the right users? Are the users created server-wide, or just from my account?) Will this work with the existing daemon?
Thanks in advance.
BTW: Supposedly I could also hack a cPanel call, but this way is cooler. :) And I know that I shouldn't be doing this on a shared account, but I'm just playing around.