~ubuntu-branches/ubuntu/utopic/dovecot/utopic-proposed

« back to all changes in this revision

Viewing changes to src/plugins/fts/fts-build-mail.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (4.1.35 sid)
  • Revision ID: package-import@ubuntu.com-20140108093549-i72o93pux8p0dlaf
Tags: 1:2.2.9-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2006-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2006-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "istream.h"
37
37
        string_t *content_type;
38
38
 
39
39
        rfc822_parser_init(&parser, hdr->full_value, hdr->full_value_len, NULL);
40
 
        (void)rfc822_skip_lwsp(&parser);
 
40
        rfc822_skip_lwsp(&parser);
41
41
 
42
42
        T_BEGIN {
43
43
                content_type = t_str_new(64);
128
128
                addr = message_address_parse(pool_datastack_create(),
129
129
                                             hdr->full_value,
130
130
                                             hdr->full_value_len,
131
 
                                             -1U, TRUE);
 
131
                                             UINT_MAX, TRUE);
132
132
                str = t_str_new(hdr->full_value_len);
133
133
                message_address_write(str, addr);
134
134
 
170
170
                   strncmp(content_type, "message/", 8) == 0) {
171
171
                /* text body parts */
172
172
                key.type = FTS_BACKEND_BUILD_KEY_BODY_PART;
 
173
                ctx->body_parser = fts_parser_text_init();
173
174
        } else {
174
175
                /* possibly binary */
175
176
                if ((ctx->update_ctx->backend->flags &
178
179
                *binary_body_r = TRUE;
179
180
                key.type = FTS_BACKEND_BUILD_KEY_BODY_PART_BINARY;
180
181
        }
181
 
        if (ctx->body_parser == NULL)
182
 
                ctx->body_parser = fts_parser_text_init();
183
182
        key.body_content_type = content_type;
184
183
        key.body_content_disposition = ctx->content_disposition;
185
184
        return fts_backend_update_set_build_key(ctx->update_ctx, &key);
267
266
                    struct mail *mail)
268
267
{
269
268
        struct fts_mail_build_context ctx;
270
 
        enum message_decoder_flags decoder_flags = 0;
271
269
        struct istream *input;
272
270
        struct message_parser_ctx *parser;
273
271
        struct message_decoder_context *decoder;
289
287
                                     MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE,
290
288
                                     0);
291
289
 
292
 
        if ((update_ctx->backend->flags & FTS_BACKEND_FLAG_BUILD_DTCASE) != 0)
293
 
                decoder_flags |= MESSAGE_DECODER_FLAG_DTCASE;
294
 
        decoder = message_decoder_init(decoder_flags);
 
290
        decoder = message_decoder_init(update_ctx->normalizer, 0);
295
291
        for (;;) {
296
292
                ret = message_parser_parse_next_block(parser, &raw_block);
297
293
                i_assert(ret != 0);