Changing Exchange 2007 receive connector timeout

Open Exchange Management Shell
Type in get-receiveconnector
This will list all of your receive connectors
Next type in
set-receiveconnector -identity ServerNameInternet -ConnectionTimeout 00:30:00
This command will change the timeout to 30 minutes.
Use this command to get all your receive connectors and change them all to 30 minutes
get-receiveconnector | set-receiveconnector -ConnectionTimeout 00:30:00

Problem with Gmail IMAP closed connection

Error in gmail that says IMAP server has closed connection.  The port configuration is 993.
Tools / Email Accounts / (your
account) / Change / More Settings / Advanced / Server Timeouts
Change this to 5 minutes