~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-index/mail-index-sync.c

  • Committer: Bazaar Package Importer
  • Author(s): CHuck Short, Chuck Short
  • Date: 2009-11-06 00:47:29 UTC
  • mfrom: (4.1.9 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106004729-i39n7v9e7d4h51f6
Tags: 1:1.2.6-1ubuntu1
* Merge from debian testing, remaining changes:
  Add new binary pkg dovecot-postfix that integrates postfix and dovecot
  automatically: (LP: #164837)
  + debian/control:
    - add new binary with short description
    - set Architecture all for dovecot-postfix (LP: #329878)
  + debian/dovecot-postfix.postinst:
    - create initial certificate symlinks to snakeoil.
    - set up postfix with postconf to:
      - use Maildir/ as the default mailbox.
      - use dovecot as the sasl authentication server.
      - use dovecot LDA (deliver).
      - use tls for smtp{d} services.
    - fix certificates paths in postfix' main.cf
    - add reject_unauth_destination to postfix' recipient restrictions
    - add reject_unknown_sender_domain to postfix' sender restrictions
    - rename configuration name on remove, delete on purge
    - restart dovecot after linking certificates
    - handle use case when postfix is unconfigurated
   + debian/dovecot-postfix.dirs: create backup directory for postfix's configuration
   + restart postfix and dovecot.
   + debian/dovecot-postfix.postrm:
     - remove all dovecot related configuration from postfix.
     - restart postfix and dovecot.
   + debian/dovecot-common.init:
     - check if /etc/dovecot/dovecot-postfix.conf exists and use it
       as the configuration file if so.
   + debian/patches/warning-ubuntu-postfix.dpatch
     - add warning about dovecot-postfix.conf in dovecot default 
       configuration file
   + debian/patches/dovecot-postfix.conf.diff:
     - Ubuntu server custom changes to the default dovecot configuration for
       better interfation with postfix
     - enable sieve plugin
   + debian/patches/dovecot-postfix.conf.diff:
     + Ubuntu server custom changes to the default dovecot configuration for
       better integration with postfix:
       - enable imap, pop3, imaps, pop3s and managesieve by default.
       - enable dovecot LDA (deliver).
       - enable SASL auth socket in postfix private directory.
   + debian/rules:
     - copy, patch and install dovecot-postfix.conf in /etc/dovecot/.
     - build architecure independent packages too
   + Use Snakeoil SSL certificates by default.
     - debian/control: Depend on ssl-cert.
     - debian/patches/ssl-cert-snakeoil.dpatch: Change default SSL cert
       paths to snakeoil.
     - debian/dovecot-common.postinst: Relax grep for SSL_* a bit.
   + Add autopkgtest to debian/tests/*.
   + Fast TearDown: Update the lsb init header to not stop in level 6.
   + Add ufw integration:
     - Created debian/dovecot-common.ufw.profile.
     - debian/rules:
       + install profile
     - debian/control:
       + Suggest ufw
   + debian/{control,rules}: enable PIE hardening.
   + dovecot-imapd, dovecot-pop3: Replaces dovecot-common (<< 1:1.1). LP: #254721
   + debian/control:
     - Update Vcs-* headers.
   + debian/rules:
     - Create emtpy stamp.h.in files in dovecot-sieve/ and dovecot-managesieve/
       if they're not there since empty files are not included in the diff.gz 
       file.
   + Add SMTP-AUTH support for Outlook (login auth mechanism)
   + Dropped:
     - debian/patches/security-CVE-2009-3235: Applied upstream.
     - debian/patches/fix-pop3-assertion.dpatch: Applied upstream.
     - dovecot-sieve and dovecot-managesieve: Use the debian patches instead.

  [Chuck Short]
  - Updated dovecot-sieve to 0.1.13.
  - Updated dovecot-managesieve to 0.11.9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        }
42
42
}
43
43
 
 
44
static void mail_index_sync_add_expunge_guid(struct mail_index_sync_ctx *ctx)
 
45
{
 
46
        const struct mail_transaction_expunge_guid *e = ctx->data;
 
47
        size_t i, size = ctx->hdr->size / sizeof(*e);
 
48
 
 
49
        for (i = 0; i < size; i++)
 
50
                mail_index_expunge(ctx->sync_trans, e[i].uid);
 
51
}
 
52
 
 
53
 
44
54
static void mail_index_sync_add_flag_update(struct mail_index_sync_ctx *ctx)
45
55
{
46
56
        const struct mail_transaction_flag_update *u = ctx->data;
129
139
        case MAIL_TRANSACTION_EXPUNGE:
130
140
                mail_index_sync_add_expunge(ctx);
131
141
                break;
 
142
        case MAIL_TRANSACTION_EXPUNGE_GUID:
 
143
                mail_index_sync_add_expunge_guid(ctx);
 
144
                break;
132
145
        case MAIL_TRANSACTION_FLAG_UPDATE:
133
146
                mail_index_sync_add_flag_update(ctx);
134
147
                break;
461
474
        if ((ctx->flags & MAIL_INDEX_SYNC_FLAG_AVOID_FLAG_UPDATES) != 0)
462
475
                trans_flags |= MAIL_INDEX_TRANSACTION_FLAG_AVOID_FLAG_UPDATES;
463
476
        ctx->ext_trans = mail_index_transaction_begin(ctx->view, trans_flags);
 
477
        ctx->ext_trans->sync_transaction = TRUE;
464
478
 
465
479
        index->syncing = TRUE;
466
480
 
508
522
                           to be synced, but cache syncing relies on tail
509
523
                           offsets being updated. */
510
524
                case MAIL_TRANSACTION_EXPUNGE:
 
525
                case MAIL_TRANSACTION_EXPUNGE_GUID:
511
526
                case MAIL_TRANSACTION_FLAG_UPDATE:
512
527
                case MAIL_TRANSACTION_KEYWORD_UPDATE:
513
528
                case MAIL_TRANSACTION_KEYWORD_RESET:
709
724
 
710
725
        log_diff = index->map->hdr.log_file_tail_offset -
711
726
                index->last_read_log_file_tail_offset;
712
 
        if (log_diff > 1024)
 
727
        if (log_diff > MAIL_INDEX_MAX_WRITE_BYTES ||
 
728
            (index->index_min_write && log_diff > MAIL_INDEX_MIN_WRITE_BYTES))
713
729
                return TRUE;
714
730
 
715
731
        if (index->need_recreate)
759
775
        if (ret == 0 &&
760
776
            (want_rotate || mail_index_sync_want_index_write(index))) {
761
777
                index->need_recreate = FALSE;
 
778
                index->index_min_write = FALSE;
762
779
                mail_index_write(index, want_rotate);
763
780
        }
764
781
        mail_index_sync_end(_ctx);