Monthly Archive for July, 2006

Backing up your BES

There are 2 utilities on the BES CD for backing up the BES. blackberrybackup.exe for backing up the config to a text file, and blackberrydbbackup.exe for taking care of the database. These can be scripted in a batch file and run using task scheduler, and then you can let your nightly tape backups pick up the files.

The blackberrydbbackup utility will produce a .bak file that is roughly the same size as your database, so if you don't clean these files up regularly you will notice your disk space diminish as your backup folder grows massive in size. To counter this I wanted to add a bit at the end of my backup script that would delete files older than a certain age. I found many, many long and complicated scripts that would do this, using if and for statements and masses of variables. I also found vbscripts pages long for doing this but I kept looking for something simple, because I recently looked into how to script this sort of thing using Unix commands (and blogged about it), and I was sure there would be a way using "command prompt" (DOS) commands that would be equally as short and elegant.

I discovered a new command for this called forfiles. Here's the syntax I used:

forfiles /m *.bak /D -6 /C “cmd /c del @file”

The /m switch specifies the search criteria. If you do not use /m it will default to *. The /D -6 is number of days, 6 days old in this instance. The /C switch will execute a command which you need to place inside double quotes. The @file variable in the example represents each file in the search results.

Here's the complete script:

e:
cd\backup

blackberrybackup.exe -b -o e:\backup\S86_backup.txt -y -w s05010086 -n s05010086 -m "BlackBerryServer"
blackberrydbbackup.exe -d BESMgmt -E -p -f e:\backup\

For /f "tokens=1-4 delims=/ " %%a in ('date /t') do SET mdate=%%c%%b%%a
rename E:\backup\S86_backup.txt e:\backup\%mdate%S86_backup.txt

echo Finished.

rem ** Cleanup old files **
forfiles /m *.bak /D -6 /C "cmd /c del @file"
forfiles /m *.txt /D -6 /C "cmd /c del @file"

Technorati Tags: , ,

Using MIMESweeper and LDAP address lists to only allow valid recipients

MIMESweeper for SMTP (5.2) can be configured to only accept a message at your mail gateway if the e-mail address exists in your organisation. This is done by creating an LDAP address list and ensuring all mail enabled objects in your Active Directory are added to the list. Then in your MIMESweeper policy, you can configure the list as a Relay Target in the Anti-Relay settings so that mail from external hosts will only be delivered if the recipient is a member of the list. Depending on your mail throughput, implementing this could relieve a lot of the load on your Exchange system and MIMESweeper quarantine areas by cutting out all the junk mails associated with directory harvesting attacks, and all the NDR's which bounce back because the original recipient doesn't exist.

The caveat that prevented us from implementing this in my last company was we had an oversize public folder structure with thousands of mail enabled public folders, a lot of which had additional SMTP addresses. How to you create the LDAP query to add all of these to the LDAP address list? Here is the solution. If you select the View | "Advanced Features" option in Active Directory Users and Computers, you will see the Microsoft Exchange System Objects OU appears. This OU is dynamically updated and contains all Public Folders. In your MIMESweeper Address List, you can simply add a search criteria pointing to this folder, like so:

Full DN: cn=microsoft exchange system objects,dc=xxx,dc=yourdomain,dc=com
Class: objectclass=*
Attributes: mail,proxyAddresses

Technorati Tags: , , , , ,