200分悬赏:免费邮件系统的关键一步如何实现?

for123 2000-06-12 01:56:00
在开发一个形如263.net的免费邮件系统时有个帐户申请处理的问题:
一般要增加一个帐户是这样的:
NT域内用户设置邮箱:
  进入“Microsoft Exchange Administrator”后,在“File”菜单中,指向“New Mailbox”,出现邮箱属性窗口,单击“Primary Windows NT Account”,选择“Select an existing Windows NT account”,为NT域内用户逐一添加邮箱。
 但是:
像263.net的邮箱从申请到可以使用,肯定有一个程序处理申请邮箱,不会是手工添加帐户,对吧?如果是这样的话,用什么程序实现帐户添加到 Exchange Server的Account帐户中去呢,从而使这个帐户从申请到立即成为可以使用?



  
...全文
462 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
robo 2000-06-20
  • 打赏
  • 举报
回复
所有的工作都是自己编程实现的,登录帐号并不使用NT或者ExchangeServer的,
而是自己管理,POP3的使用CGI管理,至于开户和建立用户主机虚拟目录由程序
实现。微软的IIS就提供了一整套的工具和范例,如果你注意的话可以在Administrator
Tools里找到,这是一个给用户开Web目录的VB SCRIPT例子,如果要使用VC来开发相应的
管理,可参考:
'---------------------------------------------------------------------------------------------------
' This function creates a virtual web directory on the specified web site
' and with the specified path
'
'mkwebdir [--computer|-c COMPUTER1, COMPUTER2, COMPUTER3]
' <--website|-w WEBSITE>
' <--virtualdir|-v NAME1,PATH1,NAME2,PATH2,...>
' [--help|-?]
'
'COMPUTER Computer on which users exists
'WEBSITE1,WEBSITE2 Virtual Web Sites on which directories will be created
'NAME1,PATH1,NAME2,PATH2 Virtual Directories names and paths to create
'
'Example 1 mkwebdir -c MyComputer -w "Default Web Site"
' -v "Virtual Dir1","c:\inetpub\wwwroot\dir1","Virtual Dir2","c:\inetpub\wwwroot\dir2"
'
'---------------------------------------------------------------------------------------------------


' Force explicit declaration of all variables.
Option Explicit

On Error Resume Next

Dim oArgs, ArgNum

Dim ArgComputer, ArgWebSites, ArgVirtualDirs, ArgDirNames(), ArgDirPaths(), DirIndex
Dim ArgComputers

Set oArgs = WScript.Arguments
ArgComputers = Array("LocalHost")

ArgNum = 0
While ArgNum < oArgs.Count

If (ArgNum + 1) >= oArgs.Count Then
Call DisplayUsage
End If

Select Case LCase(oArgs(ArgNum))
Case "--computer","-c":
ArgNum = ArgNum + 1
ArgComputers = Split(oArgs(ArgNum), ",", -1)
Case "--website","-w":
ArgNum = ArgNum + 1
ArgWebSites = oArgs(ArgNum)
Case "--virtualdir","-v":
ArgNum = ArgNum + 1
ArgVirtualDirs = Split(oArgs(ArgNum), ",", -1)
Case "--help","-?"
Call DisplayUsage
End Select

ArgNum = ArgNum + 1
Wend

ArgNum = 0
DirIndex = 0

ReDim ArgDirNames((UBound(ArgVirtualDirs)+1) \ 2)
ReDim ArgDirPaths((UBound(ArgVirtualDirs)+1) \ 2)

if isArray(ArgVirtualDirs) then
While ArgNum <= UBound(ArgVirtualDirs)
ArgDirNames(DirIndex) = ArgVirtualDirs(ArgNum)
If (ArgNum + 1) > UBound(ArgVirtualDirs) Then
WScript.Echo "Error understanding virtual directories"
Call DisplayUsage
End If
ArgNum = ArgNum + 1
ArgDirPaths(DirIndex) = ArgVirtualDirs(ArgNum)
ArgNum = ArgNum + 1
DirIndex = DirIndex + 1
Wend
end if

If (ArgWebSites = "") Or (IsArray(ArgDirNames) = False or IsArray(ArgDirPaths) = False) Then
Call DisplayUsage
Else
Dim compIndex
for compIndex = 0 to UBound(ArgComputers)
Call ASTCreateVirtualWebDir(ArgComputers(compIndex),ArgWebSites,ArgDirNames,ArgDirPaths)
next
End If

'---------------------------------------------------------------------------------
Sub Display(Msg)
WScript.Echo Now & ". Error Code: " & Hex(Err) & " - " & Msg
End Sub

Sub Trace(Msg)
WScript.Echo Now & " : " & Msg
End Sub

Sub DisplayUsage()
WScript.Echo "Usage: mkwebdir [--computer|-c COMPUTER1,COMPUTER2]"
WScript.Echo " <--website|-w WEBSITE1>"
WScript.Echo " <--virtualdir|-v NAME1,PATH1,NAME2,PATH2,...>"
WScript.Echo " [--help|-?]"

WScript.Echo ""
WScript.Echo "Note, WEBSITE is the Web Site on which the directory will be created."
WScript.Echo "The name can be specified as one of the following, in the priority specified:"
WScript.Echo " Server Number (i.e. 1, 2, 10, etc.)"
WScript.Echo " Server Description (i.e ""My Server"")"
WScript.Echo " Server Host name (i.e. ""www.domain.com"")"
WScript.Echo " IP Address (i.e., 127.0.0.1)"
WScript.Echo ""
WScript.Echo ""
WScript.Echo "Example : mkwebdir -c MyComputer -w ""Default Web Site"""
WScript.Echo " -v ""dir1"",""c:\inetpub\wwwroot\dir1"",""dir2"",""c:\inetpub\wwwroot\dir2"""

