A client is using the "deferred delivery" feature in Outlook / Exchange. For some reason this feature does preserve the original message creation time (i.e. when the user has hit the "send" button) as the RFC-822 Date: header, so even when the message's delivery is indeed "deferred", the headers still bear the evidence that it has been composed a while before delivery. My client would like to set the Date: header to the time when the message actually leaves the Exchange organization instead, so it would look like it had been composed and sent recently.
The idea to solve this is to set the Date: headers on all outgoing SMTP mail to the server's current time in an Exchange 2007 environment.
I know that I can set up a new-Transportrule with the -Action parameter set to Microsoft.Exchange.MessagingPolicies.Rules.Tasks.SetHeaderAction and define to replace "Date" with a different value. However, I cannot see a way to use a dynamic return value of function like Get-Date in there - at best the result of Get-Date gets converted to a static value it had when executing the new-Transportrule cmdlet.
A lambda expression / closure would perform the required function (i.e. not insert a static value but a function pointer and re-evaluate the expression on each run), but as I understand, Powershell does not support those.
An ugly workaround would be a very frequent redefinition (like once every minute) of the transport rule with the updated current time, but I would like to avoid this if a more elegant solution is available.
Any ideas on this?
Edit To give a short explanation on why the feature is used: the client wants to send mail containing a decision result which must not be public before a certain date. Addidionally, he also wants to conceal the date / time when the decision was met to prevent needless discussions.
This is actually a feature of the MUA (Outlook supports this out-of-the box), but server support is of course an added benefit as the mail would be sent even when the client is not running. There also is the problem: the MUA sets the "Date:" header upon message transmission to the server and the server does not change it upon release off the wait queue. There used to be two features in Outlook which performed a similar function - one was called "Deferred delivery", one was called "Deferred Submission". Obviously, the latter is what is neeed here, but it has been removed in Outlook 2000 and was never re-introduced - possibly because the Outlook team was trying to learn from Apple.