dovecot: Header searches shouldn't include the header name or ":...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Feb 21 19:57:30 EET 2008
details: http://hg.dovecot.org/dovecot/rev/8d2d400fbb89
changeset: 7278:8d2d400fbb89
user: Timo Sirainen <tss at iki.fi>
date: Thu Feb 21 19:58:57 2008 +0200
description:
Header searches shouldn't include the header name or ":" in matching.
diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
src/lib-storage/index/index-search.c | 11 ++++++++---
diffs (33 lines):
diff -r 24470b86ee63 -r 8d2d400fbb89 src/lib-storage/index/index-search.c
--- a/src/lib-storage/index/index-search.c Thu Feb 21 18:58:37 2008 +0200
+++ b/src/lib-storage/index/index-search.c Thu Feb 21 19:58:57 2008 +0200
@@ -378,6 +378,14 @@ static void search_header_arg(struct mai
}
memset(&block, 0, sizeof(block));
+
+ /* We're searching only for values, so drop header name and middle
+ parts. We use header searching so that MIME words will be decoded. */
+ hdr = *ctx->hdr;
+ hdr.name = ""; hdr.name_len = 0;
+ hdr.middle_len = 0;
+ block.hdr = &hdr;
+
msg_search_ctx = msg_search_arg_context(ctx->index_context, arg);
if (msg_search_ctx == NULL)
match = FALSE;
@@ -393,14 +401,11 @@ static void search_header_arg(struct mai
(unsigned int)-1, TRUE);
str = t_str_new(ctx->hdr->value_len);
message_address_write(str, addr);
- hdr = *ctx->hdr;
hdr.value = hdr.full_value = str_data(str);
hdr.value_len = hdr.full_value_len = str_len(str);
- block.hdr = &hdr;
match = message_search_more(msg_search_ctx, &block);
} T_END;
} else {
- block.hdr = ctx->hdr;
match = message_search_more(msg_search_ctx, &block);
}
More information about the dovecot-cvs
mailing list