[dev] [imp-patch] invalid date headers

Jan Schneider jan at horde.org
Wed Jul 28 01:44:18 PDT 2004


Zitat von Francois Marier <francois at nit.ca>:

> Here's the situation I am trying to improve:  someone sends you an
> email with a broken mailer that either
>   1- puts junk in the Date header (e.g. using a non-standard format
> for the date and time)
>   or
>   2- doesn't put a Date line in the header at all
>
> In both cases, the current code detects the invalid date and display
> "Unknown Date" in the mailbox page.  This is very reasonable, however,
> an even better solution would be to guess the date from the "Received
> headers" like some email clients do.
>
> Since the date is returned by the imap_fetch_overview function, I
> wrote a wrapper function that will call this function and then fix the
> date if necessary.
>
> I wasn't sure exactly how to fit this in the current code so I chose
> an approach that changes very little existing code.

If we take this approach, this function should be made a method. But I'm not
convinced that this is a good idea, because this solution does an extra call
to the imap server to fetch the headers. This is probably not of a big
impact if you already use features like attachment icons or even message
previews. But it might on systems that are tuned for performance and have
all these features turned off.

Jan.

--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting.php


More information about the dev mailing list