Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

setting up e-mail accounts using cgi script

Posted on 1998-10-14
3
Medium Priority
?
152 Views
Last Modified: 2013-12-25
Hi,
   Is it possible to set up an e-mail account through a cgi script ? If so how ? System will be on UNIX O.S. If you need any further information, please ask.

Thanks in advance
0
Comment
Question by:somiya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 200 total points
ID: 1829088
It is but you don't want to do it within a CGI for a couple of reasons both of which concern security.

Firstly a CGI should always be run in an account with few privilages (often as nobody) so that any hack can't do to much damage. But to create an email account requires greater privilages and therefore the CGI can't do it.

Secondly by repeatedly hitting the CGI thousands of Email accounts could be created and thus killing you email system. Now you can avoid this by ensuring that each CGI call must be unique by including a non-predictive parameter within the call.

The only way in which you can really safely automate this is and overcome the lack of privilages is to have either a daemon program or a batch program that accepts the request from the CGI or from a file modified by the batch file and allow this program to create the entries within the email system. This program should be able to detect when excessive request have been made to prevent a DOS attack on your mail system.

How this final bit is done depends on the mail server involved and you will need to determine the command sequence needed depending on you mail server or directory server.

I would suggest that unless you anticpate doing a large number of accounts the better way would be simply email a webmaster and set the account up manually.

Sorry to be a bit negative but what you ask is not without significant problems.

Steve
0
 

Author Comment

by:somiya
ID: 1829089
Thanks a lot for that. The System will be on UNIX server and it is absolutely essential to set up the account through the script itself as this has to be done immediately on submission of form. So how do you suggest this should be done. What will the actual code in the CGI script be ? If you can guide me on this I will be happy.

Thanks in advance
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1829090
Basically you need to execute whatever command(s) that you would need to execute from the command prompt to create the account.


If this is a single command then the simplest way would be to form the command string with any parameters and then execute
the system command (in perl or C).

If there are more commands required then you will need to write the commands to a file as a script and then execute the script using the system command.

Now if you CGI is restricted as it should be then the execution will fail. Therefore you would need to have another program running that monitors for the creation of the file and when it sees it executes it.

The alternative is that the CGI communicates with such a program via pipes to transmit the data to the other program which executes the command(s).

The actual code depends on what language is involved and what commands are needed to create the account. I would suggest that if you can workout the commands to create the account then it wouldn't be too differcult to work the rest of it out.

Steve
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question