Hi,
You could use something like this (quick and dirty example in python, to export all users, aliases and mailing lists from all domains and their domain aliases).
If you have many domains and mailboxes, this can take a while as it needs multiple different calls per domain. I haven't found a better way to do it.
The SM API badly need an unique query to export all valid targets for every domain/domain aliases for such usage as exporting them to incoming gateways.
Sébastien Riccio
System & Network Admin
https://swisscenter.com