swiftmailer/swiftmailer — pull request #290 by leevigraham (2013-02-02 10:40:26+00:00)
Title: Conditionally save current recipients

* Swift_Plugins_RedirectingPlugin::beforeSendPerformed() does not check for the existence of headers before setting their X-Swift equivalent.
* Swift_Plugins_RedirectingPlugin::_restoreMessage_restoreMessage() does check if the X-Swift equivalent exists before restoring the actual header.

This leads to the possibility that although the cc and bcc headers were not originally set they will be set once the message is restored. This in turn leads to unexpected behaviour when checking for a headers existence with Swift_Mime_HeaderSet::has().

This patch checks for the existence of headers before setting their X-Swift equivalent.