Solved

setting up e-mail accounts using cgi script

Posted on 1998-10-14
3
146 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to count occurrences of each item in an array.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

803 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