I too am getting the 31506 error, but mail flow is fine, and I have no other issues with TMG or Exchange. I have even tried disabling edge sync, reapplying the policy at the exhange server and enabling edge sync again as a work around posted here:
Michael R. Mastro II