[Dovecot] SORT(DATE) and missing Date headers

Timo Sirainen tss at iki.fi
Tue Sep 25 18:26:42 EEST 2007


On Tue, 2007-09-25 at 09:58 -0500, Kyle Wheeler wrote:
> On Tuesday, September 25 at 12:39 PM, quoth Timo Sirainen:
> >> How hard would this be to hack into the current Dovecot source?
> >
> >Replace mail_get_date() calls in src/imap/imap-sort.c with something
> >like:
> >
> >t = mail_get_date(..);
> >if (t == (time_t)-1) t = mail_get_received_date(..);
> 
> That's not *quite* what I meant. ARRIVAL is "when did this mail get 
> here", while DATE is supposed to be "when was this mail sent". My 
> thought here is that "when was this mail sent" can be approximated in 
> the absence of a Date header by checking the earliest timestamp in the 
> Received headers.

So, something like:

const char *const *headers = mail_get_headers(mail, "Received");
if (headers != NULL && headers[0] != NULL) {
  while (headers[1] != NULL) headers++;
  // do your Received header parsing magic for headers[0]
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070925/3106ae21/attachment.bin 


More information about the dovecot mailing list