can any one explain how to do canonical mapping for the mail address not for the local domain but for the out side.

Ex- i want to send mail within the domain (example.com) without canonical mapping but when i send a mail to any other domain other than example.com should map to my canonical map rules.