aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-03-20 04:06:01 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-03-20 04:06:01 +0000
commit2b0003150336192d2c4dad77cdb9323d51141ebd (patch)
treec599b62c8961c340b9faf80c11f1e7b7d7e587fa
parent7bf1bb01833503664ae430814284ece388a3540a (diff)
downloadpfsense-packages-2b0003150336192d2c4dad77cdb9323d51141ebd.tar.gz
pfsense-packages-2b0003150336192d2c4dad77cdb9323d51141ebd.tar.bz2
pfsense-packages-2b0003150336192d2c4dad77cdb9323d51141ebd.zip
* Add small vbscript to export all valid email addresses from a adsi / windows server installation
* Update url to point to new script name
-rw-r--r--packages/spamd_exchexp.asp50
-rw-r--r--packages/spamd_verify_to_address.php6
2 files changed, 53 insertions, 3 deletions
diff --git a/packages/spamd_exchexp.asp b/packages/spamd_exchexp.asp
new file mode 100644
index 00000000..56b0c629
--- /dev/null
+++ b/packages/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
diff --git a/packages/spamd_verify_to_address.php b/packages/spamd_verify_to_address.php
index 3887a81d..6da3336e 100644
--- a/packages/spamd_verify_to_address.php
+++ b/packages/spamd_verify_to_address.php
@@ -29,7 +29,7 @@ require("config.inc");
require("functions.inc");
/* path to script that outputs c/r seperated e-mail addresses */
-$server_to_pull_data_from = "http://10.0.0.11/exchexp.asp";
+$server_to_pull_data_from = "http://10.0.0.11/spamd_exchexp.asp";
/* to enable debugging, change false to true */
$debug = true;
@@ -39,10 +39,10 @@ if($debug)
/* fetch down the latest list from server */
if($debug) {
/* fetch without quiet mode */
- exec("fetch -o /tmp/emaillist.txt {$server_to_pull_data_from}");
+ system("fetch -o /tmp/emaillist.txt {$server_to_pull_data_from}");
} else {
/* fetch with quiet mode */
- exec("fetch -q -o /tmp/emaillist.txt {$server_to_pull_data_from}");
+ system("fetch -q -o /tmp/emaillist.txt {$server_to_pull_data_from}");
}
/* test if file exists, if not, bail. */