WScript.Quit
End Sub
'---------------------------------------------------------------------------------


Sub ASTCreateVirtualWebDir(ComputerName,WebSiteName,DirNames,DirPaths)
Dim Computer, webSite, WebSiteID, vRoot, vDir, DirNum
On Error Resume Next

set webSite = findWeb(ComputerName, WebSiteName)
if IsObject(webSite) then
set vRoot = webSite.GetObject("IIsWebVirtualDir", "Root")
Trace "Accessing root for " & webSite.ADsPath
If (Err <> 0) Then
Display "Unable to access root for " & webSite.ADsPath
Else
DirNum = 0
If (IsArray(DirNames) = True) And (IsArray(DirPaths) = True) And (UBound(DirNames) = UBound(DirPaths)) Then
While DirNum < UBound(DirNames)
'Create the new virtual directory
Set vDir = vRoot.Create("IIsWebVirtualDir",DirNames(DirNum))
If (Err <> 0) Then
Display "Unable to create " & vRoot.ADsPath & "/" & DirNames(DirNum) &"."
Else
'Set the new virtual directory path
vDir.AccessRead = true
vDir.Path = DirPaths(DirNum)
If (Err <> 0) Then
Display "Unable to bind path " & DirPaths(DirNum) & " to " & vRootName & "/" & DirNames(DirNum) & ". Path may be invalid."
Else
'Save the changes
vDir.SetInfo
If (Err <> 0) Then
Display "Unable to save configuration for " & vRootName & "/" & DirNames(DirNum) &"."
Else
Trace "Web virtual directory " & vRootName & "/" & DirNames(DirNum) & " created successfully."
End If
End If
End If
Err = 0
DirNum = DirNum + 1
Wend
End If
End If
else
Display "Unable to find "& WebSiteName &" on "& ComputerName
End if
Trace "Done."
End Sub

function getBinding(bindstr)

Dim one, two, ia, ip, hn

one=Instr(bindstr,":")
two=Instr((one+1),bindstr,":")

ia=Mid(bindstr,1,(one-1))
ip=Mid(bindstr,(one+1),((two-one)-1))
hn=Mid(bindstr,(two+1))

getBinding=Array(ia,ip,hn)
end function

Function findWeb(computer, webname)
On Error Resume Next

Dim websvc, site
dim webinfo
Dim aBinding, binding

set websvc = GetObject("IIS://"&computer&"/W3svc")
if (Err <> 0) then
exit function
end if
' First try to open the webname.
set site = websvc.GetObject("IIsWebServer", webname)
if (Err = 0) and (not isNull(site)) then
if (site.class = "IIsWebServer") then
' Here we found a site that is a web server.
set findWeb = site
exit function
end if
end if
err.clear
for each site in websvc
if site.class = "IIsWebServer" then
'
' First, check to see if the ServerComment
' matches
'
If site.ServerComment = webname Then
set findWeb = site
exit function
End If
aBinding=site.ServerBindings
if (IsArray(aBinding)) then
if aBinding(0) = "" then
binding = Null
else
binding = getBinding(aBinding(0))
end if
else
if aBinding = "" then
binding = Null
else
binding = getBinding(aBinding)
end if
end if
if IsArray(binding) then
if (binding(2) = webname) or (binding(0) = webname) then
set findWeb = site
exit function
End If
end if
end if
next
End Function
marijuana 2000-06-13
  • 打赏
  • 举报
回复
有关邮件系统的问题,请看专门的网站 http://webtech.sczg.com
开放webmail计划。
yanghong 2000-06-13
  • 打赏
  • 举报
回复
in linux, you may use c to write some code, like below
--
setuid(0);
sprintf(cmd, "/usr/sbin/useradd -g %s %s 1>/dev/null 2>/dev/null", cGroup, cUser);
if(system(cmd))
sprintf(cmd, "/usr/bin/passwd --stdin %s 1>/dev/null 2>/dev/null << !%c%s%c!", cUser, 10, cPassword, 10);
if(system(cmd))
{
return 0;
}
}
else
return -1;

it can implement new mail account

july 2000-06-13
  • 打赏
  • 举报
回复
我也很想知道问题的答案
stellaxyq 2000-06-13
  • 打赏
  • 举报
回复
可以把在LINUX上实现的具体方法讲一下吗?
hpboy 2000-06-12
  • 打赏
  • 举报
回复
基于exchange的免费邮件系统~~我权大家还是不要尝试了~~性能是在让人不敢恭维~~
而263.net也不是基于exchange的~~呵呵~~linux下的~~我实现了~~现在就是在LDAP上
有点麻烦~~不知哪位仁兄能帮帮忙~~呵呵~~讨论一下吗~~呵呵~~关于LDAP的实现~~
w102272 2000-06-12
  • 打赏
  • 举报
回复
如果是我做的话,实现要研究一下exchange的用户管理模型,找一些相关的API。
然后编写一个服务端的组件做请求用。最后写一堆ASP的代码透过这个服务器组件来操纵exchange server.大概就完成目的了吧。
只是我可没有任何资料,我也很希望写一个263.net
jiangtao 2000-06-12
  • 打赏
  • 举报
回复
263.net的邮件系统用的是网易自行开发的,不是Exchange Server
gaoyan88 2000-06-12
  • 打赏
  • 举报
回复
我也很想知道问题的答案

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