Stopping Emails attaching to Deals after certain stage / date

How can we stop emails being attached to deals, after those deals are no longer active?