OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Rewrite 'Date' header to include timezone?

From: Noel Jones (njonesmegan.vbhcs.org)
Date: Mon Apr 02 2007 - 14:06:16 CDT


At 01:26 PM 4/2/2007, Wietse Venema wrote:
>David Hoekman:
> > I need Postfix to relay mail generated by legacy software (i.e.
> > inflexible & hard to change) which sends a 'Date' header that
> > lacks timezone information, e.g. this:
> > Date: Mon, 1 Apr 2007 09:15:00
> >
> > instead of this:
> > Date: Mon, 1 Apr 2007 09:15:00 -0800 (PDT)
> >
> > The problem with this is that in the absence of a specific timezone,
> > mail clients typically show this as having been sent from GMT,
> > which can make the chronology of mail exchanges hard to follow.
> >
> > If no 'Date' header were present, I know that Postfix would add
> > a correct one, but how can I rewrite an existing one? Or is it
> > possible to delete the one supplied?
>
>You need to somehow delete the Date: in mail from this app.
>
>Possibilities:
>
>- Use a perl script as proxy (like http://bent.latency.net/smtpprox/)
>between the application and Postfix,
>
>- Patch the executable file and change Date into Dxyz, then use
>Postfix header_checks to remove it.
>
>- Jump a lot of hoops with alternate cleanup servers or special
>FILTER actions that I won't even attempt to describe.
>
> Wietse

It may be reasonable to remove/rewrite Date: headers that lack
required zone offset information, and let postfix add a corrected
Date: header using the local time. This would apply to all mail, but
only those messages with an invalid Date: header would be altered.

# header_checks
/^(Date: .* [+-][0-9]{4})$/ REPLACE X-$1

--
Noel Jones