To connect MS Outlook to Exchange through a Firewall you need to do the following,
The following ports must be open
TCP Port 25 SMTP
TCP Port 143 IMAP4
Now the problem is RPC exchange server do a lot of connections over high port numbers that will be blocked on your firewall, you need to manually configure Exchange to use specific port numbers.
To do this you need to make some registry changed on the exchange box,
NOTE you can use any port number you like (above 1024) for the purpose of this exercise Ill use Ports 1026 to 1029
On the Exchange Box
Start > Run > Regedit {enter}
Navigate to the following keys and create the following entries
HKEY_LOCAL_MACHINE\SYSTEM\
CurrentCon
trolSet\Se
rvices\MSE
xchangeSA\
Parameters
Value name: TCP/IP Port
Value type: REG_DWORD
Value data: 1026
And
Value name: TCP/IP NSPI Port
Value type: REG_DWORD
Value data: 1027
Now Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\
CurrentCon
trolSet\Se
rvices\MSE
xchangeIS\
Parameters
System
Value name: TCP/IP Port
Value type: REG_DWORD
Value data: 1028
Now Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\
CurrentCon
trolSet\Se
rvices\MSE
xchangeSRS
\Parameter
s
Value name: TCP/IP
Value type: REG_DWORD
Value data: 1029
Now you MUST reboot the Exchange server
Open the following ports on the firewall
TCP 1026, 1027, 1028 and 1029
Ref:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q270836