]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
bugfix
authorTimo Sirainen <tss@iki.fi>
Thu, 21 Aug 2003 00:33:02 +0000 (03:33 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 21 Aug 2003 00:33:02 +0000 (03:33 +0300)
--HG--
branch : HEAD

src/lib-storage/index/index-mail.c

index 4b012aedceb31336b84d4f203b4b78f92a4ad375..59017b61f7494825ea4b97f3043f9fd06d3c3731 100644 (file)
@@ -413,6 +413,15 @@ static uoff_t get_size(struct mail *_mail)
        return data->size;
 }
 
+static void parse_bodystructure_header(struct message_part *part,
+                                      struct message_header_line *hdr,
+                                      void *context)
+{
+       pool_t pool = context;
+
+       imap_bodystructure_parse_header(pool, part, hdr);
+}
+
 static int index_mail_parse_body(struct index_mail *mail)
 {
        struct index_mail_data *data = &mail->data;
@@ -423,7 +432,13 @@ static int index_mail_parse_body(struct index_mail *mail)
 
        i_stream_seek(data->stream, data->hdr_size.physical_size);
 
-       message_parser_parse_body(data->parser_ctx, NULL, NULL, NULL);
+       if (data->bodystructure_header_parsed) {
+               message_parser_parse_body(data->parser_ctx,
+                                         parse_bodystructure_header,
+                                         NULL, mail->pool);
+       } else {
+               message_parser_parse_body(data->parser_ctx, NULL, NULL, NULL);
+       }
        data->parts = message_parser_deinit(data->parser_ctx);
         data->parser_ctx = NULL;
 
@@ -512,15 +527,6 @@ static struct istream *get_stream(struct mail *_mail,
        return data->stream;
 }
 
-static void parse_bodystructure_header(struct message_part *part,
-                                      struct message_header_line *hdr,
-                                      void *context)
-{
-       pool_t pool = context;
-
-       imap_bodystructure_parse_header(pool, part, hdr);
-}
-
 static const char *get_special(struct mail *_mail, enum mail_fetch_field field)
 {
        struct index_mail *mail = (struct index_mail *) _mail;