?
Solved

setting up e-mail accounts using cgi script

Posted on 1998-10-14
3
Medium Priority
?
150 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
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 the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Suggested Courses

762 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