Update 23 June 2008: See The official way to change MSCRM ports
for an official way to do this. Update 12 March 2008:
After you get MSCRM 4.0 up and running (install or upgrade) on your system with a custom host header you may find that workflow doesn't work (or flow), imports sit in a submitted state forever, the email router and outlook client cannot connect to the MSCRM server. This could also happen if you change the website details in IIS. What is happening is even though you access your server on a specific URL, internally in the Async service (which handles the workflow, duplicate detectionand imports) and the email router and outlook client actually just use the URL you used to connect to the Discovery Service.
The discovery service is a web service which gives back the real URL to the web services in MSCRM, so if you changed IIS it still gives back the old ones. There is also a bug in the RTM of MSCRM 4.0 which causes it to use the machine name instead of the host header after upgrades. So you go to http://<nice name>
and the discovery service gives back to http://<machine name>/mscrmservices/2007/crmservice.asmx
which doesn't exist since yourhost headers should have it as http://<nice name>/mscrmservices/2007/crmservice.asmx
You can pick this up using fiddler on the email server or desktop machine when trying to configure the email router or outlook client respectively. So I went though this with Microsoft PSS and they came back with a SQL command you can run to fix this.
NOTE: As this is a DB change it is unsupported. If you are a little worried about the impact do backups then try it. If you are very worried contact PSS directly for help.
Update DeploymentProperties SET NVarCharColumn = '<server>:<port>' WHERE ColumnName= 'AsyncSdkRootDomain'
Update DeploymentProperties SET NvarCharColumn = '<server>:<port>' WHERE ColumnName = 'ADSdkRootDomain'
Update DeploymentProperties SET NvarCharColumn = '<server>:<port>' WHERE ColumnName = 'ADWebApplicationRootDomain'
Example, if your server is called: myserver and runs on port 50000
Update DeploymentProperties SET NVarCharColumn = 'myserver:50000' WHERE ColumnName= 'AsyncSdkRootDomain'
Update DeploymentProperties SET NvarCharColumn = 'myserver:50000' WHERE ColumnName = 'ADSdkRootDomain'
Update DeploymentProperties SET NvarCharColumn = 'myserver:50000' WHERE ColumnName = 'ADWebApplicationRootDomain'
Once done do an IISReset and restart the Async service and everything should start to work fine! As I said before this came from PSS (in particular Justin Thorp)and I would really like to thank him for the hard workand great responses I got on it.