Sandy,
Thanks for informing me about the LDIFDE utility. I plan on learning more
about it..... but, I'm having with the .bat file you sent.
I've copied the output from my screen:
C:\>address.bat
C:\>rem Substitute your real naming context for "dc=example,dc=local"
C:\>rem Note script logs into your current DC with your current account;
C:\>rem you can change this by using add'l LDIFDE options -s and -d
Deleting existing files...
Could Not Find C:\current_rcptlist.txt
Fetching initial LDAP dump...
Invalid Parameter: szFilter must follow -r
LDIF Directory Exchange
General Parameters
==================
-i Turn on Import Mode (The default is Export)
-f filename Input or Output filename
-s servername The server to bind to (Default to DC of computer's domain)
-c FromDN ToDN Replace occurences of FromDN to ToDN
-v Turn on Verbose Mode
-j path Log File Location
-t port Port Number (default = 389)
-u Use Unicode format
-w timeout Terminate execution if the server takes longer than the
specified number of seconds to respond to an operation
(default = no timeout specified)
-h Enable SASL layer encryption
-? Help
Export Specific
===============
-d RootDN The root of the LDAP search (Default to Naming Context)
-r Filter LDAP search filter (Default to "(objectClass=*)")
-p SearchScope Search Scope (Base/OneLevel/Subtree)
-l list List of attributes (comma separated) to look for
in an LDAP search
-o list List of attributes (comma separated) to omit from
input.
-g Disable Paged Search.
-m Enable the SAM logic on export.
-n Do not export binary values
-x Include deleted objects (tombstones)
Import
======
-k The import will go on ignoring 'Constraint Violation'
and 'Object Already Exists' errors
-y The import will use lazy commit for better performance
(enabled by default)
-e The import will not use lazy commit
-q threads The import will use the specified number of threads
(default is 1)
Credentials Establishment
=========================
Note that if no credentials is specified, LDIFDE will bind as the currently
logged on user, using SSPI.
-a UserDN [Password | *] Simple authentication
-b UserName Domain [Password | *] SSPI bind method
Example: Simple import of current domain
ldifde -i -f INPUT.LDF
Example: Simple export of current domain
ldifde -f OUTPUT.LDF
Example: Export of specific domain with credentials
ldifde -m -f OUTPUT.LDF
-b USERNAME DOMAINNAME *
-s SERVERNAME
-d "cn=users,DC=DOMAINNAME,DC=Microsoft,DC=Com"
-r "(objectClass=user)"
No log files were written. In order to generate a log file, please
specify the log file path via the -j option
'"(&(|(objectClass=group)(objectClass=user)(objectClass=msExchDynamicDistributionList))(proxyAddresses=*)(!(cn=SystemMailbox*)))"'
is not recognized as an internal or external command,
operable program or batch file.
'-p' is not recognized as an internal or external command,
operable program or batch file.
Massaging LDAP dump into list of e-mail addresses...
The syntax of the command is incorrect.
C:\>
[quoted text, click to view] "Sanford Whiteman" wrote:
> > Can someone point me to information on how to populate the rcptlist?
> > I have several hundred users.
>
> Fetching all the relevant e-mail addresses is a piece of cake using LDAP..
>
> For simplicity, I'm provided a few-line batch file that uses the built-in
> LDIFDE utility. You could also do this all within VBScript, PowerShell,
> etc.
>
> By way of intro, you want to get all the mail-enabled LDAP objects that
> are of three object classes (object types): dynamic distribution lists,
> regular distribution lists, and users. [You might under some
> circumstances wish to include contacts. Post back if you do.]
>
> For each object, you get its proxyAddresses attribute, which can hold
> multiple values for each of the object's mail aliases.
>
> You filter out the non-SMTP mail aliases.
>
> You exclude System Mailboxes.
>
> And that's about it!
>
> --Sandy
>
> ---BEGIN BATCH---
>
> rem Substitute your real naming context for "dc=example,dc=local"
> rem Note script logs into your current DC with your current account;
> rem you can change this by using add'l LDIFDE options -s and -d
>
> @echo off
>
> echo.
> echo Deleting existing files...
> del current_rcptlist.txt
>
> echo.
> echo Fetching initial LDAP dump...
> ldifde -d "dc=example,dc=local" -r
> "(&(|(objectClass=group)(objectClass=user)(objectClass=msExchDynamicDistributionList))(proxyAddresses=*)(!(cn=SystemMailbox*)))"
> -p subtree -l proxyAddresses -f ldifde.txt
>
> echo.
> echo Massaging LDAP dump into list of e-mail addresses...
> for /f "tokens=1,2,* delims=: " %%I in (ldifde.txt) do if /I "%%I
> %%J"=="proxyaddresses smtp" echo %%K>>current_rcptlist.txt
>
> echo.
> echo Done. Open current_rcptlist.txt to see results.
>
> ---END BATCH---
Sandy,
Thanks again for you kind help, I successfully registered the .dll and the
other tasks in the instructions and created the listing of email address
using your script and placed it with the prescan.txt in the required path.
I ran a group of tests against my server smtp2.sfopera.com and the first
test showed that I was missing postmaster@sfopera.org and after I added it
the text file the server tested fine so I thought it was working, But I still
can't deliver mesages to mailboxes with the text file in place.
With 5xxsink Installed without rcptlist.txt:
18:35:52 64.233.182.188 nf-out-0910.google.com 10.0.3.252 -
+FROM:<steverlong@gmail.com>
18:35:52 64.233.182.188 nf-out-0910.google.com 10.0.3.252 -
+TO:<slong@sfopera.org>
18:35:53 64.233.182.188 nf-out-0910.google.com 10.0.3.252 -
+<a0f4862c0708101136m38c376e5n8939205f667d03b6@mail.gmail.com>
18:35:53 10.0.0.15 OutboundConnectionResponse - -
220+sfomail.sfopera.net+Microsoft+ESMTP+MAIL+Service,+Version:+6.0.3790.3959+ready+at++Fri,+10+Aug+2007+11:35:53+-0700+
18:35:53 10.0.0.15 OutboundConnectionCommand - - smtp2.sfopera.com
18:35:53 10.0.0.15 OutboundConnectionResponse - -
250-sfomail.sfopera.net+Hello+[10.0.3.252]
18:35:53 10.0.0.15 OutboundConnectionCommand - - FROM:<steverlong@gmail.com>
18:35:53 10.0.0.15 OutboundConnectionResponse - -
250+2.1.0+steverlong@gmail.com....Sender+OK
18:35:53 10.0.0.15 OutboundConnectionCommand - - TO:<slong@sfopera.org>
18:35:53 10.0.0.15 OutboundConnectionResponse - - 250+2.1.5+slong@sfopera.org+
18:35:53 10.0.0.15 OutboundConnectionCommand - - 1990+LAST
Mail is delivered.
With 5xxsink Installed with rcptlist.txt:
NDR From GMAIL:
PERM_FAILURE: SMTP Error (state 13): 550 5.1.1 Unknown recipient
SMTP Logfile:
19:06:59 64.233.182.187 nf-out-0910.google.com 10.0.3.252 -
+nf-out-0910.google.com
19:06:59 64.233.182.187 nf-out-0910.google.com 10.0.3.252 -
+FROM:<steverlong@gmail.com>
19:07:00 64.233.182.187 nf-out-0910.google.com 10.0.3.252 -
+TO:<slong@sfopera.org>
19:07:00 64.233.182.187 nf-out-0910.google.com 10.0.3.252 -
nf-out-0910.google.com
Mail is nort delivered.
Any Ides were to look?
-Steve
[quoted text, click to view] "Sanford Whiteman" wrote:
> > Thanks for informing me about the LDIFDE utility. I plan on learning more
> > about it..... but, I'm having with the .bat file you sent.
>
> You have extra line breaks that must have crept in from the
> copy-and-paste. Two of the command lines are quite long, and you have
> them broken up instead of all on one line.
>
> The next line after the one beginning with 'LDIFDE' is 'echo.'
>
> Likewise, the next line after the one beginning with 'FOR' is 'echo.'
>
> Make sure there aren't any other line breaks in-between.
>
> --Sandy
[quoted text, click to view] > Mail is nort delivered.
> Any Ides were to look?
Ensure you have a PRESCAN.TXT and a RCPTLIST.TXT.
There aren't any known bugs of this sort.
I would warrant that you shouldn't be jumping through hoops to test
from an external account. Instead, just
telnet localhost 25
from the mailserver. Then, issue the command
EHLO
and follow it by checking some recipients with
RCPT TO:<name_in_rcptlist@domain_in_prescan>
[quoted text, click to view] > from the mailserver. Then, issue the command
> EHLO
Oops, make sure to follow RFC order. :)
MAIL FROM:<name@remote_domain>
Then RCPTs....
I found the problem...............
when I created the rcptlist the email address all ended with a space. After
I removed the space everything works :-)
I will need to remove the space I got into the script before this goes on
one of my production servers.
Thanks again for your help.
Steve Long
[quoted text, click to view] "Sanford Whiteman" wrote:
> > from the mailserver. Then, issue the command
>
> > EHLO
>
> Oops, make sure to follow RFC order. :)
>
> MAIL FROM:<name@remote_domain>
>
> Then RCPTs....
>
> --Sandy
Don't see what you're looking for? Try a search.