Scripting Thunderbird?

For a variety of reasons, I want to switch my default email application to Thunderbird. But, I have a requirement to change my default smtp port based on my location. In Entourage, I always used an applescript along with Location X to set the SMTP port for the servers accordingly… Thunderbird does not appear to have a dictionary.

Anyone have any luck scripting Thunderbird?

bump.