The result for "" should be "\n", not "\n\n". The second "\n" would belong
to the mail body.
This fixes calculating hashes for incremental dsync when mail didn't have
Date or Message-ID headers, resulting in e.g.:
Warning: Deleting mailbox 'INBOX': UID=1 already exists locally for a different mail: Headers hashes don't match (
e1c06d85ae7b8b032bef47e42e4c08f9 vs
68b329da9893e34099c7d8ad5cb9c940)
mstream->prev_matched = FALSE;
mstream->header_read = FALSE;
mstream->seen_eoh = FALSE;
+ mstream->last_added_newline = TRUE;
}
static int skip_header(struct header_filter_istream *mstream)
mstream->end_body_with_lf =
(flags & HEADER_FILTER_END_BODY_WITH_LF) != 0;
mstream->last_lf_offset = (uoff_t)-1;
+ mstream->last_added_newline = TRUE;
mstream->istream.iostream.destroy = i_stream_header_filter_destroy;
mstream->istream.read = i_stream_header_filter_read;
const char *output;
unsigned int extra;
} tests[] = {
+ { "", "\n", 0 },
{ "From: foo", "From: foo\n\n", 1 },
{ "From: foo\n", "From: foo\n\n", 1 },
{ "From: foo\n\n", "From: foo\n\n", 1 },