Solved

setting up e-mail accounts using cgi script

Posted on 1998-10-14
3
144 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
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
mouatts earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
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 …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now