Mercurial > dovecot > core-2.2
changeset 6156:e18086698ebf HEAD
By default assume MIME message if Content-Type: exists even if Mime-Version:
doesn't. MESSAGE_PARSER_FLAG_MIME_VERSION_STRICT disables this.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 02 Aug 2007 14:21:05 +0300 |
parents | f0d8c9056706 |
children | e458f915009e |
files | src/lib-mail/message-parser.c src/lib-mail/message-parser.h |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-mail/message-parser.c Wed Aug 01 14:38:28 2007 +0300 +++ b/src/lib-mail/message-parser.c Thu Aug 02 14:21:05 2007 +0300 @@ -457,6 +457,10 @@ /* it's MIME. Content-* headers are valid */ part->flags |= MESSAGE_PART_FLAG_IS_MIME; } else if (strcasecmp(hdr->name, "Content-Type") == 0) { + if ((ctx->flags & + MESSAGE_PARSER_FLAG_MIME_VERSION_STRICT) == 0) + part->flags |= MESSAGE_PART_FLAG_IS_MIME; + if (hdr->continues) hdr->use_full_value = TRUE; else {
--- a/src/lib-mail/message-parser.h Wed Aug 01 14:38:28 2007 +0300 +++ b/src/lib-mail/message-parser.h Thu Aug 02 14:21:05 2007 +0300 @@ -5,7 +5,12 @@ #include "message-size.h" enum message_parser_flags { - MESSAGE_PARSER_FLAG_SKIP_BODY_BLOCK = 0x01 + /* Don't return message bodies in message_blocks. */ + MESSAGE_PARSER_FLAG_SKIP_BODY_BLOCK = 0x01, + /* Buggy software creates Content-Type: headers without Mime-Version: + header. By default we allow this and assume message is MIME if + Content-Type: is found. This flag disables this. */ + MESSAGE_PARSER_FLAG_MIME_VERSION_STRICT = 0x02 }; /* Note that these flags are used directly by message-parser-serialize, so