Using Nonmail Databases

While DIRSYNC is primarily used to synchronize an organization's directories, it can also be configured to synchronize the address book changes for a nonmail database. For example, a company could develop a DIRSYNC agent that automatically creates Microsoft Exchange mailboxes for new employees when their records are entered into the Human Resources database.

DIRSYNC is designed to export from or import to a standard file. However, you can change the DIRSYNC source to export to a database or to pass information to a foreign mail system's DLL instead of to a text file. To do this, you must rewrite the DIRSYNC source file functions that open, close, and read from or write to a file. The export functions include HrOpenExport, HrWriteExport, and HrCloseExport. The import functions are HrOpenImport, HrReadImport, and HrCloseImport. These functions are defined in the DSYNCOMM.C source file.

For example, you may be using the functions of a foreign mail system with a DLL that includes functions such as AddUsers or RemoveUsers. To automatically update the foreign system with DIRSYNC calls, you can change the HrWriteExport function to call the AddUsers function and add the specified users to the foreign system at that point, instead of writing the Add User information to a file. Likewise, the HrWriteExport function can call DeleteUsers and delete the specified users from the foreign system instead of writing the information to a file.