From 315a4b0cb535a0628d040f467f1ae9068bf85476 Mon Sep 17 00:00:00 2001 From: rbbrnc Date: Thu, 7 Apr 2011 16:57:50 +0200 Subject: [PATCH] Init mime struct --- src/utils/test_view_mail.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/utils/test_view_mail.c b/src/utils/test_view_mail.c index de07a5d..aaca87d 100644 --- a/src/utils/test_view_mail.c +++ b/src/utils/test_view_mail.c @@ -99,9 +99,25 @@ static void init_mail_header(struct mail_header *hdr) hdr->body_offset = 0L; /* MIME */ - hdr->mime.type = MIME_TYPE_UNKNOWN; + /* [RFC2045] + * If no Content-Type header field is specified, default to: + * Content-type: text/plain; charset=us-ascii + */ + hdr->mime.type = MIME_TYPE_TEXT; + hdr->mime.subtype = MIME_SUBTYPE_PLAIN; hdr->mime.disposition = MIME_DISPOSITION_UNKNOWN; - hdr->mime.transfer_encoding = MIME_ENCODING_UNKNOWN; + + /* [RFC2045] "Content-Transfer-Encoding: 7BIT" is assumed if the + * Content-Transfer-Encoding header field is not present. + * ... If a Content-Transfer-Encoding header field appears as part + * of a message header, it applies to the entire body of that message. + * If a Content-Transfer-Encoding header field appears as part of an + * entity's headers, it applies only to the body of that entity. + * If an entity is of type "multipart" the Content-Transfer-Encoding + * is not permitted to have any value other than "7bit", "8bit" or + * "binary". + */ + hdr->mime.transfer_encoding = MIME_ENCODING_7BIT; } void usage(const char *appname) -- 2.11.4.GIT