Importing and exporting Exchange Server 2003 sender filters

Exchange 2003's sender filtering lets you specify who can and can't send email from your organization. Learn how you can import or export a copy of your Exchange server's sender filters to reuse somewhere else or to just have on hand for reference.

Exchange Server 2003's sender filtering is a helpful feature that lets you specify who can and can't send email

from within your organization.

VIEW MEMBER FEEDACK TO THIS EXCHANGE SERVER TIP
It does have some limitations though -- it only stores about 800 addresses and can't be easily imported or exported from Exchange Server.

If you've ever wanted to export a copy of your Exchange Server's sender filters and reuse them somewhere else, or just have a copy on hand for reference, these limitations can be frustrating.

Exchange Server guru Brian Desmond has come with a way to import and export a list of filtered sender domains in Exchange 2003. I've reprinted his techniques here in detail with his permission.

To export:

From a command prompt or batch file, run the following command:


ldifde -m -f senderfilter.ldf -r "(objectCategory=msExchSMTPTurfList)" 
-d "cn=configuration,dc=yourdomain " -l msExchTurfListNames

For this to work in your organization, you'll need to replace dc=yourdomain with your own domain's address. For instance, if your domain for this Exchange server is utena.ohtori.org, you'd render this as dc=utena,dc=ohtori,dc=org. For a local address like myserver.local, use dc=myserver,dc=local.

The results will be exported to a file named senderfilter.ldf, which can be read in any text file.

To import:

If you're importing this list into a new domain, edit the senderfilter.ldf file and replace each dc=domain instance with the proper domain description as outlined above. Then use this command to import the file:


ldifde -i -f senderfilter.ldf

If you're using this to copy lists to many domains, you can replace the domain references in the file with dc=x and use the command:


ldifde -i -f senderfilter.ldf –c dc=x dc=targetdomain,dc=local

The enumeration for the domain name you're copying to is dc=targetdomain,dc=local, which allows you to keep the file in one consistent format and only make the changes needed when supplying the import command.

More Microsoft Exchange tips and resources:

Prevent Exchange Server 2003 users from sending or receiving Internet email

Securing email messages with Outlook 2003's Information Rights Management feature

Microsoft Exchange administration tools and downloads

Microsoft Exchange Server 2003 Reference Center

Note that if you import a list of filtered senders to an Exchange server that already has such a list, the results will be merged and not replaced. In other words, any existing filtered senders will be kept, and the ones listed in the file will be added.

About the author: Serdar Yegulalp is editor of Windows Insight.

MEMBER FEEDBACK TO THIS EXCHANGE TIP

Exporting senderfilter isn't a problem, but importing is.

I use this command for export:

ldifde -m -f senderfilter.ldf -r "(objectcategory=msexchsmtpturflist)" -d "cn=configuration,dc=interlogica,dc=nl" -l msexchturflistnames

Now I get a senderfilter.ldf file. I can modify it and would like to import this on the same server.

I use this command for import:

ldifde -i -f senderfilter.ldf -r "(objectcategory=msexchsmtpturflist)" -d "cn=configuration,dc=interlogica,dc=nl" -l msexchturflistnames

However, this is not working.

I didn't modify the *.ldf file because it's the same server.

Can you tell me what's going wrong?
—Addy L.

******************************************

From what I can tell, the import command you're using is not in the right format. To import you just need to say:

ldifde -i -f senderfilter.ldf

The other options aren't needed.
—Serdar Yegulalp, tip author

******************************************

When I use ldifde -i -f senderfilter.ldf, I get the following messages:

Connecting to "server.domain.com"

Logging in as current user using SSPI

Importing directory from file "senderfilter.ldf"

Loading entries

There is a syntax error in the input file. Failed on line 1. The last token starts with '"'.
0 entries modified successfully. An error has occurred in the program
No log files were written. In order to generate a log file, please specify the log file path via the -j option.

Any help would be great.
—Ryan J.

******************************************

It's possible that the exported file was edited and then saved, but its codepage (UTF-8 vs. ASCII) was not retained when it was saved. Perhaps you should try using a different text editor and see if that helps.
—Serdar Yegulalp, tip author

Do you have comments on this tip? Let us know.

Please let others know how useful this tip was via the rating scale below. Do you have a useful Exchange Server or Microsoft Outlook tip, timesaver or workaround to share? Submit it to SearchExchange.com. If we publish it, we'll send you a nifty thank-you gift.

This was first published in June 2006

Dig deeper on Microsoft Exchange Server Administration Tools

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWindowsServer

SearchEnterpriseDesktop

SearchCloudComputing

SearchSQLServer

Close