Re: [exim] Fix a broken date header?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Ring, John C
CC: exim-users
Subject: Re: [exim] Fix a broken date header?
On Thu, 20 Jul 2006, Ring, John C wrote:

> Does anyone have any outlines on how I might use exim (version 4.52) to
> fix/replace a broken Date: header? The application in question is
> sending a date header in the format:
>
> Date: Wed, 19 07 06 12:54:28 -0500


It should be possible to do this in a system filter, using a regular
expression to match the broken format and fish out the actual date
parameters. You can then use "header remove" and "header add" to replace
the header line. Something like

  if $h_date: matches "...an appropriate regex..." then
    header remove Date
    header add "Date: something involving $1, $2, etc"
  endif     


Or something like that. Please check the manual for the exact syntax.

> As this application does send a unique X-Mailer: header and I already
> have the "submission/sender_retain" control option due to this very same
> vendor not providing Message-ID headers in previous versions of their
> software, I'm hoping I can use the following rough logic:
>
> if X-Mailer == "broken vendor" then remove Date header
>
> As long as I can do this before the control logic fires, it seems to me
> this would be the simplest solution, rather then adding logic to rewrite
> the broken header.


There's no way of removing headers in ACLs, so I don't think that would
work.

-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book