aboutsummaryrefslogtreecommitdiffstats
path: root/config/spamd/spamd_exchexp.asp
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-03-23 14:28:16 +0000
committerErmal <eri@pfsense.org>2010-03-23 14:28:16 +0000
commit57b1446ac5fb0fead3c545264978aa7896d28654 (patch)
treeca2ff760b21918913c8ff62fa6b4303b7f0efa7f /config/spamd/spamd_exchexp.asp
parentd56b96f7f9fd1ef61aa644ddcd4da6b65759e004 (diff)
downloadpfsense-packages-57b1446ac5fb0fead3c545264978aa7896d28654.tar.gz
pfsense-packages-57b1446ac5fb0fead3c545264978aa7896d28654.tar.bz2
pfsense-packages-57b1446ac5fb0fead3c545264978aa7896d28654.zip
Move all spamd functions to its folder.
Diffstat (limited to 'config/spamd/spamd_exchexp.asp')
-rw-r--r--config/spamd/spamd_exchexp.asp50
1 files changed, 50 insertions, 0 deletions
diff --git a/config/spamd/spamd_exchexp.asp b/config/spamd/spamd_exchexp.asp
new file mode 100644
index 00000000..56b0c629
--- /dev/null
+++ b/config/spamd/spamd_exchexp.asp
@@ -0,0 +1,50 @@
+<%
+
+dim server
+server = "SERVERNAME"
+
+Sub ExportUsers(oObject)
+ Dim oUser
+ For Each oUser in oObject
+ Select Case oUser.Class
+ Case "user"
+ If oUser.mail <> "" then
+
+ for each email in oUser.proxyAddresses
+ If (lcase(left(email,4))="smtp") Then
+ 'userFile.WriteLine Mid(email,6)
+ document.write Mid(email,6) & vbCrLf
+ End If
+ next
+ End if
+ Case "organizationalUnit" , "container"
+ If UsersinOU (oUser) then
+ ExportUsers(oUser)
+ End if
+ End select
+ Next
+End Sub
+
+Function UsersinOU (oObject)
+ Dim oUser
+ UsersinOU = False
+ for Each oUser in oObject
+ Select Case oUser.Class
+ Case "organizationalUnit" , "container"
+ UsersinOU = UsersinOU(oUser)
+ Case "user"
+ UsersinOU = True
+
+ End select
+ Next
+End Function
+
+Dim rootDSE, domainObject
+Set rootDSE=GetObject("LDAP://" & server & "/RootDSE")
+domainContainer = rootDSE.Get("defaultNamingContext")
+Set domainObject = GetObject("LDAP://" & domainContainer)
+
+ExportUsers(domainObject)
+Set oDomain = Nothing
+
+%> \ No newline at end of file