|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Aaron Wolfe (aawolfe
gmail.com)
Date: Tue Dec 18 2007 - 13:17:50 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
A really simple way to dump the exchange users is with a little vb script.
The one below will give you a csv file in the root of C: called
exchangeusers.csv. You can then do a little voodoo on it to create your
postfix users. Not great if you're adding and removing users often, but
maybe it would help.
Dim rootDSE, domainObject
Set rootDSE=GetObject("LDAP://RootDSE")
DomainContainer = rootDSE.Get("defaultNamingContext")
Set fs = CreateObject ("Scripting.FileSystemObject")
Set userFile = fs.CreateTextFile ("c:\exchangeusers.csv")
Set conn = CreateObject("ADODB.Connection")
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"
ldapStr = "<LDAP://" & DomainContainer & ">;(&(&(& (mailnickname=*) (|
(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(objectCategory=group)
))));adspath;subtree"
Set rs = conn.Execute(ldapStr)
While Not rs.EOF
Set oUser = GetObject (rs.Fields(0).Value)
userFile.Write oUser.displayName & "," & oUser.sAMAccountName & ","
for each email in oUser.proxyAddresses
userFile.Write email & ","
next
userFile.WriteLine ""
rs.MoveNext
Wend
On Dec 18, 2007 2:04 PM, Damian Rivas <damian
cht.com.ar> wrote:
> Hi there people, I have an internal MS Exchange Server 2003 on a Windows
> 2003 and a Linux Slackware 9 mail filter/relay server on the outside.
>
> The mail filtering server uses Postfix as MTA. I'm interested and I know
> there's a way to build a list of valid mail addresses from my Exchange
> Server and use it on postfix to validate recipients, so I can prevent the
> NDR Messages and Backscattering from the outside. Currently I've configured
> the Exchange to send a 550 error response if the recipient is not a valid
> one on the AD database.
>
> I know there is a way to trigger an LDAP query to the Exchange from the
> Linux Server, but I'm not sure how to do it and what's the best option in
> this kind of situations.
>
> A useful data for you gurus: The AD database is kind of static, it is
> rarely updated, so there are no needs to execute again and again a script to
> get the valid mail addresses. I just need a simple solution just to get a
> list of mails when it is necessary.
>
> I'd appreciate your help!
> Thanks in advance
>
> Regards!
> Damián
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]