dovecot-2.1: imapc: Use SHA1 of message header for guid-forced i...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Apr 18 18:33:12 EEST 2012
details: http://hg.dovecot.org/dovecot-2.1/rev/ea7ca6330491
changeset: 14422:ea7ca6330491
user: Timo Sirainen <tss at iki.fi>
date: Wed Apr 18 18:33:02 2012 +0300
description:
imapc: Use SHA1 of message header for guid-forced instead of the entire body.
diffstat:
src/lib-storage/index/imapc/imapc-mail.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (32 lines):
diff -r 16ed300484c9 -r ea7ca6330491 src/lib-storage/index/imapc/imapc-mail.c
--- a/src/lib-storage/index/imapc/imapc-mail.c Wed Apr 18 18:09:14 2012 +0300
+++ b/src/lib-storage/index/imapc/imapc-mail.c Wed Apr 18 18:33:02 2012 +0300
@@ -309,7 +309,7 @@
buffer_free(&mail->body);
}
-static int imapc_mail_get_body_hash(struct index_mail *imail)
+static int imapc_mail_get_hdr_hash(struct index_mail *imail)
{
struct istream *input;
const unsigned char *data;
@@ -322,7 +322,7 @@
sha1_init(&sha1_ctx);
old_offset = imail->data.stream == NULL ? 0 :
imail->data.stream->v_offset;
- if (mail_get_stream(&imail->mail.mail, NULL, NULL, &input) < 0)
+ if (mail_get_hdr_stream(&imail->mail.mail, NULL, &input) < 0)
return -1;
while (i_stream_read_data(input, &data, &size, 0) > 0) {
sha1_loop(&sha1_ctx, data, size);
@@ -365,8 +365,8 @@
return -1;
}
} else {
- /* use hash of message body as the GUID */
- if (imapc_mail_get_body_hash(imail) < 0)
+ /* use hash of message headers as the GUID */
+ if (imapc_mail_get_hdr_hash(imail) < 0)
return -1;
}
More information about the dovecot-cvs
mailing list