dovecot-1.1: More fixes to SEARCH BEFORE/ON/SINCE timezone handl...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 21 18:16:42 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/ef13dd179331
changeset: 7279:ef13dd179331
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 21 18:18:08 2008 +0200
description:
More fixes to SEARCH BEFORE/ON/SINCE timezone handling.

diffstat:

1 file changed, 5 insertions(+), 1 deletion(-)
src/lib-storage/index/index-search.c |    6 +++++-

diffs (30 lines):

diff -r 27b7b6c34961 -r ef13dd179331 src/lib-storage/index/index-search.c
--- a/src/lib-storage/index/index-search.c	Thu Feb 21 15:57:48 2008 +0200
+++ b/src/lib-storage/index/index-search.c	Thu Feb 21 18:18:08 2008 +0200
@@ -4,6 +4,7 @@
 #include "ioloop.h"
 #include "array.h"
 #include "istream.h"
+#include "utc-offset.h"
 #include "str.h"
 #include "message-address.h"
 #include "message-date.h"
@@ -183,6 +184,7 @@ static int search_arg_match_cached(struc
 static int search_arg_match_cached(struct index_search_context *ctx,
 				   struct mail_search_arg *arg)
 {
+	struct tm *tm;
 	uoff_t virtual_size;
 	time_t date;
 	int timezone_offset;
@@ -194,7 +196,9 @@ static int search_arg_match_cached(struc
 	case SEARCH_SINCE:
 		if (mail_get_received_date(ctx->mail, &date) < 0)
 			return -1;
-		date -= ioloop_timezone.tz_minuteswest*60;
+
+		tm = localtime(&date);
+		date += utc_offset(tm, date)*60;
 
 		switch (arg->type) {
 		case SEARCH_BEFORE:


More information about the dovecot-cvs mailing list