message-header-hash.c revision afad849b4ae52ef5c42deacd523e00e69049683b
/* Copyright (c) 2013-2017 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "hash-method.h"
#include "message-header-hash.h"
unsigned int version,
{
if (version == 1) {
return;
}
/* - Dovecot IMAP replaces NULs with 0x80 character.
- Dovecot POP3 with outlook-no-nuls workaround replaces NULs
with 0x80 character.
- Zimbra replaces 8bit chars with '?' in header fetches,
but not body fetches.
- Yahoo replaces 8bit chars with '?' in partial header
fetches, but not POP3 TOP. UTF-8 character sequence writes only a
single '?'
So we'll just replace all control and 8bit chars with '?' and
remove any repeated '?', which hopefully will satisfy everybody.
*/
switch (data[i]) {
case '\t':
case '\n':
break;
default:
/* remove repeated '?' */
}
start = i+1;
}
break;
}
}
}